Review Request: Fix global shortcuts that needs shift key, like for example ctrl+% (ctrl+shift+5 on many keyboards)
Simon Persson
simonpersson1 at gmail.com
Wed Jun 8 04:49:41 BST 2011
> On June 7, 2011, 4:28 p.m., Michael Jansen wrote:
> > Why don't you fix KKeyServer to return the correct results instead of fixing the wrong ones here?
Yes, my first thought was to fix this by changing KKeyServer::keyQtToModX to add Shift to the modifiers if it is needed to get the symbol. This could be done using the (currently unused) function getModsRequired(uint sym) in kkeyserver_x11.cpp. But this is public API and I don't know what other users there are and what the expected behavior is, changing it to do add modifiers that were not there based on the behavior of some widget for entering shortcuts could be considered unexpected:)
Same goes for KKeyServer::xEventToQt(), that would need to be changed to strip Shift modifier in the cases where KKeySequenceWidget has removed it.
The positive thing about doing it this way would be that isShiftAsModifierAllowed() would not need to be exported, it could be in a private header as Aaron suggested in the other review request.
- Simon
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/101520/#review3751
-----------------------------------------------------------
On June 6, 2011, 11:02 a.m., Simon Persson wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/101520/
> -----------------------------------------------------------
>
> (Updated June 6, 2011, 11:02 a.m.)
>
>
> Review request for KDE Runtime and Michael Jansen.
>
>
> Summary
> -------
>
> Second patch to fix this bug, depends on patch in review request 101515.
>
> KKeySequenceWidget used to enter shortcuts removes shift from the recorded shortcut if the symbol produced from that physical key is different when shift is used (upper/lowercase letters doesn't count). kglobalaccel needs to include shift in the grab in order to be triggered on this class of shortcuts, and then in the keypress event handler it also needs to strip the shift again before checking which shortcut was just triggered.
>
>
> This addresses bugs 179504, 197548 and 215030.
> http://bugs.kde.org/show_bug.cgi?id=179504
> http://bugs.kde.org/show_bug.cgi?id=197548
> http://bugs.kde.org/show_bug.cgi?id=215030
>
>
> Diffs
> -----
>
> kglobalaccel/kglobalaccel_x11.cpp 2576d2e
>
> Diff: http://git.reviewboard.kde.org/r/101520/diff
>
>
> Testing
> -------
>
> Tested using the master branch, running in a Xephyr session using gb,us and se keyboard layouts. The tested layout needs to be the first entry in the list of layouts in the keyboard layout switcher, otherwise it will not work. Works for all the !"£$%^&*()_+ etc, no regression on shortcuts with only a number, only a letter or shift+letter. Also no regression on alt+shift+tab or ctrl+shift+esc.
>
>
> Thanks,
>
> Simon
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20110608/91d31e3c/attachment.htm>
More information about the kde-core-devel
mailing list