sphinx-doc / alabaster

Lightweight, configurable Sphinx theme
http://alabaster.readthedocs.io/
Other
734 stars 186 forks source link

Alt Gr recognized as a character #180

Open bigi111 opened 3 years ago

bigi111 commented 3 years ago

In a function on_press(key), if the pressed key is the "Alt Gr" key, then : type(key) == keyboard._xorg.KeyCode instead of type(key) == keyboard.Key Thus testing : if (key == keyboard.Key.alt_gr): print("Alt_Gr pressed") # doesn't work. A work around is testing : if (str(key) == "<65027>"): print("Alt_Gr pressed") This works for me, but is not natural All other keys I tested where OK.

Thank you a lot for this useful work.

P.S. It would be nice to be able to test the state of the Shift, Ctrl, Alt, Super, Alt Gr keys, at any moment, without having to wait for an event. It would be useful for me in the management of the buttons of a graphic tablet.