Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

5 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

KeyMimic v2.0

Professional Keyboard & Mouse Automation Tool for Windows

๐ŸŽฏ Key Features

  • โœ… Simplified Syntax โ€” Use press s instead of press('s') - no parentheses or quotes needed!
  • โœ… Global Hotkeys โ€” Control Record/Start/Stop with F-keys even when app is minimized
  • โœ… Visual Keyboard Editor โ€” Click keys to generate macro code
  • โœ… Help Dialog โ€” Built-in key code reference
  • โœ… Individual Thread Logs โ€” Each thread has its own log
  • โœ… Dynamic Threads โ€” Add/remove threads as needed
  • โœ… Profile System โ€” Save and switch between macros
  • โœ… Keyboard & Mouse Recording โ€” Record keyboard and mouse actions in real-time
  • โœ… Mouse Auto-Return โ€” Mouse returns to starting position when macro loops
  • โœ… Low-Level Input โ€” Uses Windows SendInput API with scan codes
  • โœ… Humanize Mode โ€” Random timing variations for natural behavior
  • โœ… 100% English โ€” All interface and code in English

๐Ÿš€ Quick Start

Installation

cd KeyMimic_2.0
python main.py

Requirements:

  • Python 3.7+
  • Windows OS (for actual input)
  • tkinter (usually included with Python)

First Steps

  1. Run python main.py
  2. Click "Help" button to see all key codes
  3. Click "Visual Editor" to generate macros by clicking keys
  4. Write a macro or use "Record" to record actions
  5. Click "Start" to execute

๐Ÿ“ Macro Syntax

Basic Commands (New Simplified Syntax)

# Keyboard - simple and clean!
press s             # Press S key
release s           # Release S key
press ctrl          # Press Ctrl
press enter         # Press Enter
press 31            # Can also use numeric scan codes

# Mouse actions
click               # Left click
right_click         # Right click
move 100 50         # Move mouse relative (dx, dy)
move_to 500 300     # Move mouse to absolute position (x, y)

# Timing
sleep 1             # Wait 1 second
sleep 5 2           # Wait 5 sec ยฑ 2 sec variation

# Logging
log Starting automation   # Log message (captures to end of line)

Old Syntax (Still Supported)

For backward compatibility, the old syntax still works:

press('s')          # Old way
release(31)         # Old way
sleep(1)            # Old way

Metadata

# thread_name: My Automation
# humanize: 15

Complete Example

# thread_name: WASD Movement
# humanize: 10

log Starting movement

press w
sleep 1
release w

press a
sleep 0.5
release a

click
sleep 0.3

log Complete!

๐ŸŽฎ Main Features

1. Symbolic Key Names

Instead of remembering numeric codes, use friendly names:

# Old way (still works)
press(31)
release(31)

# New way (better!)
press('s')
release('s')

Available names:

  • Letters: 'a', 'b', 'c', ..., 'z'
  • Numbers: '1', '2', '3', ..., '0'
  • Function keys: 'f1', 'f2', ..., 'f12'
  • Modifiers: 'ctrl', 'shift', 'alt', 'win'
  • Special: 'enter', 'space', 'tab', 'esc', 'backspace'
  • Arrows: 'up', 'down', 'left', 'right'
  • And 60+ more!

See complete list by clicking "Help" button.

2. Visual Keyboard Editor

Click the "Visual Editor" button to:

  • See a full QWERTY keyboard layout
  • Click keys to generate code
  • Toggle modifiers (Ctrl/Shift/Alt)
  • Insert sleep delays
  • Generate macro code automatically

Perfect for beginners or quick macro creation!

3. Help Dialog

Click "Help" button to see:

  • All available key names
  • Numeric scan codes
  • Organized by category
  • Both symbolic and numeric formats

4. Thread Management

  • Add Thread: "+" button
  • Remove Thread: "X" in panel header
  • Individual Logs: Each thread has its own log
  • Independent Execution: Threads run separately

5. Profile System

  • Select Profile: Dropdown menu
  • Create: "+" button
  • Rename: "Edit" button
  • Delete: "Del" button
  • Auto-save: Saves while editing

6. Keyboard Recording

  1. Click "Record" button
  2. Press keys
  3. Click "Stop Recording"
  4. Profile automatically created

๐Ÿ”ง Key Code Reference

Letters (symbolic names)

'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p'
'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l'
'z', 'x', 'c', 'v', 'b', 'n', 'm'

Numbers

'1', '2', '3', '4', '5', '6', '7', '8', '9', '0'

Function Keys

'f1', 'f2', 'f3', 'f4', 'f5', 'f6',
'f7', 'f8', 'f9', 'f10', 'f11', 'f12'

