Closed Valachio closed 3 years ago
Hi, @Valachio
Just tried here on PopOS and robot.keyToggle('shift', 'down')
holds the shift smoothly.
For MacOS there is this old thread https://github.com/octalmage/robotjs/issues/208
suggesting the use of Robot.keyToggle(String.fromCharCode(16), 'down', 'shift')
Can you try that out?
I am trying to perform a shift-click. In other words, do a left mouse click whilst holding down the shift key, by using
keyToggle()
. I've tried several variations of the code but could not get it to work.I first tried to do the following:
It did not work, so I tried to use shift as a modifier key:
It also did not work. Then I tried to set the keyboard delay:
It also did not work. Then I tried to see if simply holding down a key works. I tried several keys:
All of them do not hold down the key. The current behavior is simply a single tap, so
keyToggle()
effectively works the same askeyTap()
in my tests right now.I'm not sure if I'm doing something wrong or there's some unexpected behavior in Mac. I researched several older posts on problems with holding down a key, such as this one and this one but trying some of the solutions in these posts, I still cannot use
keyToggle()
to perform a key hold.My Environment: