-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkeymap_tallcan.py
More file actions
86 lines (73 loc) · 2.9 KB
/
Copy pathkeymap_tallcan.py
File metadata and controls
86 lines (73 loc) · 2.9 KB
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
'''This is a pico_keeb keyboard layout for the "tallcan" handheld
computer.
p i i p
i n n i
n d d n
k e e k
y x x y
a b c d e f g h - furthest finger row
i j k l m n o p - nearest finger row
q r u v s t - thumbs buttons around joystick/wheel clickers
'''
# Map pin numbers to physical key locations
_LAYOUT = bytes((12, 13, 14, 15, 10, 9, 8, 7,
17, 18, 19, 20, 5, 4, 3, 2,
21, 16, 1, 0, 11, 6))
# Special key combinations outside keymap.
# exit_keys will halt micropython script and return to repl
EXIT_KEYS = bytes((12, 13, 14, 15, 10, 9, 8, 7))
# shutdown_keys will signal the device to power down.
SHUTDOWN_KEYS = bytes((12, 13, 14, 15, 17, 18, 19, 20))
_GAME_LAYER = 5
# Chords are tbd
_CHORDS = {
# A
'B': ('E', 'O'),
'C': ('E', 'Y'),
'D': ('A', 'R', 'T'),
# E
'F': ('A', 'R'),
'G': ('R', 'T'),
}
_KEYMAP = (
# 0 - Base Layer
('S', 'T', 'R', 'A', 'A', 'R', 'T', 'S',
'O', 'I', 'Y', 'E', 'E', 'Y', 'I', 'O',
'CTRL', 'SHFT', '', '', 'L2_(ENTR)', 'L1_(TAB)',),
# 1 - Numbers Layer
('4', '3', '2', '1', '1', '2', '3', '4',
'8', '7', '6', '5', '5', '6', '7', '8',
'', '', '', '', '', ''),
# 2 - Symbols Layer
('$', '#', '@', '!', '!', '@', '#', '$',
'*', '&', '^', '%', '%', '^', '&', '*',
'', '', '', '', '', ''),
# 3 - Meta Layer
('', '', '', '', '', '', '', '',
'', '', '', '', '', '', '', '',
'', '', '', '', '', ''),
# 4 - Navigation Layer
('', '', '', '', '', '', '', '',
'', '', '', '', '', '', '', '',
'', '', '', '', '', ''),
# 5 - Game Layer has no chords or fancy stuff for fast response
('', '', '', '', '', '', '', '',
'', '', '', '', '', '', '', '',
'', '', '', '', '', ''),
)
# Check _ALIASES to see what already exists in the keymap_utils
# file. Add any more here that you like. These must match what's
# in the usb.device.keyboard.KeyCodes object:
# https://github.com/micropython/micropython-lib/blob/master/micropython/usb/usb-device-keyboard/usb/device/keyboard.py
_MY_ALIASES = {'RSHFT': 'RIGHT_SHIFT', }
################################
# Don't edit stuff below here! #
################################
import keymap_utils as ku
# from keymap_utils import *
_ALIASES = ku.update_aliases(_MY_ALIASES)
LOOKUP = ku.get_lookup_table(_CHORDS, _KEYMAP, _ALIASES, _GAME_LAYER)
# CHORD_KEYS = ku.get_chording_keys(_CHORDS)
# # CHORDS = ku.get_chords(_CHORDS
# INV_LAYOUT = ku.get_inverted_layout(_LAYOUT)
# ACTIONS = ku.get_actions(_KEYMAP)