Skip to content

A Windows keyboard automation tool with dual output modes, multi-language UI, and DirectInput game support, auto-repeating keys on hold, with plans for broader macro app development compatible with various keyboards.

License

Notifications You must be signed in to change notification settings

HugoLi0213/AutoFire

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

26 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

AutoFire - Keyboard Automation Tool

โš ๏ธ For Educational Purposes Only
This tool is provided for learning and educational purposes. Users are responsible for ensuring compliance with applicable Terms of Service and local laws.

Author: Hugo
Last Updated: 2025-10-06

A Windows keyboard automation tool that automatically repeats key presses while you hold a trigger key. Supports both SendInput (hardware-level, AHK-like) and PostMessage (message queue) methods.

๐ŸŒ ็น้ซ”ไธญๆ–‡่ชชๆ˜Ž | ็ฎ€ไฝ“ไธญๆ–‡่ฏดๆ˜Ž


๐Ÿ›ก๏ธ Security & Safety

Why This Tool is Safe

This application uses legitimate Windows API calls - the same APIs used by trusted software:

What It Does What It Does NOT Do
โœ… Sends keyboard events via API โŒ Does NOT read game memory
โœ… Uses standard Windows functions โŒ Does NOT write to game memory
โœ… Operates outside game process โŒ Does NOT inject DLLs
โœ… Same as AutoHotkey/RDP โŒ Does NOT hook game functions

Legitimate Uses

This tool uses the same technology as:

  • ๐Ÿ–ฅ๏ธ Remote Desktop (TeamViewer, Windows RDP)
  • โ™ฟ Accessibility Tools (Screen readers, voice control)
  • ๐Ÿค– Automation Software (AutoHotkey, Selenium)
  • ๐ŸŽฎ Game Streaming (Steam Remote Play)

Important Notes

โš ๏ธ Always check game Terms of Service - Some games prohibit ANY automation
โš ๏ธ Use responsibly - Games can still detect unusual behavior patterns
โš ๏ธ Educational purpose - Use at your own risk


๐Ÿš€ Features

  • ๐ŸŽฎ Two Output Modes: SendInput (hardware-level, DirectInput compatible) or PostMessage (safer)
  • ๐ŸชŸ Auto-detect Windows: Dropdown list of all open windows
  • โŒจ๏ธ Customizable Keys: Set trigger and output keys
  • โšก Adjustable Speed: Configure interval (1-1000ms)
  • ๐ŸŒ Multi-language UI: English / ็น้ซ”ไธญๆ–‡ switchable interface
  • ๐Ÿ”„ Window Refresh: Update window list on-the-fly
  • ๐ŸŽฏ Pass-through Mode: Optional key blocking
  • ๐Ÿ’พ Persistent Config: Saves your settings automatically
  • ๐Ÿงช Fully Tested: Comprehensive pytest test suite

๐Ÿ“‹ Quick Start

Installation

  1. Install Python 3.8+ (if not already installed)

  2. Install dependencies:

    pip install keyboard
  3. Run as Administrator (required for keyboard hooks):

    python autofire_ui.py

Basic Usage

  1. Select Target Window - Choose from dropdown or type window title (click ๐Ÿ”„ to refresh)
  2. Set Trigger Key - The key you'll hold (e.g., e)
  3. Set Output Key - The key to auto-fire (e.g., r)
  4. Set Interval - How fast to repeat in milliseconds (default: 100ms)
  5. Choose Mode - โœ… Check "Use SendInput" for better game compatibility
  6. Click Start - Hold trigger key to activate, release to stop

๐Ÿ“ธ Example Configuration

AutoFire Configuration Example

Tale Runner Example Settings:

  • Trigger Key: e (hold this key)
  • Output Key: e (this key will auto-fire)
  • Target Window: Tales Runner
  • Interval: 100ms (fires 10 times per second)
  • SendInput: โœ… Enabled (for DirectInput game compatibility)

Result: Hold E key โ†’ Auto-fires E every 100ms โ†’ Works with DirectInput games!

