Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AutoHotKey and long press #557

Closed
elfi-ox opened this issue Aug 3, 2024 · 3 comments
Closed

AutoHotKey and long press #557

elfi-ox opened this issue Aug 3, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@elfi-ox
Copy link
Contributor

elfi-ox commented Aug 3, 2024

Short Summary

I wanted to bind kando to a button on my mouse but I found that it's impossible in my case. The things is that going through the menu works great if you don't release the key that active it but the way my buttons are force me to just click the button but then i have to click on the icon to do anything. The way I tried to fix this was to use AutoHotKey to flip the state of a key when clicking it.

Here is the issues, it doesn't work on Kando, the key Is indeed long-pressed by AutoHotkey but for Kando it's like a simple click

Steps to Reproduce the Issue

To demonstrate the problem I made a video. Here I binded Kando to F and then I binded the G key to alternate between F up and F down. You can see on the video that F is indeed pressed for a long time then released. However kando doesn't recognize it and treat it like a simple press
https://youtu.be/uh4lszm2_dk?si=jg9bOJMnnGMeiq11

Kando Version

v1.2.0

Installation Method

Via an installer downloaded from a release on GitHub

Desktop Environment

Windows

Environment Version

Windows 11

Additional Information

No response

@elfi-ox elfi-ox added the bug Something isn't working label Aug 3, 2024
@Schneegans
Copy link
Contributor

Well, that's a specific issue 😅

In order to know whether a specific key is held down, Kando relies on key-repeat events. You know, if you type a letter and then keep the key pressed, after a short delay this letter is repeated quickly. I would assume that AHK does not produce these while you toggle the key?

This is so because there is no high-level API to query the state of individual keys on the keyboard. This only works for modifier keys such as Ctrl, Shift, or Alt.

So here is a potential workaround: Can you bind Kando to a shortcut like Ctrl+F instead and make your keys simulate this?

@elfi-ox
Copy link
Contributor Author

elfi-ox commented Aug 3, 2024

Oh very interesting ! So based on what you said I tried spamming the key but it didn't work and I suppose it's because key-repeat event can't be reproduced with this primitive technique.

I tried to use AutoHotKey with Ctrl and it did work but I was unable to make AutoHotKey send the ctrl down so I gave up lol.

What I found in the meanwhile was that the behavior I wanted could be replicated by calling kando via command line instead of a hotkey.
Here is a script that work with ctrl+space and a kando menu called "Quick Access", for potential futur users with the same problem as me

^Space:: ; Bind Ctrl+Space
Run, C:\Users[windows userr]\AppData\Local\kando\kando.exe kando --menu "Quick Access",, Hide
return

In any case, thank you for your responsiveness and well done for this project, Kando works very well !

Also since i'm in an open Issue report, i'd like to point out something that could be useful. the settings GUI can become unusable at some scale. For exemple my 2560x1440 labtop with a windows scale at 175% can't fully display the Shortcut editor
example
And it become invisible on my FHD graphic tablet at a 150% scale
example
Changing the scale solve it but it might be worth fixing it

@Schneegans
Copy link
Contributor

Yeah, I guess that this will be fixed alongside #468. Until then, you can also scale Kando with Ctrl+Shift+Plus, Ctrl+Minus, and Ctrl+0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants