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

Caps Lock not detected #6285

Closed
Inspirateur opened this issue May 2, 2019 · 2 comments · Fixed by #6286
Closed

Caps Lock not detected #6285

Inspirateur opened this issue May 2, 2019 · 2 comments · Fixed by #6286
Labels
Status: Has PR There's a PR available for the issue

Comments

@Inspirateur
Copy link

Versions

  • Python: 3.7
  • OS: Windows 10
  • Kivy: 1.10.1
  • Kivy installation method: pip

Description

I'm trying to add a little warning message on my passworld field when Caps Lock is on, but I can't seem to get this info from kivy.

Code and Logs

I just tried to print keycode, text and modifiers

class TextInputCapsWarn(TextInput):
	def keyboard_on_key_down(self, window, keycode, text, modifiers):
		print(keycode, text, modifiers)

And this is what I get when typing a, z d, Caps Lock ON, a, a, z :

(97, 'a') a []
(122, 'z') z []
(100, 'd') d []
(301, 'capslock') ĭ []
(97, 'a') a []
(97, 'a') a []
(122, 'z') z []

So basically the modifiers list remain empty even with caps locks ON, and while I do detect the caps lock press I can't tell if it's ON or OFF.

This is a really minor issue but I thought documenting on it wouldn't hurt.
Thanks for your time.

@matham
Copy link
Member

matham commented May 3, 2019

Here's a fix #6286.

P.S. take a look at the keyboard_on_textinput method. That provides the properly capitalized text.

@Inspirateur
Copy link
Author

Thanks for the effort :D
The keyboard_on_textinput doesn't solve my issue on its own because I can't tell if the text has been capitalized with SHIFT (which would be intentionnal) or Caps Lock (which could be unintentionnal), that being said I'll keep an eye on your PR and I hope it gets accepted !

@matham matham added the Status: Has PR There's a PR available for the issue label May 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Has PR There's a PR available for the issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants