Closed guangyu-shi closed 3 years ago
Thank you for your report, and sorry for this very late reply.
I think you will find it very difficult to be selective about what controls to target when using the keyboard controller. A long time ago, controls on windows would often correspond to X windows, but nowadays the widget toolkits only use Xorg as a dumb canvas; this is probably why you cannot detect tab changes in xfce4-terminal.
Targeting specific windows is out of scope for this library, so I will close this issue, but if you find a good solution, do not hesitate to post it here so that other might find it!
When the input_focus got changed(working on another window), pynput will send the keys to the current working window, which can cause the unwanted input for the shel ,or changed files; so I need to detect the input_focus change before sending the keys; hope pynput send the keys only to the concerned process by default or let users choose which window to receive the keys.
I've overrided _send_key at my_Controller; but '\n' is still sent to the active window; so I need to listen to FocusChangeMask; yet can't detect the tab changing of xfce4-terminal.
My host is running xubuntu linux. The keyboard is Xorg. pynput : 1.7.3 Linux : 4.15.0-136-generic
Bliss, --gs