Accelerators work with additional keys

Bug #1686937 reported by Kevin Brubeck Unhammer
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Sakura
Confirmed
Medium
Unassigned

Bug Description

Key binding for changing the font size is Ctrl+plus/minus but Ctrl+Shift or Ctrl+Shift+Alt works too (and it shouldn't). Same is applicable to other keybindings.

Revision history for this message
Arnaudv6 (arnaudv6) wrote :

I am affected, and think this is linked to https://bugs.launchpad.net/sakura/+bug/1673068

Revision history for this message
Arnaudv6 (arnaudv6) wrote :

actually, I'm not affected, I just proofread my sakura.conf with the
cheat sheet I posted in https://bugs.launchpad.net/sakura/+bug/689572
And every thing looks in order now.

Revision history for this message
Mikel Ward (mbward) wrote :

I think this is caused by checking if the modifier key is pressed, instead of checking if *only* that modifier key is pressed.

Based on https://developer.gnome.org/gdk3/stable/gdk3-Windows.html#GdkModifierType, we can't check if they match exactly, we have to mask out reserved masks, which we do using GDK_MODIFIER_MASK.

The attached patch should do this. It also lets me set

copy_accelerator=4

and have
Ctrl+C = copy
Ctrl+Shift+C = interrupt

Revision history for this message
Mikel Ward (mbward) wrote :

Hmm, that doesn't work if e.g. Num Lock is pressed.

Next thought: try doing gdk_keymap_add_virtual_modifiers then mask out everything except SHIFT, CONTROL, SUPER, HYPER, and META (and maybe LOCK). Hopefully there is already a library for this, or there is a better approach.

Revision history for this message
Mikel Ward (mbward) wrote :

Something using gtk_accelerator_get_default_mod_mask seems right.
https://developer.gnome.org/gtk3/stable/checklist-modifiers.html

Revision history for this message
Seth LaForge (sethml) wrote :

I fixed this by editing ~/.config/sakura/sakura.conf to change font size with ctrl-shift-minus and ctrl-shift-equals (plus) - at that point ctrl-minus results in the ctrl-underscore key, which is what I wanted:

font_size_accelerator=5
increase_font_size_key=plus
decrease_font_size_key=minus

David Gómez (dabisu)
summary: - ctrl+shift+minus overridden by control+minus
+ Accelerators work with additional keys
description: updated
Changed in sakura:
status: New → Confirmed
importance: Undecided → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.