mattydebie/bitwarden-rofi

Race condition between xdotool and user's finger when autotyping

CarloDePieri opened this issue · 1 comments

Hi! Let me start by thanking you for the script! Now, this is a strange one...

I was facing an odd behavior when pressing alt+1/2/3 for autotyping: sometimes, half the characters were garbage; sometimes, apparently random keys got pressed (like esc, enter, etc).
It took me a while to understand what was happening: when xdotool begin to input characters, the user thumb may still be resting on the alt key, resulting in strange inputs.

Now, I'm guessing that this sleep

sleep 0.3

is meant to allow the transition to the window under rofi, but it could be tweaked to account for (apparently) slooooow users like myself... maybe give an option to add n ms to that delay? Or maybe simply having this issue to document this will be enough.

adding --clearmodifiers to the xdotool command arguments fixes the problem of the Alt key still being pressed when xdotool starts typing.