On Windows, LSHIFT keytap is sent when using `right_shift`
Madrox opened this issue · comments
Expected Behavior
When sending a keyTap or keyToggle event with a shift modifier, the proper shift key should be sent.
Current Behavior
Currently, lshift is called. This is likely also occuring with other modifiers like ctrl, as the switch logic collapses left vs right into a general modifier.
Possible Solution
Either refactor the modifier logic to distinguish between left and right to send the appropriate key press, or eliminate the right_shift
modifier and retain shift as its inclusion is misleading.
Steps to Reproduce (for bugs)
- Install a windows key logging tool such as ShowOff: https://www.dcmembers.com/skrommel/download/showoff/
- Launch and observe the result of
keyTap("f11", ["right_shift"])
- Notice LShift is the modifier
Context
I'm simulating the keypress of a global shortcut, and to distinguish it from normal user behavior in their current app, it should be bound purely to the right shift key (which is never used in their context).
Your Environment
- RobotJS version: ^0.6.0
- Node.js version: v14.16.1
- npm version: 6.14.12
- Operating System: Windows 10
By switching logic, I mean this code here:
Line 429 in c9cbd98
At this point, it seems the intented left/right keypress modifier is lost.