Skip to content

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 glitchassassin requested a review from boppreh May 13, 2019 18:22
@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.

1 participant