GNOME Bugzilla – Bug 118022
Accelerator using Fn and modifiers doesn't work
Last modified: 2004-12-22 21:47:04 UTC
Accelerators like F1+Control, F5+Shift, etc. ignores it's modifier. For example, The accelerator F1+Control is fired when F1 key is pressed (even without holding the Control key down). The attached test case shows the problem.
Created attachment 18493 [details] test case
I've debuged this problem, using the test case I've attached (removing line 30) I press only F1 (the accelerator should only fire with Control F1). and I got the following stacktrace: gtk_window_key_press_event() _gtk_window_activate_key() _gtk_key_hash_lookup () Inside _gtk_key_hash_lookup () there is call to: gdk_keymap_translate_keyboard_state (key_hash->keymap, hardware_keycode, state, group, &keyval, &effective_group, &level, &consumed_modifiers); After that I had (all in binary): entry->modifiers = 100 (the modifier for the entry is Control) mask = 1101 (mask = Control | Shift | Alt) state = 10000 (numlock is on, Control is off!) consumed_modifiers = 110000000001110 (among other stuffs, Control key is consumed ?) I believe this is the problem, why did F1 consumed Control key ? After this, still inside _gtk_key_hash_lookup (), there is the test: if ((entry->modifiers & ~consumed_modifiers & mask) == (state & ~consumed_modifiers & mask)) Which is true for the given parameters, so _gtk_key_hash_lookup () has a /* Exact match */. I don't have much more time to spend on this problem, any help is more than welcome. Thanks.
Control-key is consumed because Control-Alt-F1 (on XFree86-4.3.0) is XF86_Switch_VT_1. *** This bug has been marked as a duplicate of 100439 ***