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