mattydebie / bitwarden-rofi

Wrapper for Bitwarden https://github.com/bitwarden/cli and Rofi
GNU General Public License v3.0
346 stars 56 forks source link

Race condition between xdotool and user's finger when autotyping #62

Open CarloDePieri opened 3 years ago

CarloDePieri commented 3 years ago

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 https://github.com/mattydebie/bitwarden-rofi/blob/a53cc1e21097c201a56b560b8f634a032330d61b/bwmenu#L222 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.

wwalker commented 2 years ago

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