After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 161814 - CapsLock key should act as ShiftLock in some keyboard locales
CapsLock key should act as ShiftLock in some keyboard locales
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: Win32
2.4.x
Other Windows
: Normal normal
: Small fix
Assigned To: gtk-win32 maintainers
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2004-12-20 18:53 UTC by Albouy Bruno
Modified: 2005-01-19 22:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Suggested patch (1.63 KB, patch)
2004-12-21 00:06 UTC, Tor Lillqvist
needs-work Details | Review
Improved patch (5.27 KB, patch)
2005-01-10 02:34 UTC, Tor Lillqvist
none Details | Review

Description Albouy Bruno 2004-12-20 18:53:06 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
Comment 1 Tor Lillqvist 2004-12-20 23:01:15 UTC
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 )
Comment 2 Tor Lillqvist 2004-12-21 00:06:39 UTC
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?
Comment 3 Tor Lillqvist 2005-01-09 23:34:48 UTC
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.

Comment 4 Tor Lillqvist 2005-01-09 23:47:35 UTC
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.
Comment 5 Tor Lillqvist 2005-01-10 02:34:42 UTC
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().
Comment 6 Tor Lillqvist 2005-01-12 21:32:59 UTC
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)?
Comment 7 Tor Lillqvist 2005-01-19 22:53:34 UTC
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)