Skip to content

Instantly share code, notes, and snippets.

View precondition's full-sized avatar

precondition

View GitHub Profile
@precondition
precondition / code2name.json
Last active July 21, 2022 10:37
Lookup Table to convert QMK keycodes into their readable keycode name (US) aliases
{
"0": "KC_NO",
"1": "KC_TRANSPARENT",
"2": "KC_POST_FAIL",
"3": "KC_UNDEFINED",
"4": "KC_A",
"5": "KC_B",
"6": "KC_C",
"7": "KC_D",
"8": "KC_E",
@precondition
precondition / HID_X11_converter.py
Last active March 14, 2022 19:22
Converter between HID and X11 keycodes
#!/usr/bin/env python3
"""
Usage:
$ python3 HID_X11_converter.py --type X11 <keycode number as shown in `xmodma -pke`>
$ python3 HID_X11_converter.py --type HID <keycode number used in QMK>
HID keycodes as used in QMK can be found in https://docs.google.com/spreadsheets/d/1TAK6df8bObeswn8CnxIGgZJB_NYON_p8GReMfZ2O-sE/edit#gid=0.
Look for the "Basic Keycodes" sheet and don't forget to convert from hexadecimal to decimal notation when using this tool.
An enum starts on 0 unless specified otherwise and the integer affected to every item in the enum increases one by one as you go down the enum, unless a specific integer is assigned to an enum item.
@precondition
precondition / _qmk
Last active October 6, 2021 18:07
Zsh autocompletion file for the QMK CLI tool. To use it, just add this file in one of the directories of your $fpath and `compdef _qmk qmk` to your .zshrc
#compdef qmk
_qmk_compile(){
_arguments \
'-h[Print help text.]' \
'--help[Print help text.]' \
"-n[Don't actually build, just show the make command to be run.]::_qmk_compile" \
"--dry-run[Don't actually build, just show the make command to be run.]::_qmk_compile" \
'-km[The keymap to build a firmware for. Ignored when a configurator export is supplied.]::_qmk_compile' \
'--keymap[The keymap to build a firmware for. Ignored when a configurator export is supplied.]::_qmk_compile' \