lackey icon indicating copy to clipboard operation
lackey copied to clipboard

type(Key.RIGHT, Key.SHIFT) does not work as expected

Open genequ opened this issue 6 years ago • 4 comments

Windows 7, Lackey 0.7.3

It does not work when sending arrow keys (LEFT/RIGHT/DOWN/UP) and Key.SHIFT when Num_Lock is ON which is expected to select a line, e.g, type(Key.RIGHT, Key.SHIFT), it just moves the cursor but does not select anything.

Sikuli seems has the same problem, but user can get the Num_Lock state via Key.isLockOn(Key.NUM_LOCK) and workaround, https://answers.launchpad.net/sikuli/+question/143874 Unfortunately, this API does not work in Lackey.

genequ avatar Dec 04 '18 05:12 genequ

In SikuliX I use this hack by accessing the Windows API directly to get the real state of the respective lock key: /* Windows lib user32 https://msdn.microsoft.com/pt-br/library/windows/desktop/dd375731 VK_NUM_LOCK 0x90 VK_SCROLL 0x91 VK_CAPITAL 0x14 int state = GetKeyState(LockKey); */ Hope it helps. RaiMan from SikuliX

RaiMan avatar Dec 04 '18 10:12 RaiMan

Thanks RaiMan! Now i use win32api.GetKeyState(0x90) to get the Num Lock state

genequ avatar Dec 06 '18 06:12 genequ

This will require some work on the keyboard library. There's an issue open for this enhancement. I'll review this for a contribution.

glitchassassin avatar May 12 '19 22:05 glitchassassin

I've submitted a pull request to the keyboard library that will let us add this feature to Lackey as well.

glitchassassin avatar May 13 '19 18:05 glitchassassin