Re: [Gtk-osx-users] keymap (meta vs alt)



On Oct 3, 2010, at 7:30 AM, John Ralls wrote:

> 
> On Oct 2, 2010, at 7:58 PM, Phillip Heller wrote:
> 
>> John et al,
>> 
>> Do I understand correctly that a patch has been applied against the gtk-osx stable branch gtk+ to correct the keymap weirdness??
>> 
>> I ask because I'm finally getting back to fixing up the key modifiers, and it seems to still be misbehaving.
>> 
>> I have an accelerator CMD-O which invokes a "Connect" dialog, defined like so:
>> 
>> gtk.accel_map_add_entry('<tryton>/File/Connect', gtk.keysyms.O, gtk.gdk.META_MASK)
>> 
>> And, I have buttons in a common "OK" / "Cancel" dialog, defined like so:
>> 
>> dialog.add_button("gtk-cancel", gtk.RESPONSE_CANCEL)
>> dialog.add_button("gtk-ok", gtk.RESPONSE_OK | gtk.CAN_DEFAULT | gtk.HAS_DEFAULT)
>> 
>> If I invoke the "Quit" action via CMD-Q, the dialog is displayed (as expected).  CMD-O invokes the "Connect" dialog (as expected, though I should probably make the OK/Cancel for 'quit' a modal dialog), but no key combinations invoke "OK" at this dialog.
>> 
>> Another similar situation; I have a "Connect" button within the Connect dialog itself, defined as follows:
>> 
>> self.button_connect = gtk.Button(_('C_onnect'))
>> 
>> This button does not activate with any key combination.
>> 
>> Anyways, just wondering if this is something that was supposed to be fixed, or if it's still outstanding.
>> 
> 
> What's fixed is that your command-o accelerator works in gtk-2.20 and later, as do the standard bindings in gtk/gtkrc.key.mac. This worked in 2.18, but was broken in master last December
> 
> There's a problem with mnemonics, which is that by default they use <Alt> with the underlined letter. On a mac, that key combination is used to extend the keyboard to produce additional letters (which ones of course depends on the active key map).  The gdk keymapping code eats <Alt> and returns the extended letter (<Alt>o returns ø). I'm currently working on that, so your letter is timely: I hadn't considered mnemonics.
> 
> I think that they're going to have to use <control> instead of <alt>, though. Otherwise someone is going to want to have
> (e.g.) _ø for a mnemonic, and there's no way to get there with <alt>.
> 
> BTW, there's no support for mnemonics in menus on OSX. http://hints.macworld.com/article.php?story=20071029162002292 explains keyboard menu navigation for Tiger and Leopard (Snow Leopard is the same as Leopard).


Followup: I just tested with test-integration (admittedly in C, not Python) and the mnemonics work fine with <command>-foo. There's a catch, though: If your mnemonic uses the same key as a menu accelerator, the menu accelerator will override it if you haven't called gtk_osxapplication_set_use_quartz_accelerators(theApp, FALSE). Unfortunately, it looks like menu accelerators is broken in 2.20 with quartz accelerators turned off,
so I'll have to investigate that.

Regards,
John Ralls
------------------------------------------------------------------------------
Virtualization is moving to the mainstream and overtaking non-virtualized
environment for deploying applications. Does it make network security 
easier or more difficult to achieve? Read this whitepaper to separate the 
two and get a better understanding.
http://p.sf.net/sfu/hp-phase2-d2d
_______________________________________________
Gtk-osx-users mailing list
Gtk-osx-users lists sourceforge net
https://lists.sourceforge.net/lists/listinfo/gtk-osx-users


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