Closed i-c-u-p closed 2 years ago
Can you post the output of KEYD_DEBUG=1 keyd-application-mapper
using the latest commit?
Can you post the output of
KEYD_DEBUG=1 keyd-application-mapper
using the latest commit?
$ keyd -v
keyd v2.3.1-rc (8f0727c)
$ KEYD_DEBUG=1 keyd-application-mapper
X detected
Active window: alacritty|keyd-debug-1-keyd-application-mapper
Matched alacritty|*
DEBUG: src/keyd.c:454: Debug mode activated
Active window: lorien|lorien-v0-4-0
Matched lorien|*
DEBUG: src/keyd.c:454: Debug mode activated
Active window: mousepad|untitled-6-mousepad
DEBUG: src/keyd.c:454: Debug mode activated
Active window: mousepad|config-keyd-app-conf-mousepad
DEBUG: src/keyd.c:454: Debug mode activated
Active window: alacritty|keyd-debug-1-keyd-application-mapper
Matched alacritty|*
DEBUG: src/keyd.c:454: Debug mode activated
Active window: lorien|lorien-v0-4-0
Matched lorien|*
DEBUG: src/keyd.c:454: Debug mode activated
Active window: mousepad|config-keyd-app-conf-mousepad
DEBUG: src/keyd.c:454: Debug mode activated
Active window: lorien|lorien-v0-4-0
Matched lorien|*
DEBUG: src/keyd.c:454: Debug mode activated
Active window: alacritty|keyd-debug-1-keyd-application-mapper
Matched alacritty|*
DEBUG: src/keyd.c:454: Debug mode activated
It looks like the rule is being matched correctly. What is the output of keyd -m
after pressing capslock+shift+b
while lorien is focused?
It looks like the rule is being matched correctly. What is the output of
keyd -m
after pressingcapslock+shift+b
while lorien is focused?
output of capslock+s+b:
$ sudo keyd -m
device added: 0fac:0ade (keyd virtual device)
device added: <redacted keyboard id> (<redacted keyboard name> Keyboard)
device added: <redacted mouse id> (<redacted mouse name>)
keyd virtual device 0fac:0ade enter up
<redacted mouse name> <redacted mouse id> leftmouse down
<redacted mouse name> <redacted mouse id> leftmouse up
keyd virtual device 0fac:0ade leftcontrol down
keyd virtual device 0fac:0ade leftshift down
keyd virtual device 0fac:0ade leftshift up
keyd virtual device 0fac:0ade y down
keyd virtual device 0fac:0ade y up
keyd virtual device 0fac:0ade leftshift down
keyd virtual device 0fac:0ade leftshift up
keyd virtual device 0fac:0ade leftcontrol up
output of capslock+leftshift+b:
$ sudo keyd -m
device added: 0fac:0ade (keyd virtual device)
device added: <redacted keyboard id> (<redacted keyboard name> Keyboard)
device added: <redacted mouse id> (<redacted mouse name>)
keyd virtual device 0fac:0ade enter up
<redacted mouse name> <redacted mouse id> leftmouse down
<redacted mouse name> <redacted mouse id> leftmouse up
keyd virtual device 0fac:0ade leftcontrol down
keyd virtual device 0fac:0ade leftshift down
keyd virtual device 0fac:0ade leftshift up
keyd virtual device 0fac:0ade y down
keyd virtual device 0fac:0ade y up
keyd virtual device 0fac:0ade leftshift down
keyd virtual device 0fac:0ade leftshift up
keyd virtual device 0fac:0ade leftcontrol up
While pressing the capslock+leftshift+b bind repeatedly during testing, the C-y binding actually did occasionally activate in Lorien, but it happens randomly and I can't reliably reproduce it other than mashing capslock+leftshift+b until it does.
It looks like keyd is emitting the correct keycodes. My suspicion is that lorien doesn't like the additional leftshift
events. Try a simpler binding like - = C-y
and see if it works consistently.
It looks like keyd is emitting the correct keycodes. My suspicion is that lorien doesn't like the additional
leftshift
events. Try a simpler binding like- = C-y
and see if it works consistently.
Changing the binding and hitting - results in the same problem. Here's the output log (along with C-y which does work):
app.conf (Lorien section):
[lorien]
- = C-y
output of pressing - on keyboard:
$ keyd -v
keyd v2.3.1-rc (9325bf3)
$ sudo keyd -m
device added: 0fac:0ade (keyd virtual device)
device added: <keyboard id> (<keyboard name> Keyboard)
device added: <mouse id> (<mouse name>)
keyd virtual device 0fac:0ade enter up
<mouse name> <mouse id> leftmouse down
<mouse name> <mouse id> leftmouse up
keyd virtual device 0fac:0ade leftcontrol down
keyd virtual device 0fac:0ade y down
keyd virtual device 0fac:0ade y up
keyd virtual device 0fac:0ade leftcontrol up
output of pressing C-y on keyboard:
$ sudo keyd -m
device added: 0fac:0ade (keyd virtual device)
device added: <keyboard id> (<keyboard name> Keyboard)
device added: <mouse id> (<mouse name>)
keyd virtual device 0fac:0ade enter up
<mouse name> <mouse id> leftmouse down
<mouse name> <mouse id> leftmouse up
keyd virtual device 0fac:0ade leftcontrol down
keyd virtual device 0fac:0ade y down
keyd virtual device 0fac:0ade y up
keyd virtual device 0fac:0ade leftcontrol up
Can you try this using the test branch? (e.g git fetch origin; git checkout origin/test; make && sudo make install
)
Can you try this using the test branch? (e.g
git fetch origin; git checkout origin/test; make && sudo make install
)
Still doesn't work. Output log:
$ keyd -v
keyd v2.3.1-rc (84b58e8)
$ sudo keyd -m
device added: 0fac:0ade (keyd virtual device)
device added: <keyboard id> (<keyboard name> Keyboard)
device added: <mouse id> (<mouse name>)
keyd virtual device 0fac:0ade enter up
<mouse name> <mouse id> leftmouse down
<mouse name> <mouse id> leftmouse up
keyd virtual device 0fac:0ade leftcontrol down
keyd virtual device 0fac:0ade y down
keyd virtual device 0fac:0ade y up
keyd virtual device 0fac:0ade leftcontrol up
Can you try the tip of test again? I believe this should do the trick.
Can you try the tip of test again? I believe this should do the trick.
That fixed it. Output log:
Pressing -:
$ keyd -v
keyd v2.3.1-rc (6c4c6ac)
$ sudo keyd -m
device added: 0fac:0ade (keyd virtual device)
device added: <keyboard id> (<keyboard name> Keyboard)
device added: <mouse id> (<mouse name>)
keyd virtual device 0fac:0ade enter up
<mouse name> <mouse id> leftmouse down
<mouse name> <mouse id> leftmouse up
keyd virtual device 0fac:0ade leftcontrol down
keyd virtual device 0fac:0ade y down
keyd virtual device 0fac:0ade y up
keyd virtual device 0fac:0ade leftcontrol up
Pressing capslock+d+b (after changing [lorien]
section of app.conf back to extend+shift.b = C-y
):
$ sudo keyd -m
device added: 0fac:0ade (keyd virtual device)
device added: <keyboard id> (<keyboard name> Keyboard)
device added: <mouse id> (<mouse name>)
keyd virtual device 0fac:0ade enter up
<mouse name> <mouse id> leftmouse down
<mouse name> <mouse id> leftmouse up
keyd virtual device 0fac:0ade leftcontrol down
keyd virtual device 0fac:0ade leftshift down
keyd virtual device 0fac:0ade leftshift up
keyd virtual device 0fac:0ade y down
keyd virtual device 0fac:0ade y up
keyd virtual device 0fac:0ade leftshift down
keyd virtual device 0fac:0ade leftshift up
keyd virtual device 0fac:0ade leftcontrol up
Thanks. As I suspected, it appears to be a bug in Lorien's (or possibly Godot's) input logic, which requires a pause after the initial key down. I will have to think about how best to allow users to account for this in a generic way.
I believe this should work out of the box in the latest commit.
The Lorien bindings work in the latest commit, but they still have a problem that I unfortunately forgot to mention earlier, which is that they don't repeat when held.
In this demonstration video in Mousepad, you can see that when capslock+b is held, it outputs C-z with the delay and rate set in x (I actually set it in xfce4-keyboard-settings
, but it's reflected in xset q
(output below)) and when holding and releasing d ontop of capslock+b it switches between C-z and C-s-z with no delay, which appears up as the text appearing and disappearing in a sweeping motion in the video. But in Lorien when capslock+b or capslock+d+b are held, C-z and C-s-z don't repeat and so b has to be released and pressed repeatedly to input it multiple times. This happens in keyd versions a5e6a83 and 6c4c6ac. My configs have changed so I'll also include those again.
Does this work without keyd? I would assume Lorien just doesn't implement key repeat.
Does this work without keyd? I would assume Lorien just doesn't implement key repeat.
Yes; I guess it's just an issue with Lorien then. I probably should have checked that before making a long-winded comment about it... I'll close the issue now since this is fixed.
I've enhanced macros to allow for timeouts to be specified between individual keys. This should allow you to make use of keyd's built in macro repeat functionality to achieve what you want.
Try mapping to something like macro(leftcontrol+b+1ms)
. You may have to increase the timeout from 1ms
, depending on how long of a gap lorien expects.
I've enhanced macros to allow for timeouts to be specified between individual keys. This should allow you to make use of keyd's built in macro repeat functionality to achieve what you want.
Try mapping to something like
macro(leftcontrol+b+1ms)
. You may have to increase the timeout from1ms
, depending on how long of a gap lorien expects.
A delay around 12ms seems to be the fastest for Lorien macros. As it's set lower than that, Lorien starts missing progressively more inputs, which makes it slower. Although alternating between repeating C-z and C-y can't be done instantly (such as the "sweeping" effect I showed in the vid a few comments back) by holding and releasing d while capslock+b is held and instead requires releasing and holding some keys:
While holding capslock+b: release b hold d hold b *C-y starts being output*
While holding capslock+d+b: release b release d hold b *C-z starts being output*
But the ability to alternate between spamming undos and redos without delay isn't very practically useful, so this isn't much of a problem.
As a side issue, I added macro_timeout = 250
and macro_repeat_timeout = 20
to my default.conf to try matching what appears in xset q
, and I think the repeat timeout isn't actually reached. According to xset q
my auto repeat delay is 250 and repeat rate is 50. I held down the a key for 4 seconds (approximately; I eyeballed it using my clock in xfce) twice and on average there were 185 a's. Then I did the same holding capslock+a after adding CapsLayer.a = macro(a)
to a new [mousepad]
section in app.conf, and it averaged to 133.5 a's. This means the delay is only ~72.16% as fast as expected. I did the same test holding capslock+s with CapsLayer.s = macro2(250, 20, a)
under [mousepad]
and that only produced 123 a's, ~66.49% of the expected amount.
As for the repeat delay set in macro_timeout
and macro2(), I couldn't tell any difference by eye so a more rigorous method would be needed to check those.
Although alternating between repeating C-z and C-y can't be done instantly (such as the "sweeping" effect I showed in the vid a few comments back) by holding and releasing d while capslock+b is held and instead requires releasing and holding some keys...
From what I can see from your config, what you have described is expected behaviour, though it i possible I have not understood something. If you think there is a bug in the macro logic, I would appreciate it if you could create a dedicated issue and provide the minimal steps to reproduce it.
As a side issue, I added macro_timeout = 250 and macro_repeat_timeout = 20 to my default.conf to try matching what appears in xset q, and I think the repeat timeout isn't actually reached. A
Please read the manpage carefully. The keyd options mean different things and are measured in different units.
Edit: Apologies, it appears I read your comment in haste. It seems you have correctly converted the xset value into miliseconds. There is indeed a resolution issue, I will investigate further.
Edit 2: The timeout issue has been fixed.
I am treating this issue as closed for now since the original problem has been resolved.
Edit 2: The timeout issue has been fixed.
Tested and it's indeed fixed for macro() and macro2() after updating to 49f863c.
Application bindings set for Lorien in
~/.config/app.conf
don't work when keyd-application-mapper is running, even though the window is detected. Lorien was installed from the AUR package lorien-bin. When a Lorien window is in focus, it shows up in keyd-application-mapper's logs asActive window: lorien|lorien-v0-4-0
.Here's my configs:
~/.config/keyd/app.conf:
/etc/keyd/default.conf:
``` [ids] * # Colemak-DH (Curl+Angle mods) [main] esc = overload(switch, capslock) capslock = overload(extend, esc) rightmeta = compose rightcontrol = rightcontrol rightshift = rightshift e = f r = p t = b y = j u = l i = u o = y p = ; s = r d = s f = t h = m j = n k = e l = i ; = o z = x x = c c = d b = z n = k m = h [qwerty] esc = overload(switch, capslock) capslock = overload(extend, esc) rightmeta = compose rightcontrol = rightcontrol rightshift = rightshift e = e r = r t = t y = y u = u i = i o = o p = p s = s d = d f = f h = h j = j k = k l = l ; = ; z = z x = x c = c b = b n = n m = m [noCapsLayer] capslock = esc [extend:C] j = left k = down l = up ; = right 1 = f1 2 = f2 3 = f3 4 = f4 5 = f5 6 = f6 7 = f7 8 = f8 9 = f9 0 = f10 - = f11 = = f12 m = home / = end i = pagedown o = pageup f = backspace r = delete s = layer(alt) d = layer(shift) space = layer(control) g = enter [extend+control] s = layer(alt) d = layer(shift) [extend+shift] space = layer(control) s = layer(alt) [extend+alt] d = layer(shift) space = layer(control) [extend+control+shift] s = layer(alt) [extend+control+alt] d = layer(shift) [extend+shift+alt] space = layer(control) [extend+control+shift+alt] [switch] q = toggle(qwerty) w = toggle(noCapsLayer) ```