[gtk-osx-users] Switching keyboard layouts with Alt+Cmd+Space

There is bug filled on Bugzilla https://bugzilla.gnome.org/show_bug.cgi?id=711019 about issue when some of globally defined shortcuts like Alt+Cmd+Space or Cmd+` does not work.
I did some investigation how to rectify this problem, so find attached patch for gdk/quartz/gdkkeys-quartz.c that makes above mentioned shortcuts to work again. 
The fix obviously is not perfect, I did made it in similar style like in bug 711019. These shortcuts are hard-coded and user does not have possibility to redefine them. I am not sure if place of such fixes in gdk/quartz; maybe it is better to define some toplevel bindings in OSX application, and process them here, so each application can redefine them as needed. Or make it part of gtk-mac-integration package, and set accelarator for it like it is done for Cmd+H or Cmd+M.
Just few comments how Alt+Cmd+Space works. At first, I should mention, that there is no standard function that would give You list of keyboard inputs that are active, identical to the one we can get by clicking on the flag in app bar (You are getting "flag dropdown" here).
Next, ordering on keyboard inputs depends on ordering of Language Preferences that are accesible from Settings. The higher some language is in preference, the higher it is located in the flag dropdown. Unfortunately, there is one issue that I did not managed to solve. Input modes (like Romaji and Hiragana for Japanese input) does not follow this rule - it seems there is some lookup table with priorities. So, for making this hack complete we would need to add lookup table for input modes.
My testing of keyboard input switching was limited, however, mostly it does the job (except for some configurations of input modes and language preferences when shortcut does not always select next language from the flag dropdown). From the other hand nobody is perfect, and I think this code can be made better.

Attachment: gdkkeys-quartz.patch
Description: Binary data

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