[Xfce-bugs] [Bug 7845] Shortcuts are started when keys are pressed, not when they are released.

bugzilla-daemon at xfce.org bugzilla-daemon at xfce.org
Wed Sep 28 22:17:46 CEST 2016


https://bugzilla.xfce.org/show_bug.cgi?id=7845

--- Comment #41 from Kipps <nkipps at gmail.com> ---
> So the desired behavior is achieved by breaking down key combinations into
> presses and releases. Super+E is actually Super press + E press. Super
> (standalone) is actually Super press + Super release, where any keys in
> between break the combination.
Yes. However, if you want to emulate 100% of the capabilities of Windows,
there's a few other cases that may not be handled with simply tracking the
press/release of each key. For example, The following sequence in Windows:

Super press -> E press -> E release -> R press -> R release -> Super release

will invoke the shortcuts for both Super+E and Super+R, even though Super was
not released and repressed between pressing E and R. I'm no coder and don't
know how the underlying keyboard system works, but perhaps something like this:

when.keypress ($key) {
     if ($SUPERisdepressed = 1) then do SUPERand[$key]function
     if ($CTRLisdepressed = 1) then do CTRLand[$key]function
     if ($ALTisdepressed = 1) then do ALTand[$key]function
     else passkeytoprogram($key)
}

But that's probably horrible and inefficient with whatever keyboard interfaces
are present. The basic idea is that instead of triggering on a specific pattern
of presses and releases that includes the modifier keys, keep track of which
modifiers are pressed at any given time, so that it doesn't matter which order
you press the modifiers in, or whether the modifier is held down during
multiple keycombos.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Xfce-bugs mailing list