a StackOverflow question of someone that encountered a similar ghost shift being pressed when simulating a left shift directly with WinAPI
Possibly the line of code in _winkeyboard.py causing this ghost shift press to break the simulated hotkey: link
Edit # 2:
Tried adding kb.block_key(554), but it didn't make a difference.
FYI: sending shift+home with the pynput package works just fine, and with that package the weird 554 scan code doesn't appear in the logs of python -m keyboard:
with keyboardController.pressed(Key.shift):
keyboardController.tap(Key.home)
I tried to select the current text with a hotkey.
The following code:
results in these events: (recorded with
python -m keyboard
in the background)If I send
shift
,shift+s
orhome
it works fine.Weird, isn't it?
Edit: I did some digging and found these:
left shift
directly with WinAPI_winkeyboard.py
causing this ghost shift press to break the simulated hotkey: linkEdit # 2: Tried adding
kb.block_key(554)
, but it didn't make a difference.FYI: sending
shift+home
with thepynput
package works just fine, and with that package the weird 554 scan code doesn't appear in the logs ofpython -m keyboard
: