Everything necessary to get this to boot finally. Planck types!
This commit is contained in:
parent
39a6465658
commit
57239e3163
14
Makefile
14
Makefile
@ -15,7 +15,7 @@ AMPY_DELAY ?= 1.5
|
|||||||
ARDUINO ?= /usr/share/arduino
|
ARDUINO ?= /usr/share/arduino
|
||||||
PIPENV ?= $(shell which pipenv)
|
PIPENV ?= $(shell which pipenv)
|
||||||
|
|
||||||
all: copy-kmk copy-keymap
|
all: copy-kmk copy-bootpy copy-keymap
|
||||||
|
|
||||||
.docker_base: Dockerfile_base
|
.docker_base: Dockerfile_base
|
||||||
@echo "===> Building Docker base image kmkfw/base:${DOCKER_BASE_TAG}"
|
@echo "===> Building Docker base image kmkfw/base:${DOCKER_BASE_TAG}"
|
||||||
@ -78,6 +78,18 @@ copy-kmk:
|
|||||||
echo "**** MOUNTPOINT must be defined (wherever your CIRCUITPY drive is mounted) ****" && exit 1
|
echo "**** MOUNTPOINT must be defined (wherever your CIRCUITPY drive is mounted) ****" && exit 1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifdef MOUNTPOINT
|
||||||
|
$(MOUNTPOINT)/kmk/boot.py: boot.py
|
||||||
|
@echo "===> Copying required boot.py"
|
||||||
|
@rsync -rh boot.py $(MOUNTPOINT)/
|
||||||
|
@sync
|
||||||
|
|
||||||
|
copy-bootpy: $(MOUNTPOINT)/kmk/boot.py
|
||||||
|
else
|
||||||
|
copy-bootpy:
|
||||||
|
echo "**** MOUNTPOINT must be defined (wherever your CIRCUITPY drive is mounted) ****" && exit 1
|
||||||
|
endif
|
||||||
|
|
||||||
ifdef MOUNTPOINT
|
ifdef MOUNTPOINT
|
||||||
ifndef USER_KEYMAP
|
ifndef USER_KEYMAP
|
||||||
$(MOUNTPOINT)/main.py:
|
$(MOUNTPOINT)/main.py:
|
||||||
|
3
boot.py
Executable file
3
boot.py
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
import supervisor
|
||||||
|
|
||||||
|
supervisor.set_next_stack_limit(4096 + 1024)
|
@ -20,6 +20,11 @@ import collections # isort:skip
|
|||||||
import kmk.consts # isort:skip
|
import kmk.consts # isort:skip
|
||||||
import kmk.kmktime # isort:skip
|
import kmk.kmktime # isort:skip
|
||||||
import kmk.types # isort:skip
|
import kmk.types # isort:skip
|
||||||
|
import kmk.util # isort:skip
|
||||||
|
|
||||||
|
# Now handlers that will be used in keycodes later
|
||||||
|
import kmk.handlers.layers
|
||||||
|
import kmk.handlers.stock
|
||||||
|
|
||||||
# Now stuff that depends on the above (and so on)
|
# Now stuff that depends on the above (and so on)
|
||||||
import kmk.keycodes # isort:skip
|
import kmk.keycodes # isort:skip
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
from kmk.keycodes import ALL_KEYS, KC, make_key
|
from kmk.keycodes import KC, make_key
|
||||||
|
from kmk.handlers.stock import passthrough
|
||||||
from kmk.types import KeySequenceMeta
|
from kmk.types import KeySequenceMeta
|
||||||
|
|
||||||
|
|
||||||
@ -23,6 +24,7 @@ def simple_key_sequence(seq):
|
|||||||
return make_key(
|
return make_key(
|
||||||
meta=KeySequenceMeta(seq),
|
meta=KeySequenceMeta(seq),
|
||||||
on_press=sequence_press_handler,
|
on_press=sequence_press_handler,
|
||||||
|
on_release=passthrough,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -30,7 +32,7 @@ def send_string(message):
|
|||||||
seq = []
|
seq = []
|
||||||
|
|
||||||
for char in message:
|
for char in message:
|
||||||
kc = ALL_KEYS[char]
|
kc = KC[char]
|
||||||
|
|
||||||
if char.isupper():
|
if char.isupper():
|
||||||
kc = KC.LSHIFT(kc)
|
kc = KC.LSHIFT(kc)
|
||||||
|
@ -7,19 +7,22 @@ def passthrough(key, state, *args, **kwargs):
|
|||||||
|
|
||||||
|
|
||||||
def default_pressed(key, state, KC, coord_int=None, coord_raw=None):
|
def default_pressed(key, state, KC, coord_int=None, coord_raw=None):
|
||||||
|
state.hid_pending = True
|
||||||
|
|
||||||
if coord_int is not None:
|
if coord_int is not None:
|
||||||
state.coord_keys_pressed[coord_int] = key
|
state.coord_keys_pressed[coord_int] = key
|
||||||
|
|
||||||
state.add_key(key)
|
state.keys_pressed.add(key)
|
||||||
|
|
||||||
return state
|
return state
|
||||||
|
|
||||||
|
|
||||||
def default_released(key, state, KC, coord_int=None, coord_raw=None):
|
def default_released(key, state, KC, coord_int=None, coord_raw=None):
|
||||||
state.remove_key(key)
|
state.hid_pending = True
|
||||||
|
state.keys_pressed.discard(key)
|
||||||
|
|
||||||
if coord_int is not None:
|
if coord_int is not None:
|
||||||
state.keys_pressed.discard(key.coord_keys_pressed.get(coord_int, None))
|
state.keys_pressed.discard(state.coord_keys_pressed.get(coord_int, None))
|
||||||
state.coord_keys_pressed[coord_int] = None
|
state.coord_keys_pressed[coord_int] = None
|
||||||
|
|
||||||
return state
|
return state
|
||||||
@ -81,9 +84,9 @@ def leader_pressed(key, state, *args, **kwargs):
|
|||||||
return state._begin_leader_mode()
|
return state._begin_leader_mode()
|
||||||
|
|
||||||
|
|
||||||
def tap_dance_pressed(key, state, *args, **kwargs):
|
def td_pressed(key, state, *args, **kwargs):
|
||||||
return state._process_tap_dance(key, True)
|
return state._process_tap_dance(key, True)
|
||||||
|
|
||||||
|
|
||||||
def tap_dance_released(key, state, *args, **kwargs):
|
def td_released(key, state, *args, **kwargs):
|
||||||
return state._process_tap_dance(key, False)
|
return state._process_tap_dance(key, False)
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
import gc
|
||||||
|
|
||||||
import kmk.handlers.layers as layers
|
import kmk.handlers.layers as layers
|
||||||
import kmk.handlers.stock as handlers
|
import kmk.handlers.stock as handlers
|
||||||
from kmk.consts import UnicodeMode
|
from kmk.consts import UnicodeMode
|
||||||
@ -13,8 +15,7 @@ KEYCODE_CONSUMER = 2
|
|||||||
|
|
||||||
# Global state, will be filled in througout this file, and
|
# Global state, will be filled in througout this file, and
|
||||||
# anywhere the user creates custom keys
|
# anywhere the user creates custom keys
|
||||||
ALL_KEYS = {}
|
KC = AttrDict()
|
||||||
KC = AttrDict(ALL_KEYS)
|
|
||||||
|
|
||||||
|
|
||||||
def generate_leader_dictionary_seq(string):
|
def generate_leader_dictionary_seq(string):
|
||||||
@ -134,11 +135,11 @@ def register_key_names(key, names=tuple()): # NOQA
|
|||||||
'''
|
'''
|
||||||
|
|
||||||
for name in names:
|
for name in names:
|
||||||
ALL_KEYS[name] = key
|
KC[name] = key
|
||||||
|
|
||||||
if len(name) == 1:
|
if len(name) == 1:
|
||||||
ALL_KEYS[name.upper()] = key
|
KC[name.upper()] = key
|
||||||
ALL_KEYS[name.lower()] = key
|
KC[name.lower()] = key
|
||||||
|
|
||||||
return key
|
return key
|
||||||
|
|
||||||
@ -193,7 +194,7 @@ def make_mod_key(*args, **kwargs):
|
|||||||
|
|
||||||
|
|
||||||
def make_shifted_key(target_name, names=tuple()): # NOQA
|
def make_shifted_key(target_name, names=tuple()): # NOQA
|
||||||
key = KC.LSFT(ALL_KEYS[target_name])
|
key = KC.LSFT(KC[target_name])
|
||||||
|
|
||||||
register_key_names(key, names)
|
register_key_names(key, names)
|
||||||
|
|
||||||
@ -208,18 +209,29 @@ def make_consumer_key(*args, **kwargs):
|
|||||||
# is almost certainly the best plan here
|
# is almost certainly the best plan here
|
||||||
def make_argumented_key(
|
def make_argumented_key(
|
||||||
validator=lambda *validator_args, **validator_kwargs: object(),
|
validator=lambda *validator_args, **validator_kwargs: object(),
|
||||||
|
names=tuple(), # NOQA
|
||||||
*constructor_args,
|
*constructor_args,
|
||||||
**constructor_kwargs,
|
**constructor_kwargs,
|
||||||
):
|
):
|
||||||
|
global NEXT_AVAILABLE_KEYCODE
|
||||||
|
|
||||||
def _argumented_key(*user_args, **user_kwargs):
|
def _argumented_key(*user_args, **user_kwargs):
|
||||||
|
global NEXT_AVAILABLE_KEYCODE
|
||||||
|
|
||||||
meta = validator(*user_args, **user_kwargs)
|
meta = validator(*user_args, **user_kwargs)
|
||||||
|
|
||||||
if meta:
|
if meta:
|
||||||
return Keycode(
|
key = Keycode(
|
||||||
|
NEXT_AVAILABLE_KEYCODE,
|
||||||
meta=meta,
|
meta=meta,
|
||||||
*constructor_args,
|
*constructor_args,
|
||||||
**constructor_kwargs,
|
**constructor_kwargs,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
NEXT_AVAILABLE_KEYCODE += 1
|
||||||
|
|
||||||
|
return key
|
||||||
|
|
||||||
else:
|
else:
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
'Argumented key validator failed for unknown reasons. '
|
'Argumented key validator failed for unknown reasons. '
|
||||||
@ -227,6 +239,13 @@ def make_argumented_key(
|
|||||||
'should have been raised.',
|
'should have been raised.',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
for name in names:
|
||||||
|
KC[name] = _argumented_key
|
||||||
|
|
||||||
|
return _argumented_key
|
||||||
|
|
||||||
|
|
||||||
|
gc.collect()
|
||||||
|
|
||||||
# Modifiers
|
# Modifiers
|
||||||
make_mod_key(code=0x01, names=('LEFT_CONTROL', 'LCTRL', 'LCTL'))
|
make_mod_key(code=0x01, names=('LEFT_CONTROL', 'LCTRL', 'LCTL'))
|
||||||
@ -242,6 +261,8 @@ make_mod_key(code=0x07, names=('MEH',))
|
|||||||
# HYPR = LCTL | LALT | LSFT | LGUI
|
# HYPR = LCTL | LALT | LSFT | LGUI
|
||||||
make_mod_key(code=0x0F, names=('HYPER', 'HYPR'))
|
make_mod_key(code=0x0F, names=('HYPER', 'HYPR'))
|
||||||
|
|
||||||
|
gc.collect()
|
||||||
|
|
||||||
# Basic ASCII letters
|
# Basic ASCII letters
|
||||||
make_key(code=4, names=('A',))
|
make_key(code=4, names=('A',))
|
||||||
make_key(code=5, names=('B',))
|
make_key(code=5, names=('B',))
|
||||||
@ -270,6 +291,8 @@ make_key(code=27, names=('X',))
|
|||||||
make_key(code=28, names=('Y',))
|
make_key(code=28, names=('Y',))
|
||||||
make_key(code=29, names=('Z',))
|
make_key(code=29, names=('Z',))
|
||||||
|
|
||||||
|
gc.collect()
|
||||||
|
|
||||||
# Numbers
|
# Numbers
|
||||||
# Aliases to play nicely with AttrDict, since KC.1 isn't a valid
|
# Aliases to play nicely with AttrDict, since KC.1 isn't a valid
|
||||||
# attribute key in Python, but KC.N1 is
|
# attribute key in Python, but KC.N1 is
|
||||||
@ -284,6 +307,8 @@ make_key(code=37, names=('8', 'N8'))
|
|||||||
make_key(code=38, names=('9', 'N9'))
|
make_key(code=38, names=('9', 'N9'))
|
||||||
make_key(code=39, names=('0', 'N0'))
|
make_key(code=39, names=('0', 'N0'))
|
||||||
|
|
||||||
|
gc.collect()
|
||||||
|
|
||||||
# More ASCII standard keys
|
# More ASCII standard keys
|
||||||
make_key(code=40, names=('ENTER', 'ENT', "\n"))
|
make_key(code=40, names=('ENTER', 'ENT', "\n"))
|
||||||
make_key(code=41, names=('ESCAPE', 'ESC'))
|
make_key(code=41, names=('ESCAPE', 'ESC'))
|
||||||
@ -302,6 +327,8 @@ make_key(code=54, names=('COMMA', 'COMM', ','))
|
|||||||
make_key(code=55, names=('DOT', '.'))
|
make_key(code=55, names=('DOT', '.'))
|
||||||
make_key(code=56, names=('SLASH', 'SLSH'))
|
make_key(code=56, names=('SLASH', 'SLSH'))
|
||||||
|
|
||||||
|
gc.collect()
|
||||||
|
|
||||||
# Function Keys
|
# Function Keys
|
||||||
make_key(code=58, names=('F1',))
|
make_key(code=58, names=('F1',))
|
||||||
make_key(code=59, names=('F2',))
|
make_key(code=59, names=('F2',))
|
||||||
@ -313,8 +340,8 @@ make_key(code=64, names=('F7',))
|
|||||||
make_key(code=65, names=('F8',))
|
make_key(code=65, names=('F8',))
|
||||||
make_key(code=66, names=('F9',))
|
make_key(code=66, names=('F9',))
|
||||||
make_key(code=67, names=('F10',))
|
make_key(code=67, names=('F10',))
|
||||||
make_key(code=68, names=('F10',))
|
make_key(code=68, names=('F11',))
|
||||||
make_key(code=69, names=('F10',))
|
make_key(code=69, names=('F12',))
|
||||||
make_key(code=104, names=('F13',))
|
make_key(code=104, names=('F13',))
|
||||||
make_key(code=105, names=('F14',))
|
make_key(code=105, names=('F14',))
|
||||||
make_key(code=106, names=('F15',))
|
make_key(code=106, names=('F15',))
|
||||||
@ -328,6 +355,8 @@ make_key(code=113, names=('F22',))
|
|||||||
make_key(code=114, names=('F23',))
|
make_key(code=114, names=('F23',))
|
||||||
make_key(code=115, names=('F24',))
|
make_key(code=115, names=('F24',))
|
||||||
|
|
||||||
|
gc.collect()
|
||||||
|
|
||||||
# Lock Keys, Navigation, etc.
|
# Lock Keys, Navigation, etc.
|
||||||
make_key(code=57, names=('CAPS_LOCK', 'CAPSLOCK', 'CLCK', 'CAPS'))
|
make_key(code=57, names=('CAPS_LOCK', 'CAPSLOCK', 'CLCK', 'CAPS'))
|
||||||
# FIXME: Investigate whether this key actually works, and
|
# FIXME: Investigate whether this key actually works, and
|
||||||
@ -350,6 +379,8 @@ make_key(code=80, names=('LEFT',))
|
|||||||
make_key(code=81, names=('DOWN',))
|
make_key(code=81, names=('DOWN',))
|
||||||
make_key(code=82, names=('UP',))
|
make_key(code=82, names=('UP',))
|
||||||
|
|
||||||
|
gc.collect()
|
||||||
|
|
||||||
# Numpad
|
# Numpad
|
||||||
make_key(code=83, names=('NUM_LOCK', 'NUMLOCK', 'NLCK'))
|
make_key(code=83, names=('NUM_LOCK', 'NUMLOCK', 'NLCK'))
|
||||||
# FIXME: Investigate whether this key actually works, and
|
# FIXME: Investigate whether this key actually works, and
|
||||||
@ -375,6 +406,8 @@ make_key(code=103, names=('KP_EQUAL', 'PEQL', 'NUMPAD_EQUAL'))
|
|||||||
make_key(code=133, names=('KP_COMMA', 'PCMM', 'NUMPAD_COMMA'))
|
make_key(code=133, names=('KP_COMMA', 'PCMM', 'NUMPAD_COMMA'))
|
||||||
make_key(code=134, names=('KP_EQUAL_AS400', 'NUMPAD_EQUAL_AS400'))
|
make_key(code=134, names=('KP_EQUAL_AS400', 'NUMPAD_EQUAL_AS400'))
|
||||||
|
|
||||||
|
gc.collect()
|
||||||
|
|
||||||
# Making life better for folks on tiny keyboards especially: exposes
|
# Making life better for folks on tiny keyboards especially: exposes
|
||||||
# the "shifted" keys as raw keys. Under the hood we're still
|
# the "shifted" keys as raw keys. Under the hood we're still
|
||||||
# sending Shift+(whatever key is normally pressed) to get these, so
|
# sending Shift+(whatever key is normally pressed) to get these, so
|
||||||
@ -401,6 +434,8 @@ make_shifted_key('COMMA', names=('LEFT_ANGLE_BRACKET', 'LABK', '<'))
|
|||||||
make_shifted_key('DOT', names=('RIGHT_ANGLE_BRACKET', 'RABK', '>'))
|
make_shifted_key('DOT', names=('RIGHT_ANGLE_BRACKET', 'RABK', '>'))
|
||||||
make_shifted_key('SLSH', names=('QUESTION', 'QUES', '?'))
|
make_shifted_key('SLSH', names=('QUESTION', 'QUES', '?'))
|
||||||
|
|
||||||
|
gc.collect()
|
||||||
|
|
||||||
# International
|
# International
|
||||||
make_key(code=50, names=('NONUS_HASH', 'NUHS'))
|
make_key(code=50, names=('NONUS_HASH', 'NUHS'))
|
||||||
make_key(code=100, names=('NONUS_BSLASH', 'NUBS'))
|
make_key(code=100, names=('NONUS_BSLASH', 'NUBS'))
|
||||||
@ -424,6 +459,8 @@ make_key(code=150, names=('LANG7',))
|
|||||||
make_key(code=151, names=('LANG8',))
|
make_key(code=151, names=('LANG8',))
|
||||||
make_key(code=152, names=('LANG9',))
|
make_key(code=152, names=('LANG9',))
|
||||||
|
|
||||||
|
gc.collect()
|
||||||
|
|
||||||
# Consumer ("media") keys. Most known keys aren't supported here. A much
|
# Consumer ("media") keys. Most known keys aren't supported here. A much
|
||||||
# longer list used to exist in this file, but the codes were almost certainly
|
# longer list used to exist in this file, but the codes were almost certainly
|
||||||
# incorrect, conflicting with each other, or otherwise "weird". We'll add them
|
# incorrect, conflicting with each other, or otherwise "weird". We'll add them
|
||||||
@ -445,6 +482,8 @@ make_consumer_key(code=184, names=('MEDIA_EJECT', 'EJCT')) # 0xB8
|
|||||||
make_consumer_key(code=179, names=('MEDIA_FAST_FORWARD', 'MFFD')) # 0xB3
|
make_consumer_key(code=179, names=('MEDIA_FAST_FORWARD', 'MFFD')) # 0xB3
|
||||||
make_consumer_key(code=180, names=('MEDIA_REWIND', 'MRWD')) # 0xB4
|
make_consumer_key(code=180, names=('MEDIA_REWIND', 'MRWD')) # 0xB4
|
||||||
|
|
||||||
|
gc.collect()
|
||||||
|
|
||||||
# Internal, diagnostic, or auxiliary/enhanced keys
|
# Internal, diagnostic, or auxiliary/enhanced keys
|
||||||
|
|
||||||
# NO and TRNS are functionally identical in how they (don't) mutate
|
# NO and TRNS are functionally identical in how they (don't) mutate
|
||||||
@ -465,7 +504,7 @@ make_key(names=('GESC',), on_press=handlers.gesc_pressed, on_release=handlers.ge
|
|||||||
make_key(
|
make_key(
|
||||||
names=('LEADER', 'LEAD'),
|
names=('LEADER', 'LEAD'),
|
||||||
on_press=handlers.leader_pressed,
|
on_press=handlers.leader_pressed,
|
||||||
on_release=handlers.leader_released,
|
on_release=handlers.passthrough,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -491,7 +530,7 @@ make_argumented_key(
|
|||||||
validator=layer_key_validator,
|
validator=layer_key_validator,
|
||||||
names=('DF',),
|
names=('DF',),
|
||||||
on_press=layers.df_pressed,
|
on_press=layers.df_pressed,
|
||||||
on_release=layers.df_released,
|
on_release=handlers.passthrough,
|
||||||
)
|
)
|
||||||
make_argumented_key(
|
make_argumented_key(
|
||||||
validator=layer_key_validator,
|
validator=layer_key_validator,
|
||||||
@ -509,13 +548,13 @@ make_argumented_key(
|
|||||||
validator=layer_key_validator,
|
validator=layer_key_validator,
|
||||||
names=('TG',),
|
names=('TG',),
|
||||||
on_press=layers.tg_pressed,
|
on_press=layers.tg_pressed,
|
||||||
on_release=layers.tg_released,
|
on_release=handlers.passthrough,
|
||||||
)
|
)
|
||||||
make_argumented_key(
|
make_argumented_key(
|
||||||
validator=layer_key_validator,
|
validator=layer_key_validator,
|
||||||
names=('TO',),
|
names=('TO',),
|
||||||
on_press=layers.to_pressed,
|
on_press=layers.to_pressed,
|
||||||
on_release=layers.to_released,
|
on_release=handlers.passthrough,
|
||||||
)
|
)
|
||||||
make_argumented_key(
|
make_argumented_key(
|
||||||
validator=layer_key_validator,
|
validator=layer_key_validator,
|
||||||
@ -525,6 +564,9 @@ make_argumented_key(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
gc.collect()
|
||||||
|
|
||||||
|
|
||||||
def key_seq_sleep_validator(ms):
|
def key_seq_sleep_validator(ms):
|
||||||
return KeySeqSleepMeta(ms)
|
return KeySeqSleepMeta(ms)
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
from kmk.consts import UnicodeMode
|
from kmk.consts import UnicodeMode
|
||||||
from kmk.keycodes import ALL_KEYS, KC, Macro
|
from kmk.keycodes import KC, Macro
|
||||||
from kmk.macros.simple import simple_key_sequence
|
from kmk.macros.simple import simple_key_sequence
|
||||||
from kmk.types import AttrDict
|
from kmk.types import AttrDict
|
||||||
from kmk.util import get_wide_ordinal
|
from kmk.util import get_wide_ordinal
|
||||||
@ -45,7 +45,7 @@ def generate_codepoint_keysym_seq(codepoint, expected_length=4):
|
|||||||
seq = [KC.N0 for _ in range(max(len(codepoint), expected_length))]
|
seq = [KC.N0 for _ in range(max(len(codepoint), expected_length))]
|
||||||
|
|
||||||
for idx, codepoint_fragment in enumerate(reversed(codepoint)):
|
for idx, codepoint_fragment in enumerate(reversed(codepoint)):
|
||||||
seq[-(idx + 1)] = ALL_KEYS.get(codepoint_fragment)
|
seq[-(idx + 1)] = KC.get(codepoint_fragment)
|
||||||
|
|
||||||
return seq
|
return seq
|
||||||
|
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
from kmk.firmware import Firmware as _Firmware
|
from kmk.firmware import Firmware as _Firmware
|
||||||
from kmk.hid import CircuitPythonUSB_HID
|
from kmk.hid import CircuitPythonUSB_HID
|
||||||
|
|
||||||
|
import kmk.keycodes
|
||||||
|
|
||||||
|
|
||||||
class Firmware(_Firmware):
|
class Firmware(_Firmware):
|
||||||
hid_helper = CircuitPythonUSB_HID
|
hid_helper = CircuitPythonUSB_HID
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
from kmk.boards.klarank import Firmware
|
from kmk.boards.klarank import Firmware
|
||||||
from kmk.consts import LeaderMode, UnicodeMode
|
from kmk.consts import LeaderMode, UnicodeMode
|
||||||
from kmk.keycodes import KC
|
from kmk.keycodes import KC
|
||||||
from kmk.keycodes import generate_leader_dictionary_seq as glds
|
|
||||||
from kmk.macros.simple import send_string
|
# from kmk.keycodes import generate_leader_dictionary_seq as glds
|
||||||
from kmk.macros.unicode import compile_unicode_string_sequences as cuss
|
# from kmk.macros.simple import send_string
|
||||||
|
# from kmk.macros.unicode import compile_unicode_string_sequences as cuss
|
||||||
|
|
||||||
keyboard = Firmware()
|
keyboard = Firmware()
|
||||||
|
|
||||||
@ -11,55 +12,55 @@ keyboard.debug_enabled = True
|
|||||||
keyboard.unicode_mode = UnicodeMode.LINUX
|
keyboard.unicode_mode = UnicodeMode.LINUX
|
||||||
keyboard.tap_time = 750
|
keyboard.tap_time = 750
|
||||||
|
|
||||||
emoticons = cuss({
|
# emoticons = cuss({
|
||||||
# Emojis
|
# # Emojis
|
||||||
'BEER': r'🍺',
|
# 'BEER': r'🍺',
|
||||||
'BEER_TOAST': r'🍻',
|
# 'BEER_TOAST': r'🍻',
|
||||||
'FACE_CUTE_SMILE': r'😊',
|
# 'FACE_CUTE_SMILE': r'😊',
|
||||||
'FACE_HEART_EYES': r'😍',
|
# 'FACE_HEART_EYES': r'😍',
|
||||||
'FACE_JOY': r'😂',
|
# 'FACE_JOY': r'😂',
|
||||||
'FACE_SWEAT_SMILE': r'😅',
|
# 'FACE_SWEAT_SMILE': r'😅',
|
||||||
'FACE_THINKING': r'🤔',
|
# 'FACE_THINKING': r'🤔',
|
||||||
'FIRE': r'🔥',
|
# 'FIRE': r'🔥',
|
||||||
'FLAG_CA': r'🇨🇦',
|
# 'FLAG_CA': r'🇨🇦',
|
||||||
'FLAG_US': r'🇺🇸',
|
# 'FLAG_US': r'🇺🇸',
|
||||||
'HAND_CLAP': r'👏',
|
# 'HAND_CLAP': r'👏',
|
||||||
'HAND_HORNS': r'🤘',
|
# 'HAND_HORNS': r'🤘',
|
||||||
'HAND_OK': r'👌',
|
# 'HAND_OK': r'👌',
|
||||||
'HAND_THUMB_DOWN': r'👎',
|
# 'HAND_THUMB_DOWN': r'👎',
|
||||||
'HAND_THUMB_UP': r'👍',
|
# 'HAND_THUMB_UP': r'👍',
|
||||||
'HAND_WAVE': r'👋',
|
# 'HAND_WAVE': r'👋',
|
||||||
'HEART': r'❤️',
|
# 'HEART': r'❤️',
|
||||||
'MAPLE_LEAF': r'🍁',
|
# 'MAPLE_LEAF': r'🍁',
|
||||||
'POOP': r'💩',
|
# 'POOP': r'💩',
|
||||||
'TADA': r'🎉',
|
# 'TADA': r'🎉',
|
||||||
|
#
|
||||||
|
# # Emoticons, but fancier
|
||||||
|
# 'ANGRY_TABLE_FLIP': r'(ノಠ痊ಠ)ノ彡┻━┻',
|
||||||
|
# 'CELEBRATORY_GLITTER': r'+。:.゚ヽ(´∀。)ノ゚.:。+゚゚+。:.゚ヽ(*´∀)ノ゚.:。+゚',
|
||||||
|
# 'SHRUGGIE': r'¯\_(ツ)_/¯',
|
||||||
|
# 'TABLE_FLIP': r'(╯°□°)╯︵ ┻━┻',
|
||||||
|
# })
|
||||||
|
|
||||||
# Emoticons, but fancier
|
# 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.")
|
||||||
'ANGRY_TABLE_FLIP': r'(ノಠ痊ಠ)ノ彡┻━┻',
|
#
|
||||||
'CELEBRATORY_GLITTER': r'+。:.゚ヽ(´∀。)ノ゚.:。+゚゚+。:.゚ヽ(*´∀)ノ゚.:。+゚',
|
# keyboard.leader_mode = LeaderMode.TIMEOUT
|
||||||
'SHRUGGIE': r'¯\_(ツ)_/¯',
|
# keyboard.leader_dictionary = {
|
||||||
'TABLE_FLIP': r'(╯°□°)╯︵ ┻━┻',
|
# glds('hello'): send_string('hello world from kmk macros'),
|
||||||
})
|
# glds('wpm'): WPM,
|
||||||
|
# glds('atf'): emoticons.ANGRY_TABLE_FLIP,
|
||||||
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.")
|
# glds('tf'): emoticons.TABLE_FLIP,
|
||||||
|
# glds('fca'): emoticons.FLAG_CA,
|
||||||
keyboard.leader_mode = LeaderMode.TIMEOUT
|
# glds('fus'): emoticons.FLAG_US,
|
||||||
keyboard.leader_dictionary = {
|
# glds('cel'): emoticons.CELEBRATORY_GLITTER,
|
||||||
glds('hello'): send_string('hello world from kmk macros'),
|
# }
|
||||||
glds('wpm'): WPM,
|
|
||||||
glds('atf'): emoticons.ANGRY_TABLE_FLIP,
|
|
||||||
glds('tf'): emoticons.TABLE_FLIP,
|
|
||||||
glds('fca'): emoticons.FLAG_CA,
|
|
||||||
glds('fus'): emoticons.FLAG_US,
|
|
||||||
glds('cel'): emoticons.CELEBRATORY_GLITTER,
|
|
||||||
}
|
|
||||||
|
|
||||||
_______ = KC.TRNS
|
_______ = KC.TRNS
|
||||||
xxxxxxx = KC.NO
|
xxxxxxx = KC.NO
|
||||||
HELLA_TD = KC.TD(
|
HELLA_TD = KC.TD(
|
||||||
KC.A,
|
KC.A,
|
||||||
KC.B,
|
KC.B,
|
||||||
send_string('macros in a tap dance? I think yes'),
|
# send_string('macros in a tap dance? I think yes'),
|
||||||
KC.TG(1),
|
KC.TG(1),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user