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 688462 - Add more keys to unmodified keybindings "whitelist"
Add more keys to unmodified keybindings "whitelist"
Status: RESOLVED FIXED
Product: gnome-settings-daemon
Classification: Core
Component: plugins
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-settings-daemon-maint
gnome-settings-daemon-maint
Depends on:
Blocks:
 
 
Reported: 2012-11-16 13:49 UTC by Jacob Winski
Modified: 2013-02-15 16:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
PATCH adding ScreenLock, Pause & Insert to whitelist (963 bytes, patch)
2012-11-16 13:49 UTC, Jacob Winski
committed Details | Review

Description Jacob Winski 2012-11-16 13:49:14 UTC
Created attachment 229131 [details] [review]
PATCH adding ScreenLock, Pause & Insert to whitelist

Add keys that don't have side-effects to the unmodified keybindings' "whitelist". On my keyboard, these would be:
Scroll Lock
Pause
Break

Poblem: currently cannot bind keys like Scroll Lock without modifier.

SOLUTION #1:

See **attached patch** which adds the 3 keys above to the "whitelist".

SOLUTION #2: 

Add these keys to gsd-keygrab.c file via these lines:
key->keysym != GDK_KEY_Scroll_Lock &&
key->keysym != GDK_KEY_Pause &&
key->keysym != GDK_KEY_Break &&

To this code:
       if (!(flags & GSD_KEYGRAB_ALLOW_UNMODIFIED) &&
            (modifiers & gsd_used_mods) == 0 &&
            !IN_RANGE(key->keysym, XF86KEYS_RANGE_MIN, XF86KEYS_RANGE_MAX) &&
            !IN_RANGE(key->keysym, FKEYS_RANGE_MIN, FKEYS_RANGE_MAX) &&
             key->keysym != GDK_KEY_Pause &&
             key->keysym != GDK_KEY_Print &&
             key->keysym != GDK_KEY_Menu) {
                GString *keycodes;

Currently that is line 171. See here:
http://git.gnome.org/browse/gnome-settings-daemon/tree/plugins/common/gsd-keygrab.c#n166

ADDITIONAL SUGGESTIONS:

I *highly* suggest going through the all the possible GDK keys and adding additional ones to the "white list" above. All GDK keys are listed in this file:
http://git.gnome.org/browse/gtk+/plain/gdk/gdkkeysyms.h

While I understand the rationale behind not allowing unmodified keys, please keep in mind that different keyboards have different keys and layouts and the way it works now is very restrictive.
Comment 1 Bastien Nocera 2013-02-15 16:38:39 UTC
Fixed in GNOME 3.7, thanks for the patch.