Modifiers

'shift', 'lshift', 'rshift'
'ctrl', 'lctrl', 'rctrl'
'alt', 'lalt', 'ralt'
'win', 'lwin', 'rwin'

Special Keys

'esc', 'tab', 'caps', 'space', 'enter',
'backspace', 'delete', 'insert'

Arrows

'up', 'down', 'left', 'right'

Navigation

'home', 'end', 'pageup', 'pagedown'

For complete list with numeric codes, click Help button in the app!

๐Ÿ“ File Structure

KeyMimic_2.0/
โ”œโ”€โ”€ main.py                    # Application entry point
โ”œโ”€โ”€ keymimic/
โ”‚   โ”œโ”€โ”€ core/                  # Core functionality
โ”‚   โ”‚   โ”œโ”€โ”€ constants.py       # Scan codes
โ”‚   โ”‚   โ”œโ”€โ”€ key_names.py       # Symbolic name mappings
โ”‚   โ”‚   โ”œโ”€โ”€ input_sender.py    # Windows API
โ”‚   โ”‚   โ”œโ”€โ”€ macro_parser.py    # Parser with aliases
โ”‚   โ”‚   โ”œโ”€โ”€ macro_runner.py    # Executor
โ”‚   โ”‚   โ””โ”€โ”€ recorder.py        # Keyboard recording
โ”‚   โ”œโ”€โ”€ gui/                   # User interface
โ”‚   โ”‚   โ”œโ”€โ”€ main_window.py     # Main window
โ”‚   โ”‚   โ”œโ”€โ”€ thread_panel.py    # Thread panel
โ”‚   โ”‚   โ”œโ”€โ”€ help_dialog.py     # Help window
โ”‚   โ”‚   โ””โ”€โ”€ visual_editor.py   # Visual keyboard
โ”‚   โ””โ”€โ”€ utils/                 # Utilities
โ”‚       โ””โ”€โ”€ profile_manager.py # Profile management
โ””โ”€โ”€ README.md                  # This file

๐Ÿ’พ Data Location

Profiles

Profiles saved in:

Documents/KeyMimic/profiles/
โ”œโ”€โ”€ thread_1_profiles.json
โ”œโ”€โ”€ thread_2_profiles.json
โ”œโ”€โ”€ hotkeys.json
โ””โ”€โ”€ ...

Debug Logs

Debug information automatically saved to:

Documents/KeyMimic/debug.log

See DEBUG_LOGGING.md for details on how to use debug logs.

๐ŸŽ“ Tips

  1. Simple syntax โ€” No parentheses or quotes needed!
  2. Use Visual Editor โ€” Quick macro creation
  3. Check Help โ€” Reference for all key names
  4. Test without loop โ€” Verify macros first
  5. Check thread logs โ€” Each thread shows its own activity
  6. Use humanize โ€” More natural in games
  7. Name profiles โ€” Easy to find later
  8. Configure hotkeys โ€” Click Settings to customize F-key shortcuts

๐Ÿ“š Example Macros

Simple Movement

# WASD movement
press w
sleep 1
release w

With Modifiers

# Ctrl+C to copy
press ctrl
press c
sleep 0.1
release c
release ctrl

Mouse Actions

# Click and move
click
sleep 0.5
move 100 50         # Move relative
move_to 500 300     # Move to absolute position
right_click

Loop with Humanize

# thread_name: Farm Bot
# humanize: 15

press f1
sleep 0.1
release f1
sleep 2
click
sleep 1.5

โš ๏ธ Important

  • Works only on Windows
  • May need admin rights for some games
  • Some anti-cheats may block it
  • Use responsibly within game/app rules

๐Ÿ”„ Version History

v2.0.0 (Current)

  • โœ… Simplified syntax - press s instead of press('s')
  • โœ… Global hotkeys - Control with F-keys even when app is minimized
  • โœ… Hotkey configuration - Customize Record/Start/Stop shortcuts in Settings
  • โœ… 100% English interface and code
  • โœ… Visual keyboard editor
  • โœ… Help dialog with key codes
  • โœ… Mouse action aliases
  • โœ… Individual thread logs
  • โœ… Modular architecture
  • โœ… Backward compatible with old syntax

v1.0.0

  • Basic functionality
  • 2 static threads
  • Shared log
  • Russian interface

๐Ÿ“„ License

Free to use.


Made with โค๏ธ for automation enthusiasts

Need help? Click the Help button in the app!

About

Automated virtual keyboard powered by macros, featuring two independent threads for parallel input simulation and high-speed control of keys and mouse actions.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages