This allows you to record keyboard and mouse input, and play it back using pynput.

Overview

Record and Play with Python!

This allows you to record keyboard and mouse input, and play it back (with looping) using pynput. It allows for automation of any repetitive computer tasks.

Installation

  • Clone or download this repository
  • Navigate to the repository in cmd or terminal
  • Run pip install -r requirements.txt

Usage

  • Simply run the 'record.py' file with Python3 using one input argument -> "name_of_recording". Whatever you do thereafter will be recorded.
  • To end the recording click the escape key (to end the Keyboard thread), and hold down the right click on the mouse for more than 2 seconds - then release (to end the Mouse thread).
  • To play back the recording, run the 'play.py' file with Python3 using two input arguments -> "name_of_recording" 'number_of_repeats'.

If you want to kill the play-back early, you can trigger a KeyboardInterrupt by clicking into the terminal window and pressing 'ctrl c' - although you'll have to do this while the automation is running.

Notes

  • The data file takes in mouse movements every 50th of a second when holding down the left click on the mouse (dragging). If you aren't dragging a lot then you can run a relatively lengthy automation without creating a huge data file, however, if you're dragging a lot, keep the recording relatively short, as the data file will quickly fill up with mouse-movement JSON data.

Scrolling functionality is suppported, however it is not completely precise, due to the carry through nature of scrolling on many applications. So it is recommended to drag scrollbars when available.

Compatablitity

This is Mac compatiable – as I haven't been able to find others out there that are.

Authors

George Jensen

Support!

If you found this tool useful please give this repo a star!
You might also like...
 Lenovo Legion 5 Pro 2021 Linux RGB Keyboard Light Controller
Lenovo Legion 5 Pro 2021 Linux RGB Keyboard Light Controller

Lenovo Legion 5 Pro 2021 Linux RGB Keyboard Light Controller This util allows to drive RGB keyboard light on Lenovo Legion 5 Pro 2021 Laptop Requireme

Keystroke logging, often referred to as keylogging or keyboard capturing

Keystroke logging, often referred to as keylogging or keyboard capturing, is the action of recording the keys struck on a keyboard, typically covertly, so that a person using the keyboard is unaware that their actions are being monitored.

Get input from OLED Joystick, Runs command, Displays output on OLED Screen (Great for P4wnP1)

p4wnsolo-joyterm Gets text input from OLED Joystick Runs the command you typed Displays output on OLED Screen (Great for P4wnP1 - even better on Raspb

Play music on Raspberry Pi Pico Without CPU involvement

MicroPython_PIO_Music_DMA Play music on Raspberry Pi Pico Without CPU involvement This is based on PIOBeep (https://github.com/benevpi/pico_pio_buzz)

Play a song with a 3D printer.

MIDI to GCODE Play a song with a FDM 3D printer. SLA printers don't have motors, so they cannot play music. Warning: Be ready to turn off the 3D print

An IoT Trivia app that shows you how to take a JSON web API such as the opentdb.com API and stream and display it on a FeatherS2 in an OLED display.
An IoT Trivia app that shows you how to take a JSON web API such as the opentdb.com API and stream and display it on a FeatherS2 in an OLED display.

CircuitPython IoT Trivia ESP32-S2 OLED Version An IoT Trivia app that shows you how to take a JSON web API such as the opentdb.com API and stream and

Code and build instructions for Snap, a simple Raspberry Pi and LED machine to show you how expensive the electricyty is at the moment

Code and build instructions for Snap, a simple Raspberry Pi and LED machine to show you how expensive the electricyty is at the moment. On row of LEDs shows the cost of the hour, the other row the cost of the day.

Alternative firmware for ESP8266 with easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX. Full documentation at

Alternative firmware for ESP8266/ESP32 based devices with easy configuration using webUI, OTA updates, automation using timers or rules, expandability

A Home Assistant sensor that tells you what holiday is next
A Home Assistant sensor that tells you what holiday is next

Next Holiday Sensor This sensor tells you what holiday is coming up next. You can use it to set holiday light colors or other scenes. The state of the

Comments
  • added speed multiplier functionality

    added speed multiplier functionality

    Wondering what your thoughts would be on adding this to the main branch? I added an additional play.py input that allows the user to speed up the play execution by supplying a speed multiplier value.

    opened by samuel-attaya 0
  • The operation did not complete successfully because the file contains a virus or potentially unwanted software

    The operation did not complete successfully because the file contains a virus or potentially unwanted software

    OS: Windows 11 Home, Version: 21H2. I cloned the repo via GitHub Desktop and got the following in VS Code:

    The editor could not be opened due to an unexpected error. ...

    image

    and the following when trying to open with notepad:

    The operation did not complete successfully because the file contains a virus or potentially unwanted software

    image

    #3

    Suggestions?

    opened by sgbaird 0
  • Consider providing a list of alternatives in the README and why someone might choose this repo

    Consider providing a list of alternatives in the README and why someone might choose this repo

    For example, I had trouble finding other macro recorders based on pynput.

    • https://github.com/RMPR/atbswp seems like a good option, but for me, it's important to be able to use an API for macros that have already been recorded (rather than relying exclusively on a GUI)
    • https://github.com/taojy123/KeymouseGo (very popular, ~2k stars, but mostly in Chinese)

    This repo seems straightforward, and the code seems lean, which can be a plus, especially in the context of #3.

    And of course, maybe mentioning some of paid and non-open-source implementations and mentioning the benefits of it being free, open-source code.

    opened by sgbaird 0
  • Consider adding

    Consider adding "Is this safe to use?" section in the README

    For example, links to official/reputable documentation for the dependencies listed. You can also suggest that users look at the two files and see themselves.

    opened by sgbaird 0
Owner
George Jensen
George Jensen
A module for cross-platform control of the mouse and keyboard in python that is simple to install and use.

PyUserInput PyUserInput is a group project so we've moved the project over to a group organization: https://github.com/PyUserInput/PyUserInput . That

Paul Barton 1k Dec 27, 2022
Brogrammer-keyboard - FIrmware for the Brogrammer Keyboard v1.0

Brogrammer Keyboard Firmware The package contains the firmware that runs on the Brogrammer Keyboard v1.0 See https://imgur.com/a/oY5QZ14 This keyboard

Devin Hartleben 1 Apr 21, 2022
An arduino/ESP project that can play back G-Force data previously recorded

An arduino/ESP project that can play back G-Force data previously recorded

null 7 Apr 12, 2022
Hook and simulate global mouse events in pure Python

mouse Take full control of your mouse with this small Python library. Hook global events, register hotkeys, simulate mouse movement and clicks, and mu

BoppreH 722 Dec 31, 2022
A python script for macOS to enable scrolling with the 3M ergonomic mouse EM500GPS in any application.

A python script for macOS to enable scrolling with the 3M ergonomic mouse EM500GPS in any application.

null 3 Feb 19, 2022
KIRI - Keyboard Interception, Remapping, and Injection using Raspberry Pi as an HID Proxy.

KIRI - Keyboard Interception, Remapping and Injection using Raspberry Pi as a HID Proxy. Near limitless abilities for a keyboard warrior. Features Sim

Viggo Falster 10 Dec 23, 2022
Hook and simulate global keyboard events on Windows and Linux.

keyboard Take full control of your keyboard with this small Python library. Hook global events, register hotkeys, simulate key presses and much more.

BoppreH 3.2k Dec 30, 2022
Make your MacOS keyboard brightness fade in and out

Make your MacOS keyboard brightness fade in and out. (It's working depends on the Kbrightness file, which only works for <2015 Macs, so this will only work on <2015 Macs.)

null 1 Dec 16, 2021
A custom mechanical keyboard inspired by the CFTKB Mysterium

Env-KB A custom mechanical keyboard inspired by the CFTKB Mysterium Build Guide and Parts List What is to do? Right now for the first 5 PCBs I have, i

EnviousData 203 Jan 4, 2023
This is a Virtual Keyboard which is simple yet effective to use.

Virtual-Keyboard This is a Virtual KeyBoard which can track finger movements and lets you type anywhere ranging from notepad to even web browsers. It

Jehan Patel 3 Oct 1, 2021