{"id":6807,"library":"pynput-robocorp-fork","title":"Pynput (Robocorp Fork)","description":"This is a maintained fork of the original `pynput` library (by TheMouseOrTheKeyboard), designed specifically for Robocorp's automation needs. It provides cross-platform control and monitoring of user input devices like keyboards and mice, essential for Robotic Process Automation (RPA). Version 5.0.0, released recently, focuses on Python 3.10+ compatibility and Linux environment improvements. Releases align with Robocorp's product development, typically with minor versions for bug fixes and improvements.","status":"active","version":"5.0.0","language":"en","source_language":"en","source_url":"https://github.com/robocorp/pynput","tags":["GUI automation","keyboard control","mouse control","RPA","input devices","robocorp"],"install":[{"cmd":"pip install pynput-robocorp-fork","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"Required for some advanced features on Linux.","package":"python-xlib","optional":true}],"imports":[{"note":"Controller exists in both keyboard and mouse modules; ensure you import from the correct one.","wrong":"from pynput.mouse import Controller","symbol":"Controller","correct":"from pynput.keyboard import Controller"},{"note":"Listeners are module-specific (keyboard/mouse); import from the specific module.","wrong":"from pynput import Listener","symbol":"Listener","correct":"from pynput.keyboard import Listener"},{"symbol":"Key","correct":"from pynput.keyboard import Key"},{"symbol":"Button","correct":"from pynput.mouse import Button"}],"quickstart":{"code":"from pynput.keyboard import Controller, Key\nimport time\n\nkeyboard = Controller()\n\nprint(\"Typing 'Hello World'...\")\nkeyboard.type('Hello World')\n\ntime.sleep(1)\nprint(\"Pressing Enter...\")\nkeyboard.press(Key.enter)\nkeyboard.release(Key.enter)\n\ntime.sleep(1)\nprint(\"Pressing Ctrl+C...\")\nwith keyboard.pressed(Key.ctrl):\n    keyboard.press('c')\n    keyboard.release('c')\n\nprint(\"Keyboard actions completed.\")","lang":"python","description":"This example demonstrates how to use the keyboard controller to type a string, press and release a special key (Enter), and perform a key combination (Ctrl+C)."},"warnings":[{"fix":"Consult your operating system's documentation for granting accessibility/input control permissions to applications or users.","message":"Permissions are required for controlling input devices. On macOS, grant 'Accessibility' permissions to your terminal or IDE. On Linux (X11), ensure your user has appropriate X server access.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Use `threading.Thread` to run the listener in the background, or ensure `join()` is called only when the main thread can afford to block.","message":"When using `Listener` objects, `listener.join()` will block the current thread. For non-blocking behavior in GUI applications or concurrent tasks, run listeners in separate threads or manage them asynchronously.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Upgrade to `pynput-robocorp-fork` version 5.0.0 or newer to ensure full compatibility with Python 3.10+.","message":"Older versions of the `pynput-robocorp-fork` (prior to 5.0.0) may have had compatibility issues with Python 3.10 and newer versions.","severity":"breaking","affected_versions":"<5.0.0"},{"fix":"Always use `pynput-robocorp-fork` for projects intended for Robocorp environments. Refer to the Robocorp fork's GitHub repository for any specific divergences or feature sets.","message":"This is a fork of the original `pynput` library. While it maintains a high degree of API compatibility, it may have subtle differences, specific fixes, or updated dependencies not present in the original `pynput`. Avoid mixing `pynput` and `pynput-robocorp-fork` in the same environment or project.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-15T00:00:00.000Z","next_check":"2026-07-14T00:00:00.000Z","problems":[]}