discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ALT as a click modifier


From: Ivan Vučica
Subject: Re: ALT as a click modifier
Date: Thu, 25 Jul 2013 12:57:46 +0200

Well, I did not reply because I don't think I have much useful feedback (nor would I be able to contribute the changes below any time soon). And I have no idea if it already works like this or if it makes sense; if it does, then ignore these ramblings and accept my apologies. Here goes.

To be honest, I'd be for changing **GNUstep** to interpret Super as the Command key. As far as I'm familiar with window managers under UNIX, such new default should only pose problems with Canonical's Unity, and under Windows. (And maybe under KDE if it is mapping the Super key to the start menu -- does it? I don't know.)

To expand further, this should probably be something that NSInterfaceStyle changes. If NSWindows95InterfaceStyle is used (Gtk theme incuded), then interpret Ctrl as Command, Alt as Option, Super as Ctrl. If NSMacintoshInterfaceStyle or NSNextInterfaceStyle is used, then interpret Super as Command, Alt as Option and Ctrl as Ctrl.

That would provide sane defaults for applications such as Graphos.

But that's all hypothetical and long term.

Short term, why not implement 2)? There are so many window managers and platforms and even possible combinations of GNUstep options that just providing fixed mappings won't satisfy everyone.

On Thu, Jul 25, 2013 at 12:23 PM, Riccardo Mottola <riccardo.mottola@libero.it> wrote:
Hi,

I got soo many suggestions, that I am confused ;)

Riccardo


Riccardo Mottola wrote:
Hi,

after William's advice, I changed Graphos mouse-event key-modifier for certain operations to Alternate, to be more similar to other applications.

Graphos handles three different modifiers: shift, control, alt (method below).

Originally "alt" was mapped to NSCommandKeyMask. This would usually work fine on GNUstep with the standard setup, but on Mac you needed "command", as it is obvious. Now I set it to Alternate and it works like a charm on Mac, but not on GNUstep: there is no key combination that returns Alt.
I fear this is a similar problem as the one with alt as key-modifier for Emacs that Fred had.

I tried to remap keys using SystemPreferences, so that "command" becomes the WindowKey, thus I could map Alternate to Meta. That way, it works on GNUstep too, essentially it behaves like on Mac. However, The windows key is not always available, people usually run with the standard setup.

What options do I have?

1) #ifdef in the code for GNUstep and Mac. Horrible, but quick and works
2) Introduce preferences in graphos where the behaviour is customizable. This would be an advanced version of 1)
3) interpret both Command and Alternate as altClick. Looks dirty to me and probably would not work if on GS command gets mapped to control
4) change GS's gehaviour to issue "alt" if alt gets clicked and in case command is alt, both alt and command are returned as modifier (is this even possible?)
5) ...? what other option



Riccardo

---
    if([theEvent type] == NSLeftMouseDown
       || [theEvent type] == NSLeftMouseDragged)
    {
        if([theEvent modifierFlags] & NSShiftKeyMask)
            shiftclick = YES;
        else
            shiftclick = NO;
        if([theEvent modifierFlags] & NSAlternateKeyMask)
            altclick = YES;
        else
            altclick = NO;
        if([theEvent modifierFlags] & NSControlKeyMask)
            ctrlclick = YES;
        else
            ctrlclick = NO;
    }

    else if([theEvent type] == NSLeftMouseUp)
    {
        if(!([theEvent modifierFlags] & NSShiftKeyMask))
            shiftclick = NO;
        if(!([theEvent modifierFlags] & NSAlternateKeyMask))
            altclick = NO;
        if(!([theEvent modifierFlags] & NSControlKeyMask))
            ctrlclick = NO;
    }

_______________________________________________
Discuss-gnustep mailing list
Discuss-gnustep@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnustep


_______________________________________________
Discuss-gnustep mailing list
Discuss-gnustep@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnustep



--
Ivan Vučica
ivan@vucica.net

reply via email to

[Prev in Thread] Current Thread [Next in Thread]