chaosparrot / talon_hud

Unofficial Talon Head Up Display scripts
68 stars 29 forks source link

Option to add a widget that shows held down modifier keys #24

Closed HermanPerkins closed 2 years ago

HermanPerkins commented 2 years ago

The Problem

Myself and a couple of others have run into a bug where a modifier key such as cmd or ctrl gets held down, and you have to reset talon. This could also be an issue from a keyboard standpoint.

Solution

If we could have a "show active modifiers" command that would be super useful for these cases! Could be added to the widget with the mic, or be separate.

chaosparrot commented 2 years ago

I am not sure if I am able to check whether or not the modifier keys are held down. I can look into that but I know that talon doesn't specifically remember whether or not it has a key held down or not.

The easiest way to get rid of that held down issue is by simply pressing the modifier keys like ctrl, shift, alt and cmd as that clears the modifiers. In that case you do not need to restart talon.

You could also add a voice command that will do that for you, like this one:

os: mac
-
modifiers reset all: 
    key("ctrl:up")
    key("shift:up")
    key("alt:up")
    key("cmd:up")

I'll keep this issue open in case I find a way to check what modifiers are set, but I can't promise anything of the sort without doing something very hacky like sending a key stroke every N milliseconds, which will definitely do unexpected things down the line.

chaosparrot commented 2 years ago

Unfortunately, I cannot check for held down keys without having to keep track of every keystroke. That would slow down Talon typing so it's best to have a voice command like the one above somewhere if this problem persists.