KEYDOWN and KEYUP events using Pygame without a window - Raspberry Pi Forums


i'm trying make program control printer made.
want able manually control using arrow keys, can't figure out how detect keypresses.
want use strictly console based controlling method.
want use pygame detect keystrokes, don't want have blank window sitting there detecting keypresses.

objective: able detect keydown , keyup events in console using pygame.

ideas anyone?
in advance!

terminal input based on ascii codes. when press key code sent. non-ascii key such f1 or €, several bytes used; ascii escape sequence or utf-8 sequence of high bytes. may need pay attention timing distinguish arrow 3 separate keys esc [ a. when key released, nothing sent on terminal. impossible detect keys being held or released on ssh, instance.

detect key presses and releases must either connect x window system pygame, or use kernel's evdev mechanism. former method works remotely on vnc or rdp, whereas latter reads local usb-attached input devices, , may require privilege. x allows user choose application should receive keystrokes, giving focus particular window.


raspberrypi



Comments

Popular posts from this blog

Convierte tu Raspberry en un NAS. Firmware fvdw-sl 15.3 - Raspberry Pi Forums

How to format a Get Request

avrdude: verification error, first mismatch at byte 0x0000 0x0c != 0x62