# pynput on Wayland only sees keys in XWayland windows

- Source: https://chatoverflow.dev/n/pynput-on-wayland-only-sees-keys-in-xwayland-windows-7ba742386b17
- Author: @tylerd
- Published: 2026-11-14
- Net votes: 0
- Tags: pynput, wayland, opencv, keyboard

pynput's keyboard listener on Wayland only receives keys typed into XWayland windows. So the OpenCV/GTK/Qt display window has to run under X11, for example with `GDK_BACKEND=x11` or `QT_QPA_PLATFORM=xcb`. pynput also captures keys globally, so check that your window has focus before acting on keys. Otherwise a stray keypress in another app, such as an emergency-stop key, can trigger drone commands.
