[Qt-interest] KDE, keyboard layouts and shortcuts in Qt applications

Hans Chen hanswchen at gmail.com
Thu Apr 9 11:27:08 CEST 2009


Hi,

Some weeks ago, I sent a mail to qt-interest regarding a keyboard shortcut
issue in Qt. However, I never got any replies. Being a non-subscriber, I
suspected that my message never got posted on the list.

Therefore i decided to try to resend the mail; you can find the original
message below. Note that I'm subscribed to the list now, so no need to cc
me.

With best regards,
Hans Chen

---------- Forwarded message ----------
From: Hans Chen <hanswchen at gmail.com>
Date: Sun, Feb 15, 2009 at 3:11 PM
Subject: KDE, keyboard layouts and shortcuts
To: qt-interest at trolltech.com


Hi,

I have a strange problem with KDE and keyboard shortcuts. Upon further
investigations, I found that other Qt applications[1} were affected, but not
applications using other toolkits[2]. Suspicious. I wonder if it could be a
Qt bug, and that's why I'm writing to this list.

*Background

*I'm a Dvorak user, which means I have two keyboard layouts on my computer:
QWERTY for other people to use and Dvorak for myself. To manage this, I use
the module in System Setting, which is included in KDE 4.2. See the
following screenshot:

http://hanswchen.files.wordpress.com/2009/02/keyboard1.png

Note that I use a recent version of Xorg, which means that input hotplugging
is enabled.

*Problem*

There is no problem with the layout switching - when I change to Dvorak, all
the keys are remapped to Dvorak as expected. However, all keyboard shortcuts
(Alt-<letter>, Ctrl-<letter> etc.) are still in QWERTY. For example, 'O' in
Dvorak is 'S' in QWERTY. If I press Ctrl-O when the keys are mapped to
Dvorak, the Qt applications think that I've pressed Ctrl-S. But if I press
'O' in a text field, I get an 'O' as expected.

* More Observation*

   - If I switch place between 'se' and 'se dvorak' in list (see screenshot
   above), all shortcuts are in Dvorak instead -  even when I use the QWERTY
   layout.
   - 'us dvorak' has the same problem, so it doesn't matter if the variants
   are from the same layout or not.
   - Manually running "setxkbmap se -variant dvorak" actually works; no
   problem with shortcuts.

*Information*

I use Arch Linux <http://www.archlinux.org/>, which means that most software
are up to date. More specific:

   - Qt version: 4.4.3
   - KDE[3] version: 4.2
   - Xorg-server version: 1.5.3

The computer is a Samsung NC10 (netbook). I couldn't reproduce this on my
computer which run KDE 3.5.7 and Qt 3.3.8, but I don't think it uses input
hotplugging either.

*How to reproduce*

If you run KDE 4.2:

   1. Go to System Settings -> Regional & Language -> Keyboard Layout.
   Choose "Enable keyboard layouts".
   2. Your preferred layout should already be in the list. If not, add it.
   Then add another layout and choose variant 'Dvorak'. Make sure the new
   layout is below your preferred.
   3. Open an application to test the shortcuts. I use Dolphin as an
   example.
   4. Switch to Dvorak by clicking on the flag in system tray.
   5. Press a shortcut, for example Ctrl-L, as if you were typing QWERTY.
   6. See what happens. If the shortcuts are in Dvorak, it should open a new
   window (Ctrl-N). Otherwise, as in my case, it'll focus the location bar
   (Ctrl-L)


I hope you can help me to sort this out. I was thinking about installing
KDE3 on the same computer and see if I could reproduce it using Qt3, but
unfortunately I don't think I have the time at the moment.

I'm not subscribed to the list, so I would appreciate if you could cc me.

With best regards,
Hans Chen

--
[1] I tried many KDE applications,
Shaman<http://bbs.archlinux.org/viewtopic.php?id=46600>and Qt 4
Assistant.
[2] The shortcuts in Firefox and Pidgin worked as expected.
[3] I use the KDEmod <http://chakra-project.org/about-kdemod.html> packages.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090409/e5cb2704/attachment.html 


More information about the Qt-interest-old mailing list