Skip to content
moses-palmer edited this page Aug 30, 2020 · 13 revisions

Planned features

  • Always include key code in key event for listeners. Currently, the vk field is not always set.

  • Flags indicating whether events are injected by pynput. It is currently not possible to distinguish input events generated by pynput from ones generated by the user.

  • Support for detecting double clicks. Some platforms provide this information, so it could be handled using Quartz.CGEventGetIntegerValueField(event, Quartz.kCGMouseEventClickState) on OSX.

  • Support for checking whether keys are pressed in keyboard listener. This missing functionality cannot be reliably implemented without hooking into the operating system.

  • Support for simulating multi touch tablets. This would be a new type of input device along keyboard and mouse. I have not yet looked in to whether this is actually supported on all platforms.

  • Migration plan for Linux. Since X will soon be replaced in some distributions, backends to support Wayland and Mir are required. This may unfortunately not be possible, since at least Wayland does not support any of the functionality required by pynput by default.

    Further investigation reveals that at least Wayland is partially supported out-of-the box by Xwayland:

    • Keyboard controlling work as when running under X.
    • Mouse controlling works, but does not visually update the cursor. This requires some fix for projects like virtualtouchpad, since they require visual feedback.
    • Event monitoring surprisingly works, both for keyboard events and mouse events.

    In the mean time, the uinput backend works regardless of desktop environment, but requires root, and does not reliably work with keyboard layouts. Mouse is not supported at all as of yet.

  • Support for all lock keys. The first step would be make the caps lock implementation less hardcoded to make is easier to add lock keys. This first step would also help with implementing support for the numeric keypad and num lock.

  • Adding a CONTRIBUTING.md file.

  • Add proper hotkey support. The current implementation uses a keyboard listener and transforms and remembers events, but this introduces several problems:

    • Hotkeys are not suppressed from other applications, as normal desktop environment hotkeys are.
    • The implementation has to maintain an internal keyboard state, which may become out of sync with the actual keyboard.
  • Handle multiple keyboard layouts on Windows. pynput attempts to handle keyboard layout changes by means of the WM_INPUTLANGCHANGE message, but it is delivered only to the topmost affected window.

    • This stackoverflow question talks about it, and the accepted answer laments that implementing the required interface from C would be a hassle; doing it from Python would be even worse... The pythoncom library seems like a possible starting point, by it appears to be a difficult dependency to ship.
Clone this wiki locally