def send_string(message): seq = [] for char in message: kc = KC[char] if char.isupper(): kc = KC.LSHIFT(kc) seq.append(kc) return simple_key_sequence(seq)
def generate_codepoint_keysym_seq(codepoint, expected_length=4): # To make MacOS and Windows happy, always try to send # sequences that are of length 4 at a minimum # On Linux systems, we can happily send longer strings. # They will almost certainly break on MacOS and Windows, # but this is a documentation problem more than anything. # Not sure how to send emojis on Mac/Windows like that, # though, since (for example) the Canadian flag is assembled # from two five-character codepoints, 1f1e8 and 1f1e6 seq = [KC.N0 for _ in range(max(len(codepoint), expected_length))] for idx, codepoint_fragment in enumerate(reversed(codepoint)): seq[-(idx + 1)] = KC.__getattr__(codepoint_fragment.upper()) return seq
from kmk.kmk_keyboard import KMKKeyboard from kmk.matrix import DiodeOrientation from kmk.modules.layers import Layers # DEBUG_ENABLE = True i2c = busio.I2C(scl=board.SCL, sda=board.SDA, frequency=100000) mcp = MCP23017(i2c, address=0x20) keyboard = KMKKeyboard() layer_ext = Layers keyboard.modules = [layer_ext] _______ = KC.TRNS XXXXXXX = KC.NO FN = KC.MO(1) keyboard.debug_enabled = True keyboard.col_pins = (mcp.get_pin(8), mcp.get_pin(9), mcp.get_pin(10), mcp.get_pin(11), mcp.get_pin(12), mcp.get_pin(13), mcp.get_pin(14), mcp.get_pin(15), mcp.get_pin(4), mcp.get_pin(5), mcp.get_pin(6), mcp.get_pin(7), mcp.get_pin(3), mcp.get_pin(2), mcp.get_pin(1)) keyboard.row_pins = (board.D7, board.D6, board.D5, board.D3, board.D2) keyboard.diode_orientation = DiodeOrientation.COLUMNS keyboard.keymap = [ # Qwerty # ,--------------------------------------------------------------------------------------------------------. # | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Bksp | Del |
keyboard = KMKKeyboard() # ------------------User level config variables --------------------------------------- keyboard.tap_time = 150 layers = Layers() modtap = ModTap() rgb_ext = RGB(pixel_pin=keyboard.rgb_pixel_pin, num_pixels=27, val_limit=100, hue_default=190, sat_default=100, val_default=5) split = Split() keyboard.modules = [modtap, layers, split] keyboard.extensions = [rgb_ext] _______ = KC.TRNS XXXXXXX = KC.NO SHFT_INS = KC.LSHIFT(KC.INS) BASE = KC.DF(0) GAMING = KC.DF(1) LT1_SP = KC.MO(2) LT2_SP = KC.LT(3, KC.SPC) TAB_SB = KC.LT(5, KC.TAB) SUPER_L = KC.LM(4, KC.LGUI) # ---------------------- Keymap --------------------------------------------------------- keyboard.keymap = [ [ # df KC.GRV, KC.N1, KC.N2, KC.N3, KC.N4, KC.N5, KC.N6, KC.N7, KC.N8, KC.N9, KC.N0, KC.DEL, KC.GESC, KC.QUOT, KC.COMM, KC.DOT, KC.P, KC.Y, KC.F, KC.G, KC.C, KC.R, KC.L, KC.BSPC,
# Emoticons, but fancier 'ANGRY_TABLE_FLIP': r'(ノಠ痊ಠ)ノ彡┻━┻', 'CELEBRATORY_GLITTER': r'+。:.゚ヽ(´∀。)ノ゚.:。+゚゚+。:.゚ヽ(*´∀)ノ゚.:。+゚', 'SHRUGGIE': r'¯\_(ツ)_/¯', 'TABLE_FLIP': r'(╯°□°)╯︵ ┻━┻', }) WPM = send_string( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Bibendum arcu vitae elementum curabitur vitae nunc sed. Facilisis sed odio morbi quis.' ) _______ = KC.TRNS xxxxxxx = KC.NO HELLA_TD = KC.TD( KC.A, KC.B, send_string('macros in a tap dance? I think yes'), KC.TG(1), ) rgb_ext = RGB(pixel_pin=keyboard.rgb_pixel_pin, num_pixels=keyboard.rgb_num_pixels) layers_ext = Layers() # TODO Comment one of these on each side split_side = SplitSide.LEFT split_side = SplitSide.RIGHT split = Split(split_type=SplitType.BLE, split_side=split_side) keyboard.extensions = [rgb_ext] keyboard.modules = [split, layers_ext]
from kmk.modules.modtap import ModTap keyboard = KMKKeyboard() # Designed for PB Gherkin (version without LEDs and where switches can be mounted in 4 # different orientations modtap = ModTap() layers_ext = Layers() keyboard.modules = [layers_ext, modtap] # Cleaner key names _______ = KC.TRNS XXXXXXX = KC.NO FN1_SPC = KC.LT(1, KC.SPC) FN2_BSPC = KC.LT(2, KC.BSPC) FN3_C = KC.LT(3, KC.C) FN4_V = KC.LT(4, KC.V) CTL_Z = KC.MT(KC.Z, KC.LCTL) ALT_X = KC.MT(KC.X, KC.LALT) ALT_N = KC.MT(KC.N, KC.LALT) CTL_M = KC.MT(KC.M, KC.LCTL) SFT_ENT = KC.LSFT(KC.ENT) keyboard.keymap = [ [ 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.ESC, CTL_Z, ALT_X, FN3_C, FN4_V, FN2_BSPC, FN1_SPC, KC.B, ALT_N, CTL_M, SFT_ENT
keyboard = KMKKeyboard() # TODO Comment one of these on each side split_side = SplitSide.LEFT split_side = SplitSide.RIGHT split = Split(split_type=SplitType.BLE, split_side=split_side) layers_ext = Layers() keyboard.modules = [layers_ext, split] # Cleaner key names _______ = KC.TRNS XXXXXXX = KC.NO LOWER = KC.MO(2) RAISE = KC.MO(1) RGB_TOG = KC.RGB_TOG RGB_HUI = KC.RGB_HUI RGB_HUD = KC.RGB_HUI RGB_SAI = KC.RGB_SAI RGB_SAD = KC.RGB_SAD RGB_VAI = KC.RGB_VAI RGB_VAD = KC.RGB_VAD keyboard.keymap = [ [ #QWERTY 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.SCLN,\ KC.Z, KC.X, KC.C, KC.V, KC.B, KC.N, KC.M, KC.COMM, KC.DOT, KC.SLSH,\
keyboard.rgb_config['val_default'] = 0 keyboard.rgb_config['knight_effect_length'] = 6 keyboard.rgb_config['animation_mode'] = 'static' keyboard.rgb_config['animation_speed'] = 2 keyboard.debug_enabled = False # ---------------------- Custom Functions -------------------------------------------- BASE = 0 GAMING = 1 FN1 = 2 _______ = KC.TRNS XXXXXXX = KC.NO HOME = KC.MT(KC.HOME, KC.LSFT) END = KC.MT(KC.END, KC.RSFT) LEFT_LAY = KC.LT(FN1, KC.LEFT) SHFT_INS = KC.LSFT(KC.INS) # ---------------------- Keymap --------------------------------------------------------- keyboard.keymap = [ # df [ KC.GESC, KC.N1, KC.N2, KC.N3, KC.N4, KC.N5, KC.N6, KC.N7, KC.N8, KC.N9, KC.N0, KC.LBRC, KC.RBRC, KC.BSPC, KC.LEAD, KC.QUOT, KC.COMM, KC.DOT, KC.P, KC.Y, KC.F, KC.G, KC.C, KC.R, KC.L, KC.SLSH, KC.EQL, KC.BSLS, KC.TAB, KC.A, KC.O, KC.E, KC.U, KC.I, KC.D, KC.H, KC.T, KC.N, KC.S, KC.MINS, KC.ENT, HOME, KC.SCLN, KC.Q, KC.J, KC.K, KC.X, KC.B, KC.M, KC.W, KC.V, KC.Z, END,
# TODO Comment one of these on each side split_side = SplitSide.LEFT split_side = SplitSide.RIGHT split = Split(split_type=SplitType.BLE, split_side=split_side) media = MediaKeys() layers_ext = Layers() keyboard.modules = [layers_ext, split] keyboard.extensions = (media) # Cleaner key names _______ = KC.TRNS XXXXXXX = KC.NO LOWER = KC.MO(1) RAISE = KC.MO(2) ADJUST = KC.MO(3) CALTDEL = KC.LCTL(KC.LALT(KC.DEL)) TSKMGR = KC.LCTL(KC.LSFT(KC.KC_ESC)) keyboard.keymap = [ [ #QWERTY KC.ESC, KC.Q, KC.W, KC.E, KC.R, KC.T, KC.MINS, KC.EQL, KC.Y, KC.U, KC.I, KC.O, KC.P, KC.BSPC,\ KC.TAB, KC.A, KC.S, KC.D, KC.F, KC.G, KC.LBRC, KC.RBRC, KC.H, KC.J, KC.K, KC.L, KC.SCLN, KC.QUOT,\ KC.LSFT, KC.Z, KC.X, KC.C, KC.V, KC.B, KC.SPC, KC.SPC, KC.N, KC.M, KC.COMM, KC.DOT, KC.SLSH, KC.ENT,\ KC.LCTL, KC.LGUI, KC.LALT, ADJUST, LOWER, KC.SPC, KC.SPC, RAISE, KC.LEFT, KC.UP, KC.DOWN, KC.RGHT\ ], [ #LOWER KC.TILD, KC.EXLM, KC.AT, KC.HASH, KC.DLR, KC.PERC, KC.HOME, KC.PGUP, KC.CIRC, KC.AMPR, KC.ASTR, KC.LPRN, KC.RPRN, KC.DEL,\
from kb import KMKKeyboard from kmk.keys import KC from kmk.modules.layers import Layers keyboard = KMKKeyboard() # Cleaner key names _______ = KC.TRNS XXXXXXX = KC.NO layers_ext = Layers() keyboard.modules = [layers_ext] RAISE = KC.MO(1) keyboard.keymap = [ [ #Base KC.N0, KC.N1, KC.N4, KC.N7, KC.ENT, KC.N2, KC.N5, KC.N8, RAISE, KC.N3, KC.N6, KC.N9 ], [ #RAISE _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ] ] if __name__ == '__main__': keyboard.go()
from kb import KMKKeyboard, rgb_pixel_pin from kmk.extensions.ble_split import BLE_Split from kmk.extensions.layers import Layers from kmk.extensions.rgb import RGB from kmk.keys import KC keyboard = KMKKeyboard() # Cleaner key names _______ = KC.TRNS XXXXXXX = KC.NO LOWER = KC.MO(1) RAISE = KC.MO(2) ADJUST = KC.LT(3, KC.SPC) RGB_TOG = KC.RGB_TOG RGB_HUI = KC.RGB_HUI RGB_HUD = KC.RGB_HUI RGB_SAI = KC.RGB_SAI RGB_SAD = KC.RGB_SAD RGB_VAI = KC.RGB_VAI RGB_VAD = KC.RGB_VAD # Adding extensions rgb = RGB(pixel_pin=rgb_pixel_pin, num_pixels=27, val_limit=100, hue_default=190, sat_default=100,
def send_string(message): seq = [] for char in message: kc = KC[char] if char.isupper(): kc = KC.LSHIFT(kc) seq.append(kc) return simple_key_sequence(seq) IBUS_KEY_COMBO = simple_key_sequence((KC.LCTRL(KC.LSHIFT(KC.U)),)) RALT_KEY = simple_key_sequence((KC.RALT,)) U_KEY = simple_key_sequence((KC.U,)) ENTER_KEY = simple_key_sequence((KC.ENTER,)) RALT_DOWN_NO_RELEASE = simple_key_sequence((KC.RALT(no_release=True),)) RALT_UP_NO_PRESS = simple_key_sequence((KC.RALT(no_press=True),)) def compile_unicode_string_sequences(string_table): for k, v in string_table.items(): string_table[k] = unicode_string_sequence(v) return AttrDict(string_table) def unicode_string_sequence(unistring):
keyboard = KMKKeyboard() keyboard.col_pins = (board.GP15, board.GP13, board.GP12) keyboard.row_pins = (board.GP8, board.GP9, board.GP10, board.GP11) keyboard.diode_orientation = DiodeOrientation.COLUMNS keyboard.debug_enabled = True keyboard.enableEncoder = True keyboard.encoders = [encoder(board.GP0, board.GP1), encoder(board.GP2, board.GP3)] keyboard.encoders[0].encMap = [[KC.VOLU, KC.VOLD], [KC.K, KC.J]] keyboard.encoders[1].encMap = [[KC.RIGHT, KC.LEFT], [KC.X, KC.Z]] keyboard.enableOled = True keyboard.oledDisp = oledDisplay.oled(board.GP21, board.GP20, "Hello World") keyboard.keymap = [ [KC.Y, None, KC.Z, KC.A, KC.B, KC.C, KC.D, KC.E, KC.F, KC.G, KC.H, KC.TO(1)], [KC.Y, None, KC.Z, KC.TO(0), KC.R, KC.S, KC.T, KC.U, KC.V, KC.W, KC.X, KC.TO(0)] ] # Onboard Pico LED enable led = digitalio.DigitalInOut(board.GP25) led.direction = digitalio.Direction.OUTPUT led.value = True keyboard.enableSlider = True keyboard.sliders = [slider(board.GP26), slider(board.GP27)] if __name__ == "__main__": keyboard.go()
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.ESC, KC.MT(KC.Z, KC.LCTRL), KC.MT(KC.X, KC.LALT), KC.LT(3, KC.C), KC.LT(4, KC.V), KC.LT(2, KC.BSPC), KC.LT(1, KC.SPC), KC.LT(5, KC.B), KC.MT(KC.N, KC.RALT), KC.MT(KC.M, KC.RCTRL), KC.MT(KC.ENT, KC.RSFT), ], [ KC.N1, KC.N2, KC.N3, KC.N4,
from kmk.boards.nice_nano.crkbd import KMKKeyboard from kmk.keys import KC keyboard = KMKKeyboard() _______ = KC.TRNS XXXXXXX = KC.NO LOWER = KC.MO(3) RAISE = KC.MO(4) ADJUST = KC.MO(5) keyboard.keymap = [ [ #QWERTY KC.TAB, KC.Q, KC.W, KC.E, KC.R, KC.T, KC.Y, KC.U, KC.I, KC.O, KC.P, KC.BSPC,\ KC.LCTL, KC.A, KC.S, KC.D, KC.F, KC.G, KC.H, KC.J, KC.K, KC.L, KC.SCLN, KC.QUOT,\ KC.LSFT, KC.Z, KC.X, KC.C, KC.V, KC.B, KC.N, KC.M, KC.COMM, KC.DOT, KC.SLSH, KC.RSFT,\ KC.LGUI, LOWER, KC.SPC, KC.ENT, RAISE, KC.RALT, ], [ #LOWER KC.ESC, KC.N1, KC.N2, KC.N3, KC.N4, KC.N5, KC.N6, KC.N7, KC.N8, KC.N9, KC.N0, KC.BSPC,\ KC.LCTL, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC.LEFT, KC.DOWN, KC.UP, KC.RIGHT, XXXXXXX, XXXXXXX,\ KC.LSFT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,\ KC.LGUI, LOWER, KC.SPC, KC.ENT, RAISE, KC.RALT, ], [ #RAISE KC.ESC, KC.EXLM, KC.AT, KC.HASH, KC.DLR, KC.PERC, KC.CIRC, KC.AMPR, KC.ASTR, KC.LPRN, KC.RPRN, KC.BSPC,\ KC.LCTL, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC.MINS, KC.EQL, KC.LCBR, KC.RCBR, KC.PIPE, KC.GRV,\ KC.LSFT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC.UNDS, KC.PLUS, KC.LBRC, KC.RBRC, KC.BSLS, KC.TILD,\ KC.LGUI, LOWER, KC.SPC, KC.ENT, RAISE, KC.RALT, ],
def test_basic_kmk_keyboard(self): keyboard = KeyboardTest( [Layers(), ModTap(), OneShot()], [ [ KC.MT(KC.A, KC.LCTL), KC.LT(1, KC.B), KC.C, KC.D, KC.OS(KC.E) ], [KC.N1, KC.N2, KC.N3, KC.N4, KC.N5], ], debug_enabled=False, ) keyboard.test('MT tap behaviour', [(0, True), 100, (0, False)], [{KC.A}, {}]) keyboard.test('MT hold behaviour', [(0, True), 350, (0, False)], [{KC.LCTL}, {}]) # TODO test multiple mods being held # MT keyboard.test( 'MT within tap time sequential -> tap behavior', [(0, True), 100, (0, False), (3, True), (3, False)], [{KC.A}, {}, {KC.D}, {}], ) keyboard.test( 'MT within tap time rolling -> hold behavior', [(0, True), 100, (3, True), 250, (0, False), (3, False)], [{KC.LCTL}, {KC.LCTL, KC.D}, {KC.D}, {}], ) keyboard.test( 'MT within tap time nested -> hold behavior', [(0, True), 100, (3, True), (3, False), 250, (0, False)], [{KC.LCTL}, {KC.LCTL, KC.D}, {KC.LCTL}, {}], ) keyboard.test( 'MT after tap time sequential -> hold behavior', [(0, True), 350, (0, False), (3, True), (3, False)], [{KC.LCTL}, {}, {KC.D}, {}], ) keyboard.test( 'MT after tap time rolling -> hold behavior', [(0, True), 350, (3, True), (0, False), (3, False)], [{KC.LCTL}, {KC.LCTL, KC.D}, {KC.D}, {}], ) keyboard.test( 'MT after tap time nested -> hold behavior', [(0, True), 350, (3, True), (3, False), (0, False)], [{KC.LCTL}, {KC.LCTL, KC.D}, {KC.LCTL}, {}], ) # LT keyboard.test( 'LT within tap time sequential -> tap behavior', [(1, True), 100, (1, False), (3, True), (3, False)], [{KC.B}, {}, {KC.D}, {}], ) keyboard.test( 'LT within tap time rolling -> tap behavior', [(1, True), 100, (3, True), 250, (1, False), (3, False)], [{KC.B}, {KC.B, KC.D}, {KC.D}, {}], ) keyboard.test( 'LT within tap time nested -> tap behavior', [(1, True), 100, (3, True), (3, False), 250, (1, False)], [{KC.B}, {KC.B, KC.D}, {KC.B}, {}], ) keyboard.test( 'LT after tap time sequential -> hold behavior', [(1, True), 350, (1, False), (3, True), (3, False)], [{KC.D}, {}], ) keyboard.test( 'LT after tap time rolling -> hold behavior', [(1, True), 350, (3, True), (1, False), (3, False)], [{KC.N4}, {}], ) keyboard.test( 'LT after tap time nested -> hold behavior', [(1, True), 350, (3, True), (3, False), (1, False)], [{KC.N4}, {}], ) # TODO test TT # OS keyboard.test( 'OS timed out', [(4, True), (4, False), 1050], [{KC.E}, {}], ) keyboard.test( 'OS interrupt within tap time', [(4, True), (4, False), 100, (3, True), (3, False)], [{KC.E}, {KC.D, KC.E}, {}], ) keyboard.test( 'OS hold with multiple interrupt keys', [(4, True), 100, (3, True), (3, False), (2, True), (2, False), (4, False)], [{KC.E}, {KC.D, KC.E}, {KC.E}, {KC.C, KC.E}, {KC.E}, {}], )
rgb_ext = RGB(pixel_pin=keyboard.rgb_pixel_pin, num_pixels=16, val_limit=150, hue_default=0, sat_default=100, val_default=20) keyboard.modules = [layers, media_keys, split] keyboard.extensions = [rgb_ext] # ------------------User level config variables --------------------------------------- keyboard.unicode_mode = UnicodeMode.LINUX keyboard.tap_time = 150 keyboard.debug_enabled = False LOWER = KC.TT(3) UP_HYP = KC.LT(4, KC.MINS) _______ = KC.TRNS XXXXXXX = KC.NO # ---------------------- Keymap --------------------------------------------------------- keyboard.keymap = [ [ # Default KC.GESC, KC.Q, KC.W, KC.E, KC.R, KC.T,
layers_ext = Layers() keyboard.extensions = [media] keyboard.modules = [layers_ext] # Cleaner key names _______ = KC.TRNS XXXXXXX = KC.NO keyboard.keymap = [ [ #Nav Keys KC.INSERT, KC.HOME, KC.PGUP, KC.DELETE, KC.END, KC.PGDOWN, XXXXXXX, KC.UP, XXXXXXX, KC.LEFT, KC.DOWN, KC.RIGHT ], [ #I3 KC.LGUI(KC.L), KC.LGUI(KC.LSHIFT(KC.UP)), KC.LGUI(KC.LSHIFT(KC.P)), KC.LGUI(KC.LSHIFT(KC.LEFT)), KC.LGUI(KC.LSHIFT(KC.DOWN)), KC.LGUI(KC.LSHIFT(KC.RIGHT)), XXXXXXX, KC.LGUI(KC.UP), XXXXXXX, KC.LGUI(KC.LEFT), KC.LGUI(KC.DOWN), KC.LGUI(KC.RIGHT) ], [ #Media keys KC.MUTE, KC.MPLY, KC.MSTP, KC.MRWD, XXXXXXX, KC.MFFD, XXXXXXX, KC.VOLU, XXXXXXX, KC.MPRV, KC.VOLD, KC.MNXT ], ]
rgb_ext = RGB(pixel_pin=keyboard.rgb_pixel_pin, num_pixels=keyboard.rgb_num_pixels) led = LED() layers_ext = Layers() keyboard.extensions = [rgb_ext, led] keyboard.modules = [layers_ext] BASE = 0 FN1 = 1 keyboard.keymap = [ [ KC.GESC, KC.N1, KC.N2, KC.N3, KC.N4, KC.N5, KC.N6, KC.N7, KC.N8, KC.N9, KC.N0, KC.MINS, KC.EQL, KC.BSPC, KC.TAB, KC.Q, KC.W, KC.E, KC.R, KC.T, KC.Y, KC.U, KC.I, KC.O, KC.P, KC.LBRC, KC.RBRC, KC.BSLS, KC.CAPS, KC.A, KC.S, KC.D, KC.F, KC.G, KC.H, KC.J, KC.K, KC.L, KC.SCLN, KC.QUOT, KC.ENT, KC.LSFT, KC.Z, KC.X, KC.C, KC.V, KC.B, KC.N, KC.M, KC.COMM, KC.DOT, KC.SLSH, KC.RSFT, KC.LCTL, KC.LGUI, KC.LALT, KC.SPC, KC.RALT, KC.RGUI, KC.MO(FN1), KC.RCTL, ], [ KC.GESC, KC.F1, KC.F2, KC.F3, KC.F4, KC.F5, KC.F6, KC.F7, KC.F8, KC.F9, KC.F10, KC.F11, KC.F12, KC.BSPC, KC.RGB_TOG, _______, KC.UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC.LEFT, KC.DOWN, KC.RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC.LED_INC, KC.LED_DEC, KC.LED_TOG, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC.GRV, _______, _______, _______, _______, _______, _______, _______, ], ] if __name__ == '__main__': keyboard.go()
) keyboard.leader_mode = LeaderMode.ENTER keyboard.leader_dictionary = { 'hello': send_string('hello world from kmk macros'), 'wpm': WPM, 'atf': emoticons.ANGRY_TABLE_FLIP, 'tf': emoticons.TABLE_FLIP, 'fca': emoticons.FLAG_CA, 'fus': emoticons.FLAG_US, 'cel': emoticons.CELEBRATORY_GLITTER, 'shr': emoticons.SHRUGGIE, 'shre': emoticons.SHRUG_EMOJI, 'poop': emoticons.POOP, 'joy': emoticons.FACE_JOY, 'ls': KC.LGUI(KC.HOME), # Lock screen 'cw': KC.LGUI(KC.END), # Close window 'dbg': KC.DBG, } _______ = KC.TRNS xxxxxxx = KC.NO HELLA_TD = KC.TD( KC.A, KC.B, send_string('macros in a tap dance? I think yes'), KC.TG(1), ) keyboard.keymap = [ [
KC.C, KC.V, KC.B, KC.N, KC.M, KC.COMM, KC.DOT, KC.SLSH, KC.RSFT, KC.LCTL, KC.LGUI, KC.LALT, KC.SPC, KC.RALT, KC.RGUI, KC.MO(FN1), KC.RCTL, ], [ KC.GESC, KC.F1, KC.F2, KC.F3, KC.F4, KC.F5, KC.F6, KC.F7, KC.F8, KC.F9, KC.F10, KC.F11,
# Batreus44 designed by jpconstantineau # https://github.com/jpconstantineau/Batreus44 # Board can use different controllers. # Edit last 2 lines if you have a nRF52840 and want BLE from kb import KMKKeyboard from kmk.hid import HIDModes from kmk.keys import KC from kmk.modules.layers import Layers keyboard = KMKKeyboard() keyboard.modules.append(Layers()) FUN = KC.MO(1) UPPER = KC.MO(2) XXXXXXX = KC.TRNS keyboard.keymap = [ # Colemak Mod-DH See https://colemakmods.github.io/mod-dh/keyboards.html [ KC.Q, KC.W, KC.F, KC.P, KC.B, KC.NO, KC.NO, KC.J, KC.L, KC.U,
WPM = send_string( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Bibendum arcu vitae elementum curabitur vitae nunc sed. Facilisis sed odio morbi quis.' ) keyboard.leader_mode = LeaderMode.TIMEOUT keyboard.leader_dictionary = { 'hello': send_string('hello world from kmk macros'), 'wpm': WPM, 'atf': emoticons.ANGRY_TABLE_FLIP, 'tf': emoticons.TABLE_FLIP, 'fca': emoticons.FLAG_CA, 'fus': emoticons.FLAG_US, 'cel': emoticons.CELEBRATORY_GLITTER, 'shr': emoticons.SHRUGGIE, 'poop': emoticons.POOP, 'ls': KC.LGUI(KC.HOME), 'dbg': KC.DBG, } _______ = KC.TRNS xxxxxxx = KC.NO HELLA_TD = KC.TD( KC.A, KC.B, send_string('macros in a tap dance? I think yes'), KC.TG(1), ) def shrek_is_life(*args, **kwargs): '''
keyboard.rgb_config['val_limit'] = 150 keyboard.rgb_config['hue_step'] = 10 keyboard.rgb_config['sat_step'] = 5 keyboard.rgb_config['val_step'] = 5 keyboard.rgb_config['hue_default'] = 260 keyboard.rgb_config['sat_default'] = 100 keyboard.rgb_config['val_default'] = 20 keyboard.rgb_config['knight_effect_length'] = 4 keyboard.rgb_config['animation_mode'] = 'static' keyboard.rgb_config['animation_speed'] = 1 keyboard.debug_enabled = False _______ = KC.TRNS XXXXXXX = KC.NO SHFT_INS = KC.LSHIFT(KC.INS) BASE = KC.DF(0) LT2_SP = KC.LT(3, KC.SPC) GAMING = KC.DF(1) # ---------------------- Keymap --------------------------------------------------------- keyboard.keymap = [ [ # df KC.GESC, KC.N1, KC.N2, KC.N3, KC.N4, KC.N5, KC.N6, KC.N7, KC.N8, KC.N9, KC.N0, KC.DEL, KC.GRV, KC.QUOTE, KC.COMMA, KC.DOT, KC.P, KC.Y, KC.F, KC.G, KC.C, KC.R, KC.L, KC.BKSP, KC.TAB, KC.A, KC.O, KC.E, KC.U, KC.I, KC.D, KC.H, KC.T, KC.N, KC.S, KC.ENT, KC.LSFT, KC.SCLN, KC.Q, KC.J, KC.K, KC.X, KC.B, KC.M, KC.W, KC.V, KC.Z, KC.SLSH, KC.LCTRL, KC.LGUI, KC.LALT, KC.RGB_TOG, KC.MO(2), LT2_SP, LT2_SP, KC.MO(4), KC.LEFT, KC.DOWN, KC.UP, KC.RIGHT,
'SHRUG_EMOJI': r'🤷', # Emoticons, but fancier 'ANGRY_TABLE_FLIP': r'(ノಠ痊ಠ)ノ彡┻━┻', 'CELEBRATORY_GLITTER': r'+。:.゚ヽ(´∀。)ノ゚.:。+゚゚+。:.゚ヽ(*´∀)ノ゚.:。+゚', 'SHRUGGIE': r'¯\_(ツ)_/¯', 'TABLE_FLIP': r'(╯°□°)╯︵ ┻━┻', }) WPM = send_string('Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Bibendum arcu vitae elementum curabitur vitae nunc sed. Facilisis sed odio morbi quis.') _______ = KC.TRNS xxxxxxx = KC.NO HELLA_TD = KC.TD( KC.A, KC.B, send_string('macros in a tap dance? I think yes'), KC.TG(1), ) keyboard.keymap = [ [ KC.GESC, KC.N1, KC.N2, KC.N3, KC.N4, KC.N5, KC.N6, KC.N7, KC.N8, KC.N9, KC.N0, KC.BSPC, KC.TAB, KC.QUOT, KC.COMM, KC.DOT, KC.P, KC.Y, KC.F, KC.G, KC.C, KC.R, KC.L, KC.SLSH, KC.LGUI, KC.A, KC.O, KC.E, KC.U, KC.I, KC.D, KC.H, KC.T, KC.N, KC.S, KC.ENTER, KC.LCTL, KC.SCLN, KC.Q, KC.J, KC.K, KC.X, KC.MO(2), KC.MO(1), KC.B, KC.M, KC.W, KC.V, KC.Z, KC.LALT, KC.LEFT, KC.RGHT, KC.LSFT, KC.SPC, KC.UP, KC.DOWN, ], [ _______, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, KC.F10, KC.F11, KC.F12, xxxxxxx, xxxxxxx, _______, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, KC.F7, KC.F8, KC.F9, xxxxxxx, xxxxxxx, KC.EQUAL,
keyboard = KMKKeyboard() # TODO Comment one of these on each side split_side = SplitSide.LEFT split_side = SplitSide.RIGHT split = Split(split_type=SplitType.BLE, split_side=split_side) layers_ext = Layers() keyboard.extensions = [layers_ext, split] # Cleaner key names _______ = KC.TRNS XXXXXXX = KC.NO LOWER = KC.MO(2) RAISE = KC.MO(1) KC_Z_SF = KC.LSFT(KC.Z) KC_SLSF = KC.RSFT(KC.SLSH) KC_11SF = KC.LSFT(KC.F11) KC_GRSF = KC.RSFT(KC.GRV) keyboard.keymap = [ [ #QWERTY 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.ENT, KC.Z_SF, KC.X, KC.C, KC.V, KC.B, KC.N, KC.M, KC.COMM, KC.DOT, KC.SLSF, KC.LCTL, KC.LALT, KC.LGUI, LOWER, KC.BSPC, KC.SPC, RAISE, KC.RGUI, KC.APP, KC.RCTL ], [ #RAISE
from kmk.modules.modtap import ModTap keyboard = KMKKeyboard() modtap = ModTap() layers_ext = Layers() led = LED() keyboard.extensions = [led] keyboard.modules = [layers_ext, modtap] # Cleaner key names _______ = KC.TRNS XXXXXXX = KC.NO FN1_SPC = KC.LT(1, KC.SPC) FN2_BSPC = KC.LT(2, KC.BSPC) FN3_C = KC.LT(3, KC.C) FN4_V = KC.LT(4, KC.V) FN5_B = KC.LT(5, KC.B) CTL_Z = KC.CTL_T(KC.Z) ALT_X = KC.ALT(KC.X) ALT_N = KC.ALT(KC.N) CTL_M = KC.CTL(KC.M) SFT_ENT = KC.SFT(KC.ENT) BL_DEC = KC.BL_DEC BL_INC = KC.BL_INC keyboard.keymap = [ [ KC.Q, KC.W, KC.E, KC.R, KC.T, KC.Y, KC.U, KC.I, KC.O, KC.P,
# Default [ KC.GESC, KC.QUOTE, KC.COMMA, KC.DOT, KC.P, KC.Y, KC.F, KC.G, KC.C, KC.R, KC.L, KC.BKSP ], [ KC.TAB, KC.A, KC.O, KC.E, KC.U, KC.I, KC.D, KC.H, KC.T, KC.N, KC.S, KC.ENT ], [ KC.LSFT, KC.SCLN, KC.Q, KC.J, KC.K, KC.X, KC.B, KC.M, KC.W, KC.V, KC.Z, KC.SLSH ], [ KC.LCTRL, KC.LGUI, KC.LALT, KC.LEAD, KC.MO(2), KC.LT(3, KC.SPC), KC.LT(3, KC.SPC), KC.MO(4), KC.LEFT, KC.DOWN, KC.UP, KC.RIGHT ], ], [ # Gaming [ KC.TAB, KC.QUOT, KC.COMM, KC.DOT, KC.P, KC.Y, KC.F, KC.G, KC.C, KC.R, KC.L, KC.BKSP ], [ KC.ESC, KC.A, KC.O, KC.E, KC.U, KC.I, KC.D, KC.H, KC.T, KC.N, KC.S, KC.ENT ],
import board from kb import KMKKeyboard from kmk.handlers.sequences import send_string, simple_key_sequence from kmk.keys import KC from kmk.modules.encoder import EncoderHandler from kmk.modules.layers import Layers # local_increment = None # local_decrement = None keyboard = KMKKeyboard() # custom keys used for encoder actions Zoom_in = KC.LCTRL(KC.EQUAL) Zoom_out = KC.LCTRL(KC.MINUS) # standard filler keys _______ = KC.TRNS XXXXXXX = KC.NO # for use in the encoder extension encoder_map = [ [ ( KC.VOLU, KC.VOLD, 2, ), # Only 1 encoder is being used, so only one tuple per layer is required ],
keyboard.rgb_config['hue_step'] = 10 keyboard.rgb_config['sat_step'] = 5 keyboard.rgb_config['val_step'] = 5 keyboard.rgb_config['hue_default'] = 260 keyboard.rgb_config['sat_default'] = 100 keyboard.rgb_config['val_default'] = 0 keyboard.rgb_config['knight_effect_length'] = 6 keyboard.rgb_config['animation_mode'] = 'static' keyboard.rgb_config['animation_speed'] = 2 keyboard.debug_enabled = False # ---------------------- Custom Functions -------------------------------------------- _______ = KC.TRNS XXXXXXX = KC.NO HOME = KC.MT(KC.HOME, KC.LSFT) END = KC.MT(KC.END, KC.RSFT) BASE = 0 GAMING = 1 FN1 = 2 # ---------------------- Keymap --------------------------------------------------------- keyboard.keymap = [ # df [ KC.GESC, KC.N1, KC.N2, KC.N3,