nimaid / LPHK

A Novation Launchpad Macro Scripting System.
GNU General Public License v3.0
344 stars 69 forks source link

Shift key automatic keyup when another key is tapped #63

Closed kartikay-bagla closed 4 years ago

kartikay-bagla commented 4 years ago

Script:

PRESS win
PRESS shift
TAP right
RELEASE shift
RELEASE win

Expected behavior from JS Key tracker (https://unixpapa.com/js/testkey.html):

keydown  keyCode=91  ([)   which=91  ([)   charCode=0        
keydown  keyCode=16        which=16        charCode=0        
keyup    keyCode=39  (')   which=39  (')   charCode=0        
keyup    keyCode=16        which=16        charCode=0        
keyup    keyCode=91  ([)   which=91  ([)   charCode=0        

91 is win, 16 is shift and 39 is right arrow

Actual behavior:

keydown  keyCode=91  ([)   which=91  ([)   charCode=0        
keydown  keyCode=16        which=16        charCode=0        
keyup    keyCode=16        which=16        charCode=0        
keyup    keyCode=39  (')   which=39  (')   charCode=0        
keydown  keyCode=16        which=16        charCode=0        
keyup    keyCode=16        which=16        charCode=0        
keyup    keyCode=91  ([)   which=91  ([)   charCode=0  

Notice the 2 extra lines at line 3 and 5. I've tried variants of PRESS, TAP, ASYNC to no avail.

Edit: I'm using the Launchpad Pro (but other shortcuts seem to work fine, for example this script works fine:

PRESS ctrl
PRESS shift
TAP n
RELEASE shift
RELEASE ctrl

DELAY 0.5

PRESS ctrl
TAP k
TAP o
RELEASE ctrl
duncte123 commented 4 years ago

try this script

PRESS win
PRESS shift
PRESS right
WAIT_UNPRESSED
RELEASE_ALL
kartikay-bagla commented 4 years ago

Getting this, which still isn't what I want.

keydown  keyCode=91  ([)   which=91  ([)   charCode=0        
keydown  keyCode=16        which=16        charCode=0        
keyup    keyCode=16        which=16        charCode=0        
keydown  keyCode=16        which=16        charCode=0        
keyup    keyCode=16        which=16        charCode=0        
keyup    keyCode=91  ([)   which=91  ([)   charCode=0        
keyup    keyCode=39  (')   which=39  (')   charCode=0        
duncte123 commented 4 years ago

Did you try a different keyboard tester (such as noh board which is a native application)

kartikay-bagla commented 4 years ago

So this shortcut is supposed to move a window from one screen to another, Win + Shift + Right, but since we get a keyup from shift, the Win + Right shortcut is executed instead of the actual. So it's not a keyboard tester issue. But I'll test it with Noh board as well and get back to you.

duncte123 commented 4 years ago

I think that your best bet is to combine LPHK with AHK to get the effect you want in this case

kartikay-bagla commented 4 years ago

I moved on to do this only. Thanks!