EsotericSoftware / clippy

Multifunctional Windows productivity tool for programmers and other power users
BSD 3-Clause "New" or "Revised" License
127 stars 16 forks source link

F13-F24 as hotkeys #27

Closed Gazareth closed 4 years ago

Gazareth commented 4 years ago

I'm trying to assign F16 or F17 as the tobiiClickHotkey, but it doesn't seem to respond. Any ideas why this might be?

NathanSweet commented 4 years ago

Does it work on other keys? Does the log show anything?

Gazareth commented 4 years ago

Yeah it works with F9, that's what I've been using up until now.

If I set it to F12, clippy won't run, the log says it failed to register the hotkey.

If I set it to F13 or above, clippy will run but the hotkey does nothing.

NathanSweet commented 4 years ago

I have only up to F12, so I'm afraid I can't test. I tried a fix and did a new release, 2.41. Maybe give that a try, otherwise I don't think there's much else I can do.

NathanSweet commented 4 years ago

As for F12, Microsoft says it's not possible: https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-registerhotkey

The F12 key is reserved for use by the debugger at all times, so it should not be registered as a hot key. Even when you are not debugging an application, F12 is reserved in case a kernel-mode debugger or a just-in-time debugger is resident.

F12 could be done with a low level hook, but it's probably not worth it.

Gazareth commented 4 years ago

Well, thanks for that! It worked, sort of. 😫

It seems those inputs are handled differently, because the function is triggered repeatedly, rather than one continuous execution, if that makes sense?

I use a footpedal which I want to assign F17 to, as it doesn't clash with any keys in VS Code. You can also simulate inputs with Autohotkey.

With a short script you can simulate F17 being pushed down and then released after 5 seconds:

send {F17 down}  
sleep, 5000  
send {F17 up}  
Return

If I change it to F9, and set Clippy to use F9, it works fine. But with F17, it's as though the key is immediately released.

NathanSweet commented 4 years ago

Should be good in 2.42!

Gazareth commented 4 years ago

Wow, amazing turnaround time!

Yep, works great 👍

Thank you!

NathanSweet commented 4 years ago

Cheers!