Bug 173246 - Configure Shortcuts dialog doesn't work with some Ctrl+Shift combinations
Summary: Configure Shortcuts dialog doesn't work with some Ctrl+Shift combinations
Status: RESOLVED FIXED
Alias: None
Product: kdelibs
Classification: Frameworks and Libraries
Component: kdeui (show other bugs)
Version: 4.1
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-21 18:57 UTC by Robin Pedersen
Modified: 2008-12-23 10:10 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Possible patch (639 bytes, patch)
2008-10-21 19:25 UTC, Robin Pedersen
Details
A second take (983 bytes, patch)
2008-10-22 10:00 UTC, Robin Pedersen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Robin Pedersen 2008-10-21 18:57:28 UTC
Version:            (using KDE 4.1.2)
OS:                Linux
Installed from:    Ubuntu Packages

I have a standard US keyboard layout, where one key is mapped to [ without shift and { with shift pressed.

I want to use Ctrl+Shift+[ as a shortcut. This is not possible in the configure shortcuts dialog, because if I press those keys the shortcut is set to Ctrl+Shift+{, which doesn't work.

If I edit the rc file manually, and replace "Ctrl+Shift+{" with "Ctrl+Shift+[", the shortcut works as expected.

I suspect that this bug affects many other combinations with Ctrl+Shift.

The bug is still present in current trunk, but not in KDE3.
Comment 1 Robin Pedersen 2008-10-21 19:25:47 UTC
Created attachment 28053 [details]
Possible patch

I think this is quite difficult to fix, because how QKeyEvent is implemented.

This patch kind of works, but it sets the shortcut to Ctrl+{ not Ctrl+Shift+[

In practice they are the same on my keyboard setup.
Comment 2 Robin Pedersen 2008-10-21 22:53:52 UTC
With the patch above, it's not possible to create shortcuts like Ctrl+Shift+A.
Comment 3 Andreas Pakulat 2008-10-21 23:24:28 UTC
Recently Michael (Jansen) told me that the bug is in Qt and needs to be fixed there. So please write to qt-bugs and inform one of our TT contacts about the urgency of this fix. Maybe it'll still make it into 4.5...
Comment 4 Robin Pedersen 2008-10-21 23:30:20 UTC
I'm not sure if I agree that this is a Qt bug. If I understand it correctly, it's quite difficult to get this right with the current behavior of QKeyEvent. However, I wouldn't call it a bug, and a request to TT would be to change the current behavior or add a new feature, rather than a normal bug report.
Comment 5 Robin Pedersen 2008-10-22 10:00:02 UTC
Created attachment 28062 [details]
A second take

This patch does the same thing with special characters like [{+, but allows Shift to be used as modifier with letters, function keys, Return, Space and Backspace.
Comment 6 Michael Jansen 2008-10-26 01:20:10 UTC
I now agree it's not a qt bug. I got that information from someone else but after looking at the code noticed:

1. The shift handling is added by our code
2. qt's doc explicitly says it's not a good idea to do that. 

That's why i tried to find out the motivation behind adding the code. The motivation seems to be to allow handling of shift+<function keys> and to make the difference between ctrl-F and ctrl-f more visible or, as robin noted in his email, to make it possible to distinguish those to in the first place. That's why i favor Robins second patch allowing shift as modifier only for letters and function keys.

@Robin I will test your patch and will most likely apply it. Or do you have a svn account?

Mike
Comment 7 Robin Pedersen 2008-10-26 11:23:19 UTC
I do have an svn account, but I think it's probably better if you do it. I'm on holiday atm, and it probably needs some improvement. It handles some keys like space, return and backspace, but there may be other keys that I didn't think of.
Comment 8 Michael Jansen 2008-10-26 21:22:05 UTC
SVN commit 876224 by mjansen:

Itr started and ended fixing

BUG: 173246

But it's much more. Until know the recording of shortcuts went like this:

Press some modifiers, type some keys. The moment you released a modifier
recording was stopped. There were some problems:

1. The resulting shortcut was not as expected CTRL-A,CTRL-B but CTRL-A,b.
2. It was impossible to enter CTRL-A,CTRL-B.
3. It was impossible to enter CTRL-A,SHIFT-B
4. (Bug 173246)

This patch hopefully fixes all of them.

 M  +58 -31    kkeysequencewidget.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=876224
Comment 9 hector acosta 2008-12-13 20:42:44 UTC
Don't know if it is related, but as of kde 4.1.82 
ctrl+alt+up and
ctrl+alt+shift+up conflict with one another (the shift key is ignored)
Comment 10 Dario Andres 2008-12-13 21:42:48 UTC
Here using:

Qt: 4.4.3
KDE: 4.1.85 (KDE 4.1.85 (KDE 4.2 Beta2))
kdelibs svn rev. 896338 / kdebase svn rev. 896338

It seems that the "Shift" modifier isn't recognized in some situations.

Testcase:
- Open SystemSettings
- Go to Keyboard & Mouse -> Global Keyboard Shortcuts
Select a random Action "A", and assign a random keys combination (ex. "Ctrl+A")
Select another Action "B" and assign it the same key combination plus Shift
(ex. "Ctrl+Shift+A")
A conflict window appears showing that "Ctrl+A" is already assigned to Action
"A". (it displays both key combinations as "Ctrl+A", like the "Shift" modifiers
wasn't recognized at all)

This also happens with another combinations like "Ctrl+Alt+Letter" and
"Ctrl+Alt+Shift+Letter"

Can anyone confirm this?  Thanks :)
Comment 11 Robin Pedersen 2008-12-23 10:08:47 UTC
@Dario: Works for me, using beta2 and current trunk.
Comment 12 Robin Pedersen 2008-12-23 10:10:17 UTC
SVN commit 900539 by rpedersen:

Allow shift modifier with Up, Down, Left, Right and Insert keys.

BUG: 173246

 M  +5 -0      kkeysequencewidget.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=900539