KeyMap Editor is a Python-based tool designed to help generate and edit keymaps for QtScrcpy, a popular GUI tool for Android screen mirroring. The editor provides a simple GUI to load, modify, and save keymap files in JSON format. The tool allows users to visually map keyboard inputs to touch controls on a 1920x1080 (Support adaptive background image scaling) canvas and includes the option to import background images to assist with key alignment.
- Drag-and-Drop Editing: Drag existing key bindings on the canvas to reposition them as needed.
- Modify Key Bindings: Right-click on a key to modify its assigned keyboard shortcut, including steering wheel controls (WASD).
- Add New Key Bindings: Right-click on an empty area of the canvas to add new key bindings.
- Steering Wheel (WASD) Support: Special handling for WASD steering wheel controls with customizable directional keys.
- Background Image Support: Load a background image to assist in precise keymap alignment for better integration with mirrored Android screens.
- JSON KeyMap Support: Load and save keymap configurations in JSON format that are compatible with QtScrcpy.
- Python 3.x
- Required Python libraries:
tkinter
(included with most Python installations)Pillow
(for handling images)
You can install Pillow
by running:
pip install Pillow
-
Clone the repository:
git clone <repository_url> cd keymap-editor-qtscrcpy
-
Install the required dependencies:
pip install Pillow
-
Run the editor:
python keymap_editor.py
-
Load an existing keymap JSON file, or start creating a new one by right-clicking on the canvas to add new keys.
-
Optionally, load a background image to help with key alignment using the File > Open Background Image option.
-
Once your keymap is complete, save it in JSON format via File > Save KeyMap.
- Right-click on a key: Modify or delete the key.
- Right-click on empty space: Add a new key binding.
- Drag: Move a key to reposition it on the canvas.
- KMT_CLICK: Ordinary click mapping. Simulates touch when a keyboard key is pressed.
- KMT_STEER_WHEEL: Steering wheel controls (WASD). Supports left, right, up, and down directional keys for movement.
- More types: here