From 109c4395a86c72fb34f820c633a1679590dc8fdb Mon Sep 17 00:00:00 2001 From: Sébastien Dailly Date: Sun, 11 Aug 2024 16:43:29 +0200 Subject: Initial commit --- code.py | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 code.py (limited to 'code.py') diff --git a/code.py b/code.py new file mode 100644 index 0000000..e799760 --- /dev/null +++ b/code.py @@ -0,0 +1,49 @@ +import board + +from supervisor import runtime +# Do not reload the application when the files are changed +runtime.autoreload = False + +# Initialize the BEPO layout +import kmk.handlers.stock as handlers +#from kmk.key_validators import key_seq_sleep_validator +from kmk import keys +keys.KC.clear() +keys.KEY_GENERATORS=( + #keys.maybe_make_argumented_key( + # key_seq_sleep_validator, + # ('MACRO_SLEEP_MS', 'SLEEP_IN_SEQ'), + # on_press=handlers.sleep_pressed, + #), + keys.maybe_make_no_key, + ) +KC=keys.KC +import kmk_frnb + +from kmk.kmk_keyboard import KMKKeyboard +keyboard = KMKKeyboard() + +import layout +layout.set_keyboard(keyboard) + +import oled +oled.main(keyboard) + +import json_layer +def load_json(file): + + with open("ff.json", "r") as ff_conf: + s = ff_conf.read() + layer = json_layer.Layer(s) + return layer + +from kmk.modules.macros import Macros +keyboard.modules = [Macros(), json_layer.JsonLayer()] +firefox = load_json("ff.json") + +keyboard.keymap = [ + firefox +] + +if __name__ == '__main__': + keyboard.go() -- cgit v1.2.3