You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This makes it look like certain keys are stuck and are always pressed.
This is especially bad if I want to respond to a key-combination like Alt+F1.
I can likely create a small repro case if this is not a known issue and is doubted, just let me know.
I also realized just now that maybe I can also create some kind of an abstraction to hide this issue, because genuine stuck/pressed keys repeatedly fire new key.pressed events, so if for about a second I don't get any of those, I can safely assume that its due to this bug and the key is in fact not pressed.
This can work, though of course it would be preferable that this is fixed somewhere upstream because this would introduce a noticeable lag on occasion when responding to a user releasing a key.
Somewhat off-topic, but I am also baffled by the lack of available and reliable global keyboard hooks for node.js. For a while I was using iohook, until I realised that it doesn't at all work when two apps require it at once. It makes Windows OS freeze. That's a pretty big deal-breaker.
Now, gkm, this package, seems to work much better, but like I say above, it's not fully reliable. And it also seems to not be actively maintained? And yeah, maybe I can smooth out these rough edges and live with this, but I am perplexed as to what people actually use if/when they want to respond in Node to a global keyboard shortcut. Do people just never want to do that? Do they use something I am not aware of?
The text was updated successfully, but these errors were encountered:
And noticed a weird behavior: When I keep pressing alt, the alt event repeatedly fires; but when I then also start long pressing control, the repeated alt firing stops and repeated ctrl firing takes its place, even though alt is still pressed. This can be a problem if the user hesitates for a long time while pressing stuff.
As in, the above code works around the initial issue, but fails in the edge-case when the user is slower than 1s in a long key combination.
Though I might have an idea on how to overcome this issue too by treating repeated firings as a key group being pressed. Though that might also run a different risk of consecutive long-held combinations appearing as if being held together.
However, I also noticed a much more worrying problem: If multiple events coincide, some of them seem to be fully dropped! Even key.pressed events! In my logs I see stuff like:
pressed alt
released alt
released control
Note how according to gkm, control was never pressed, it's just released out of nowhere.
This makes it look like certain keys are stuck and are always pressed.
This is especially bad if I want to respond to a key-combination like Alt+F1.
I can likely create a small repro case if this is not a known issue and is doubted, just let me know.
I also realized just now that maybe I can also create some kind of an abstraction to hide this issue, because genuine stuck/pressed keys repeatedly fire new key.pressed events, so if for about a second I don't get any of those, I can safely assume that its due to this bug and the key is in fact not pressed.
This can work, though of course it would be preferable that this is fixed somewhere upstream because this would introduce a noticeable lag on occasion when responding to a user releasing a key.
Somewhat off-topic, but I am also baffled by the lack of available and reliable global keyboard hooks for node.js. For a while I was using
iohook
, until I realised that it doesn't at all work when two apps require it at once. It makes Windows OS freeze. That's a pretty big deal-breaker.Now, gkm, this package, seems to work much better, but like I say above, it's not fully reliable. And it also seems to not be actively maintained? And yeah, maybe I can smooth out these rough edges and live with this, but I am perplexed as to what people actually use if/when they want to respond in Node to a global keyboard shortcut. Do people just never want to do that? Do they use something I am not aware of?
The text was updated successfully, but these errors were encountered: