Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/pawel-parma/remap-keys

Remapping keyboard keys using AutoHotkey
https://github.com/pawel-parma/remap-keys

ahk ahk-script ahkscript keybindings keyboard keyboard-layout remapping-keyboards remapping-keys

Last synced: about 1 month ago
JSON representation

Remapping keyboard keys using AutoHotkey

Awesome Lists containing this project

README

        

= RemapKeys

RemapKeys allows you to remap your keyboard keys. +
The default mapping "mirrors" the 1-0, q-p, a-l and z-m keys to reach the entire keyboard with one hand.

It consists of two main parts: a script written in AutoHotkey (`remap.ahk`) and a Python script (`main.py`).

== Using remap.ahk

AutoHotkey (v1.1) script that remaps your keyboard keys according to a predefined mapping.

To use it:

1. Make sure you have AutoHotkey v1.1 installed. If not, you can download it from https://www.autohotkey.com/[here].
2. Double-click on the `remap.ahk` file to run the script.
3. Use the key combination Ctrl + Alt + Shift to toggle the key remapping on and off

Tips:

- You can add the script to your startup folder.
- Change the key combination.

== Using main.py

A Python script that allows you to generate your own key mappings.

To use it:

1. Make sure you have Python installed. If not, you can download it from https://www.python.org/downloads/[here].
2. Open the `main.py` file in a text editor.
3. Modify the `mapping` dictionary to define your own key mappings. For example "1": "0" - remap 1 to 0.
4. Ensure `sort_values` has all the keys from the `mapping` dictionary in the order you want them to be sorted.
5. Run the script with the command `python main.py`. It will print the AutoHotkey code for the new mappings.
6. Copy the output and paste it into the `remap.ahk` file below the `mapping := Object()` in the `; Mapping` section.

----
**Note:** +
You have to use the AutoHotkey's notation of keys.
----

Current mapping dictionary:

[source,python]
----
mapping = {
"``": "{Backspace}",
"F1": "{Enter}",

"1": "0", "q": "p", "a": "l", "z": "m",
"2": "9", "w": "o", "s": "k", "x": "n",
"3": "8", "e": "i", "d": "j", "c": "b",
"4": "7", "r": "u", "f": "h", "v": "v",
"5": "6", "t": "y", "g": "g", "b": "c",
"6": "5", "y": "t", "h": "f", "n": "x",
"7": "4", "u": "r", "j": "d", "m": "z",
"8": "3", "i": "e", "k": "s",
"9": "2", "o": "w", "l": "a",
"0": "1", "p": "q",
}
----