I use the following command in a bash script file:
xdotool type --clearmodifiers $(xclip -o -sel c)
I invoke it with a shortcut such as
The action works as expected. However, after it completes, the modifier keys remain pressed. That's the problem I need to resolve.
From the xdotool man page, the issue makes some sense:
Any command taking the --clearmodifiers flag will attempt to clear any active input modifiers during the command and restore them afterwards.
I wish they were not restored, but since they are, I need an additional command to clear those modifiers.
I tried adding these lines at the end of my script file:
xdotool keyup Control xdotool keyup Shift
That resulted in me not being able to type or even use the mouse correctly.
I'm using KDE and X11. I use the US International keyboard layout and I have the following keyboard customizations set in KDE system settings:
- both shift keys together enable caps lock and one shift key disables it
- Caps Lock as Ctrl