Last active
April 24, 2022 06:53
-
-
Save digitarhythm/f21423be5fcac10aebf83bdb07ae6a19 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Initialize a Keyboard | |
kbd = Keyboard.new | |
kbd.split = true # This should happen before Keyboard#init_pins. | |
# Initialize GPIO assign | |
kbd.init_pins( | |
[ 3, 2, 6, 4 ], # row0, row1,... respectively | |
[ 15, 14, 10, 7, 5 ] # col0, col1,... respectively | |
) | |
#keyboard.row_pins = (board.GP3, board.GP2, board.GP6,board.GP4) | |
#keyboard.col_pins = (board.GP15, board.GP14, board.GP10, board.GP7) | |
#cool640 half PCB ver.1.0 | |
# If your right hand of cool640 is the "anchor" | |
kbd.set_anchor(:right) | |
kbd.split_style = :right_side_flipped_split | |
# This keymap.rb is right hands. | |
kbd.init_matrix_pins( | |
[ | |
[[15,3],[14,3],[10,3],[7,3],[5,3]], | |
[[15,2],[14,2],[10,2],[7,2],[5,2]], | |
[[15,6],[14,6],[10,6],[7,6],[5,6]], | |
[[15,4],[14,4],[10,4],[7,4],[5,4]], | |
] | |
) | |
# default layer should be added at first | |
kbd.add_layer :default, %i[ | |
KC_Q KC_W KC_E KC_R KC_T KC_Y KC_U KC_I KC_O KC_P | |
KC_A KC_S KC_D KC_F KC_G KC_H KC_J KC_K KC_L KC_MINUS | |
KC_LSFT KC_Z KC_X KC_C KC_V KC_B KC_N KC_M KC_COMMA KC_DOT | |
KC_ESCAPE KC_F15 KC_LCTL KC_BSPACE LAYER1_SPC LAYER1_SPC KC_ENTER CTRL_SCOLON KC_F16 KC_TAB | |
] | |
kbd.add_layer :layer1, %i[ | |
KC_1 KC_2 KC_3 KC_4 KC_5 KC_6 KC_7 KC_8 KC_9 KC_0 | |
KC_NO KC_NO KC_NO KC_NO KC_NO KC_NO KC_NO KC_NO KC_NO KC_EQUAL | |
KC_NO KC_NO KC_NO KC_NO KC_NO KC_NO KC_NO KC_NO KC_LBRC KC_RBRC | |
KC_NO KC_NO KC_NO KC_NO LAYER2_SPC LAYER2_SPC KC_NO KC_NO KC_NO KC_NO | |
] | |
kbd.add_layer :layer2, %i[ | |
KC_F1 KC_F2 KC_F3 KC_F4 KC_F5 KC_F6 KC_F7 KC_F8 KC_F9 KC_F10 | |
KC_NO KC_NO KC_NO KC_NO KC_NO KC_NO KC_NO KC_NO KC_NO KC_NO | |
KC_NO KC_NO KC_NO KC_NO KC_NO KC_NO KC_NO KC_NO KC_NO KC_NO | |
KC_NO KC_NO KC_NO KC_NO KC_NO KC_NO KC_NO KC_NO KC_NO KC_NO | |
] | |
# Your custom Keycode or Keycode (only modifiers) Release time Re-push time | |
# key name Array of Keycode or Layer Symbol to be held threshold(ms) threshold(ms) | |
# or Proc or Proc which will run to consider as to consider as | |
# when you click while you keep press `click the key` `hold the key` | |
kbd.define_mode_key :LAYER1_SPC, [ :KC_SPACE, :layer1, 150, 250 ] | |
kbd.define_mode_key :LAYER2_SPC, [ :KC_SPACE, :layer2, 150, 250 ] | |
kbd.define_mode_key :CTRL_SCOLON, [ :KC_SCOLON, :KC_RCTL, 150, 250 ] | |
kbd.start! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment