Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
genequ opened this issue Dec 4, 2018 · 4 comments
Open

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

genequ opened this issue Dec 4, 2018 · 4 comments

Comments

@genequ
Copy link

genequ commented Dec 4, 2018

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.

@RaiMan
Copy link

RaiMan commented Dec 4, 2018

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

@genequ
Copy link
Author

genequ commented Dec 6, 2018

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

@glitchassassin
Copy link
Owner

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
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants