Question Details

No question body available.

Tags

python keyboard-events mousewheel

Answers (1)

October 21, 2025 Score: 0 Rep: 1 Quality: Low Completeness: 80%

The short reason: the mouse wheel itself doesn’t normally write characters to stdin, but many terminal emulators can (and do) emit escape sequences for mouse events when mouse reporting is enabled. Because your KeyPoller puts the terminal into raw/unbuffered mode and simply reads stdin, those escape sequences (from mouse wheel or mouse clicks) appear as single characters or short sequences to your reader.

Common mouse-event sequences start with ESC (\x1b) — examples include old \x1b[M... (X10) or newer SGR/URXVT sequences \x1b[