Skip to content

Latest commit

 

History

History

QMKata

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

readme.md

QMKata demo

proof of concept demo (windows) of arduino firmata support in qmk firmware

  • set rgb matrix from host: video/gif playback, matplotlib animation, audio peak level
  • build and load kbsm behavior modules (flash or SRAM) — see "kbsm modules" below
  • build and upload user RGB animation dynamically to SRAM
  • set default layer and switch kbsm behavior module depending on application in focus
  • set parameters: mac/win mode, debug config, rgb mode/hsv/speed, keymap flags, debounce, ...
  • get battery/raw matrix/dip switch status
  • "keyboard scripting", access keyboard mcu memory/eeprom and compile/execute c function from host python.
  • show console output
  • websocket server to set default layer from other apps
  • websocket server to set rgb matrix from other apps (screen capture ws client example)

supported keyboards

install

  • python 3.11
  • install packages in requirements.txt:
pip install -r requirements.txt

run

python QMKata.py

keyboard script

see kb_scripts dir for examples.

arm toolchain

see: https://developer.arm.com/downloads/-/gnu-rm and docs/cross-compiler-setup.md for setup details. modify KeychronQ3Max.TOOLCHAIN to change path, includes/options, ... as needed.

kbsm modules

QMKata builds and uploads kbsm behavior modules to the keyboard. The same C source can be linked for either of two targets:

  • Flash — module ships to a 4 KB module-loader slot in MCU flash (slot 0..7 on the Keychron Q3 Max). Writable globals (.data, .bss) are rejected at build time; only code + read-only data is uploaded. Survives power cycles and eeconfig resets.
  • SRAM — module is relocated into a reserved SRAM slot (slot 8 on the Q3 Max) at upload time. .data and .bss are kept in the module blob, so the module can hold mutable state across callbacks. Lost on reboot; meant for iteration and for modules that need persistent runtime state.

See kbsm_module_examples/ for working SRAM modules (kbsm_dyad, kbsm_holdseq, kbsm_autotext, kbsm_sticky_combo, kbsm_vim_modal), module_api.h for the host-side ABI (kbsm_env_t, hook indices, version), and docs/ for the build pipeline (sram-module-compilation.md), the relocation model and the -fPIC rationale (sram-module-relocation.md), step-by-step authoring (authoring-sram-modules.md), and the LLM agent guide for generating modules (kbsm-agent-instructions.md).

websocket client examples

in ws_client/

set default layer:

python layer_switch.py <layer>

NOTE: screen capture uses d3dshot which fails to install with python 3.11 so install python 3.8 for screen capture example and the packages in requirements_screen_capture.txt

screen capture and send rgb image:

<python 3.8 path>/python screen_capture_rgb_stream.py --display 0 --fps 25 --width 17 --height 6 --port 8787

demo videos

WARNING: flashing lights

rgb from video/gif playback, screen capture:

rgb light speaker: