Why doesn't Python include non-blocking keyboard input function?
Chris Angelico
rosuav at gmail.com
Tue Oct 25 17:57:37 EDT 2016
On Wed, Oct 26, 2016 at 8:24 AM, Marko Rauhamaa <marko at pacujo.net> wrote:
>
> Thankfully, you don't need to run your program from a terminal. You can
> interpret keyboard events any way you want if your program is an X11 or
> Wayland client, and forget all about TTYs, baud rates, parity bits,
> hangups etc.
That still doesn't answer the fundamental question:
Are you looking for KEYBOARD input or TEXT input?
Until you figure that out, nothing matters. Personally, I'd much
rather work with text than with actual keys; in the uncommon case
where I want a keystroke to trigger an action, I'm always working in a
GUI already, and I can create a menu item with an accelerator. A
visible one.
Just because you *can* poll the keyboard for events, don't think that
you *should*.
ChrisA
More information about the Python-list
mailing list