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

Check caps/num/scroll lock state #263

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

glitchassassin
Copy link
Collaborator

Adds lock_state() call for each platform, as well as a module-level call to the API.

"option" and "alt" were both throwing errors in OSX. This change fixes it so either works.
Also made errors more descriptive
@glitchassassin
Copy link
Collaborator Author

I have tested on Windows, Linux, and Mac with the Caps Lock part. Scroll Lock and Num Lock should work the same way with their respective flags, but my main computer is a Mac so I haven't been able to confirm for certain.

To test, just run:

python3 -c "import keyboard; print(keyboard.lock_state('scroll'))"
python3 -c "import keyboard; print(keyboard.lock_state('num'))"
python3 -c "import keyboard; print(keyboard.lock_state('caps'))"

and verify that the output matches the keyboard state.

@glitchassassin glitchassassin marked this pull request as ready for review May 13, 2019 18:21
@glitchassassin
Copy link
Collaborator Author

@boppreh If you had a different function signature in mind for this feature, let me know and I'll update accordingly.

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

Successfully merging this pull request may close these issues.

None yet

1 participant