GNOME Bugzilla – Bug 161814
CapsLock key should act as ShiftLock in some keyboard locales
Last modified: 2005-01-19 22:53:34 UTC
This is a problem with all the runtime windows. Actualy i use gtk+ 2.4.14 and xp. When i put caps lok on the key board, it's impossible to get Ï, i always obtain Î. Thanks Bruno Albouy
GTK's handling of CapsLock seems a bit different than what most Windows apps do (I.e. presumably what TranslateMessage() does when turning WM_KEYDOWN and _UO messages into WM_CHAR messages. GTK+ doesn't use WM_CHAR.) In GTK+, at least in 2.4.14, CapsLock isn't used for dead keys, so you will have to press shift to get the diaeresis even if you have CapsLock on. This probably should be fixed to match user expectation. (Note to others without a French keyboard: See http://www.microsoft.com/globaldev/reference/keyboards.aspx )
Created attachment 35068 [details] [review] Suggested patch Suggested patch for gtk-2-4. For HEAD similar, but there are a couple of more dead keysyms there, and IS_DEAD_KEY's upper limit should be GDK_dead_horn. Or can one assume that all keysyms between 0xFE50 and 0xFEFF will be dead in the future?
BTW, is the "CapsLock" key labeled "CapsLock" (in French) or "ShiftLock" on French keuboards? On the Finnish/Swedish keyboard which I am typing on, the CapsLock key is labeleled "Caps Lock" (in English, even). The Finnish/Swedish keyboard, too, has a key with just dead accents on it. With this keyboard locale, in non-GTK Windows apps, the behaviour of the CapsLock key *is* CapsLock, it doesn't shift the dead-accent-only key's behaviour. You have to press also Shift to get the shifted accent even if CapsLock is on. But if I switch to a French keyboard locale, the CapsLock key acts as ShiftLock. So, I guess the above patch is wrong, gdk/win32 shouldn't use CapsLock as ShiftLock in all locales. It should determine the correct semantics of the CapsLock key for the keyboard locale being used. I guess ToAsciiEx can be used to figure out that, too.
I now notice that the behaviour of the top row of keys (the one with the digits) when CapsLock is toggled on a French keyboard also differs between GTK+ and "normal" Windows apps. Why hasn't anybody complained about this, surely this also foes against user expectation? The French CapsLock really should be considered ShiftLock. Changing summary to describe a more general problem.
Created attachment 35770 [details] [review] Improved patch Improved patch, for HEAD this time. No longer handle dead keys specially. Instead, when setting up the keymap, also check whether the CapsLock key actually is ShiftLock, and work accordingly in gdk_keymap_translate_keyboard_state().
Could you guys on gtk-win32-maint please try that patch, and see if the behaviour of they keyboard for whatever weird corner cases you can think of chanegs (to the better)?
Patch committed to HEAD and gtk-2-6: 2005-01-19 Tor Lillqvist <tml@novell.com> * gdk/win32/gdkkeys-win32.c (update_keymap, gdk_keymap_translate_keyboard_state): Handle keyboards with ShiftLock (and not CapsLock) correctly. (#161814)