blob: a738543aa29aa4fd3f670af1f22afe6b970cabe8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
import board
from supervisor import runtime
import json
from serial_conn import Client
import oled
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 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)
oled.main(keyboard)
import json_layer
def load_json(file):
with open(file, "r") as conf:
file_data = conf.read()
key_layer = json_layer.Layer()
json_data = json.loads(file_data.strip())
key_layer.load(json_data)
return key_layer
from kmk.modules.macros import Macros
from kmk.modules.mouse_keys import MouseKeys
# Create the first layer in the keyboard. The object will be reused later when
# receiving commands from the serial connection.
layer = load_json("ff.json")
keyboard.keymap = [
layer
]
keyboard.modules = [
Macros(),
Client(),
MouseKeys(),
]
if __name__ == '__main__':
keyboard.go()
|