FakerInput at the Disco
The Razer Wolverine is a game controller that has extra buttons you can map to things like keyboard keys. Basically, the controller shows up as both a game controller and a keyboard, and any keyboard keys mapped to the extra buttons are treated as real, physical keyboard keys.
If you’ve read the previous post on FakerInput, this might sound familiar.
Anyway, a user with said controller had been having some issues using it with AutoPTT, and as mostly a debugging measure, I was working on adding a way to show the status of all active keyboard and mouse keys into the Overview tab of AutoPTT (in AutoPTT 4.4.0, this is a feature you can enable from the General settings).
With the initial implementation done, I decided to see what the output would be like when using AutoPTT with FakerInput and Sidekick. So I switched the Input Method to FakerInput and pressed my PTT key.
And then the app crashed – but not before setting F11 and F12 down on the FakerInput keyboard.
And unlike the last time I managed to get some keys stuck like this, the keys did not get released once the app exited. So basically whatever was the active window on my desktop was now bouncing in and out of fullscreen state.
Let’s just say it’s a good thing I don’t have epilepsy.
I did have a slight problem though. Again.
Fortunately, F11 did nothing when the ALT-TAB menu was open and I managed to switch to an open instance of Notepad (the ancient version, not the AI-infested one), which also ignored F11. I used it to write a one-line AutoHotkey script with the following content:
*F11::return
I saved the script and ran it, which meant that AutoHotkey was now blocking all F11 key events, getting rid of the fullscreen disco.
The F11 and F12 keys were still technically stuck though, so I decided to do what I should have done much earlier: write a program that would, when run, release all keys from FakerInput. A sort of “panic button,” if you will.
After building and running the program, the F11 and F12 keys were finally released from the FakerInput keyboard, and I could close the AutoHotkey script.
Here is the program, in case anyone else ever runs into a similar problem!
It often helps if you take a moment to think about what you’re about to do before you do it. Even experienced devs sometimes forget that.
Some more than others :)
AutoPTT