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 118022 - Accelerator using Fn and modifiers doesn't work
Accelerator using Fn and modifiers doesn't work
Status: RESOLVED DUPLICATE of bug 100439
Product: gtk+
Classification: Platform
Component: .General
2.2.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2003-07-21 20:16 UTC by Felipe Heidrich
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
test case (1.61 KB, text/plain)
2003-07-21 20:17 UTC, Felipe Heidrich
Details

Description Felipe Heidrich 2003-07-21 20:16:30 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.
Comment 1 Felipe Heidrich 2003-07-21 20:17:32 UTC
Created attachment 18493 [details]
test case
Comment 2 Felipe Heidrich 2003-07-23 15:23:38 UTC
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.
Comment 3 Owen Taylor 2003-07-23 15:34:59 UTC
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 ***