Menu

#150 Shift key in keyboard shortcuts in 1.1.0

pending-accepted
nobody
Bug (19)
5
2012-07-28
2012-03-16
Anonymous
No

I'm running mooedit 1.1.0 under xfce with gtk 2.24.10, and there are issues with regards to the keyboard shortcuts. I noticed that the default "find prev" shortcut was not working (it would just find next). When I tried to change the shortcut to a custom shortcut, whenever I pressed "shift" followed by "f3", only "f3" would ever be registered.

I'm a software engineer, but havent ever done any gtk programming, but I had a quick look into the source code. Essentially what was happening was that the "Shift" key was not being applied as a modifier to the function key. It was being consumed by the gdk_keymap_translate_keyboard_state function, but was not modifying the keyval at all.

I created a quick patch which allowed it to work when using "global" shortcuts, but I'm not sure what the difference is between global and regular shortcuts, so it doesnt work with regular shortcuts.

I've attached the patchs, let me know if there is anything else i can provide.

Discussion

  • Yevgen Muntyan

    Yevgen Muntyan - 2012-07-27
    • status: open --> open-accepted
     
  • Yevgen Muntyan

    Yevgen Muntyan - 2012-07-27

    This is a gtk bug: https://bugzilla.gnome.org/show_bug.cgi?id=671562
    The patch isn't right, because what the code does is exactly contrary to the patch - looking at the event->state directly is wrong, and gdk_keymap_translate_keyboard_state() must be used to get correct modifiers. That of course applies only to the case when there is no bug in gdk_keymap_translate_keyboard_state(). Not sure what to do about this.

     
  • Yevgen Muntyan

    Yevgen Muntyan - 2012-07-28

    I've checked in a partial workaround, pretty much the same as your patches, except it's restricted to function keys only. Given that gnome-terminal suffers from the same problem, I hope that this will be fixed in Gtk soon.
    https://bitbucket.org/medit/medit/changeset/1f65b486f6f485b78770e99d191797e003b27272

     
  • Yevgen Muntyan

    Yevgen Muntyan - 2012-07-28
    • status: open-accepted --> pending-accepted
     

Log in to post a comment.