Skip to content

Instantly share code, notes, and snippets.

@i5ar
Created July 6, 2022 11:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save i5ar/bb6ff5889151ea012779fdd56921cd85 to your computer and use it in GitHub Desktop.
Save i5ar/bb6ff5889151ea012779fdd56921cd85 to your computer and use it in GitHub Desktop.
PRK Firmware Keymap
# Initialize a Keyboard
kbd = Keyboard.new
# You can make right side the "anchor" (so-called "master")
# Initialize GPIO assign
kbd.init_pins(
[6, 7], # row0, row1, etc.
[9, 10] # col0, col1, etc.
)
#keyboard.row_pins = (board.GP6, board.GP7)
#keyboard.col_pins = (board.GP9, board.GP10)
# default layer should be added at first
kbd.add_layer :default, %i[
KC_A KC_S
KC_C KC_V
]
# `before_report` will work just right before reporting what keys are pushed to USB host.
# You can use it to hack data by adding an instance method to Keyboard class by yourself.
# ex) Use Keyboard#before_report filter if you want to input `":" w/o shift` and `";" w/ shift`
#kbd.before_report do
# kbd.invert_sft if kbd.keys_include?(:KC_SCOLON)
# # You'll be also able to write `invert_ctl`, `invert_alt` and `invert_gui`
#end
kbd.start!
@i5ar
Copy link
Author

i5ar commented Jul 6, 2022

We can use all GP pins except maybe GP8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment