How from "Window.bind(on_key_down" get ! ? or another chars

10 views
Skip to first unread message

Radosław Głębicki

unread,
Jan 25, 2026, 4:48:30 PM (5 days ago) Jan 25
to Kivy users support
Hi.
How I can get exactly character what I have on keyboard when I pressed shift+1 or another combination. Now I get:
(<kivy.core.window.window_sdl2.WindowSDL object at 0x7f3db38fc040>, 49, 30, '1', ['shift'])
There is no information (ASCII table) about "!"

With regards
Radek Glebicki

elli...@cox.net

unread,
Jan 25, 2026, 8:10:59 PM (5 days ago) Jan 25
to kivy-...@googlegroups.com

What are you trying to do?  The keyboard provides the information on the key.  If you want the resulting text, I recommend using the TextInput widget.  

Kivy Keyboard Input: Key Events vs Text Input

Quick clarification on keyboard handling in Kivy:

Use key events (on_key_down) for:

  • Keyboard shortcuts (Ctrl+C, Ctrl+Z)

  • Game controls (WASD, arrows)

  • Physical key/location-based logic

Use TextInput for:

  • Typing into text fields

  • Proper keyboard layout handling (QWERTY, AZERTY, IME)

  • Unicode characters

  • Dead keys and compose sequences

In short: key events are for keys, text input is for characters.




From: kivy-...@googlegroups.com <kivy-...@googlegroups.com> on behalf of Radosław Głębicki <glebicki...@gmail.com>
Sent: Sunday, January 25, 2026 2:48 PM
To: Kivy users support <kivy-...@googlegroups.com>
Subject: [kivy-users] How from "Window.bind(on_key_down" get ! ? or another chars
 
--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/kivy-users/02b96a92-5235-4bce-90ea-3496c988576an%40googlegroups.com.

Radosław Głębicki

unread,
Jan 25, 2026, 10:14:05 PM (5 days ago) Jan 25
to Kivy users support
I did, but how it works if I want to use shortcut for Button as ex.: alt + !. And then on another keyboard key "!" is on diff. key so this shortcut doesn't work proper way?

Radek Glebicki

elli...@cox.net

unread,
Jan 25, 2026, 11:36:15 PM (5 days ago) Jan 25
to kivy-...@googlegroups.com
If you can map your hotkeys to the unmodified key, then things will work reliably.  
For example on a US keyboard rather that say alt + !,  use alt+shift+1

Keyboard mappings are not standardized.  SDL is handing it for kivy.  

Sent: Sunday, January 25, 2026 8:14 PM

To: Kivy users support <kivy-...@googlegroups.com>
Subject: Re: [kivy-users] How from "Window.bind(on_key_down" get ! ? or another chars
 
Reply all
Reply to author
Forward
0 new messages