Re: Alt and Command keys in the quartz backend

On Tue, 2011-09-06 at 21:51 +0200, Kristian Rietveld wrote:
> On Sep 6, 2011, at 6:58 PM, Paul Davis wrote:
> > this seems to be about two different things, neither of which are in
> > conflict (and i think john actually agrees with this).
> > 
> > 1) whether or not the Alt key should generate MOD1 as a modifier
> > 2) whether or not code that wants to be cross-platform can assume that
> > they can use MOD1 with its own chosen semantics
> I have typically avoided the debate on modifiers/etc. since I am not very familiar with the X11 background of them either.
> The two things you set out indeed seem to make much sense to me. The big question to me is around (2), if MOD1 is passed by GDK, should  GTK+ or an application still include cross-platform handling or should the cross-platform handling already been taken care of?  I get the impression that given that keybindings still need cross-platform porting at the GTK+ level, the former is perhaps not a strange assumption.  For the former, having modifiers bound to keys with similar labels is, I *think*, helpful for implementing the cross-platform handling in GTK+ and/or applications. 

I agree, and I would argue like this about ALT/MOD1:

- on GTK+, ALT/MOD1 are used for mnemonics, which are typically
  translatable, which means unforeseeable, so cannot really be used
  for apps.

- on the Mac, ALT/Option is used for generating special chars, which
  are different per keyboard layout, which means unforeseeable, so
  really be used for apps.

So there is no conflict here, see below.

> > if (2) was fixed so that GTK was not an example of code that assumes
> > that MOD1 is free for any interpretation on any platform, then (1) is
> > moot, and it really doesn't matter what the Alt key generates on OS X
> > (hence, it could be MOD1).
> > 
> > but as long as (2) remains an issue within GTK itself, its hard to
> > argue that a key that has clearly different purposes for a large body
> > of platform users of OS X should be handled by GTK as if it had some
> > different meaning based on another platform.
> My impression is that GTK+ has to be fixed first here before we can consider binding the key labeled with Alt to MOD1 like is done on other platforms.

IMHO for the ALT/MOD1 mapping to work nicely, we simply need to
hardcode gtk-enable-mnemonics to FALSE and we're done. Apps are
used to have Alt-foo being taken by the system in an unpredictable
way, and Alt-mouse interaction will just start working on the Mac
too, so will keybindings that use Alt. Note that key bindings
don't have above "being taken" problem, since they will typically
modify a widget's key binding to do exactly what the respective
Mac control does, so there should be no conflict.

Did I miss anything here?


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