๐ŸŽฎ Output Modes Explained

SendInput Mode (Recommended, Default)

How it works: Simulates hardware-level keyboard input using scan codes

  • โœ… Works with DirectInput games (games that read directly from keyboard driver)
  • โœ… Same method as AutoHotkey
  • โœ… Better compatibility with modern games
  • โš ๏ธ Slightly more detectable

Use when: Game ignores PostMessage (most modern games)

PostMessage Mode (Alternative)

How it works: Sends messages to window's message queue

  • โœ… Safer - lower detection risk
  • โœ… Window-specific targeting
  • โŒ Doesn't work with DirectInput games
  • โŒ Some games ignore message queue input

Use when: You need safer method or target application reads message queue

โš™๏ธ How It Works

1. You hold trigger key (e.g., "E")
   โ†“
2. Keyboard hook detects press
   โ†“
3. Background thread starts
   โ†“
4. Validates target window exists
   โ†“
5. Loop starts:
   - SendInput/PostMessage: KEY_DOWN
   - Wait 20ms
   - SendInput/PostMessage: KEY_UP
   - Wait [your interval]ms
   โ†“
6. You release trigger โ†’ Loop stops

Windows APIs Used

API Purpose Safe?
SendInput() Hardware-level input simulation โœ… Standard API
PostMessageW() Message queue input โœ… Standard API
FindWindowW() Locate window by title โœ… Read-only
EnumWindows() List all windows โœ… Read-only
MapVirtualKeyW() Get scan codes โœ… Read-only

No memory reading, no code injection, no DLL hooking.


๐Ÿงช Testing

pytest

All tests verify:

  • UI functionality
  • Thread safety
  • Configuration management
  • Input simulation logic
  • Error handling

โ“ FAQ

Q: Does this work with all games?
A: Use SendInput mode for best compatibility. PostMessage mode doesn't work with DirectInput games.

Q: Will I get banned?
A: This uses legitimate Windows APIs like AutoHotkey. However, check your game's Terms of Service. Some games prohibit automation.

Q: Why do I need Administrator privileges?
A: Windows requires admin rights for global keyboard hooks to detect your trigger key.

Q: SendInput vs PostMessage - which should I use?
A: SendInput (default) works with more games. PostMessage is safer but less compatible.

Q: How do I switch languages?
A: Click the "EN/็นไธญ" button in the top-right corner of the app.


๐Ÿ“ Configuration File

Settings are automatically saved to autofire.json:

{
  "trigger_key": "e",
  "output_key": "r",
  "interval_ms": 100,
  "window_title": "Tales Runner",
  "pass_through": false,
  "use_sendinput": true,
  "language": "en"
}

๐Ÿงช Testing

Run the test suite:

pytest

All tests verify: UI functionality, thread safety, config management, and error handling.


๐Ÿค Contributing

Contributions welcome! Please ensure:

  • All tests pass (pytest)
  • Code follows existing style
  • Documentation is updated

๐Ÿ“„ License & Disclaimer

For Educational Purposes Only

This project is provided as-is for educational and learning purposes. The author is not responsible for any misuse or violations of Terms of Service. Users must:

  • โœ… Understand how Windows APIs work
  • โœ… Respect software Terms of Service
  • โœ… Use responsibly and ethically
  • โš ๏ธ Accept all risks associated with use In the future, we can develop more marco apps similar to razer so that more different keyboards can be used.

๏ฟฝ Additional Resources

Q: Will I get banned?
A: Depends on game rules. Safer than memory cheats, but automation may be prohibited.

Q: Why doesn't it work in my game?
A: Some games use DirectInput or filter PostMessage events.

Q: Can anti-cheat detect it?
A: Behavioral detection can flag patterns, but this doesn't use memory manipulation.

Q: Why require Administrator?
A: For the keyboard hook to detect trigger keys globally.

About

A Windows keyboard automation tool with dual output modes, multi-language UI, and DirectInput game support, auto-repeating keys on hold, with plans for broader macro app development compatible with various keyboards.

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages