2018-10-11 05:46:59 +02:00
import gc
2018-10-12 03:02:13 +02:00
from kmk . consts import DiodeOrientation , UnicodeModes
2018-09-23 13:57:19 +02:00
from kmk . entrypoints . handwire . pyboard import main
2018-10-12 03:02:13 +02:00
from kmk . keycodes import KC
from kmk . macros . simple import send_string
from kmk . macros . unicode import unicode_string_sequence
from kmk . pins import Pin as P
from kmk . types import AttrDict
2018-09-20 09:02:10 +02:00
2018-10-07 10:40:09 +02:00
cols = ( P . Y12 , P . Y11 , P . Y10 , P . Y9 , P . X8 , P . X7 , P . X6 , P . X5 , P . X4 , P . X3 , P . X2 , P . X1 )
rows = ( P . Y1 , P . Y2 , P . Y3 , P . Y4 )
2018-09-23 12:23:42 +02:00
diode_orientation = DiodeOrientation . COLUMNS
2018-10-08 11:31:30 +02:00
# ------------------User level config variables ---------------------------------------
2018-09-28 23:35:52 +02:00
unicode_mode = UnicodeModes . LINUX
2018-10-08 11:31:30 +02:00
tap_time = 150
leader_timeout = 2000
2018-10-11 05:46:59 +02:00
DEBUG_ENABLE = False
2018-09-28 23:35:52 +02:00
2018-10-08 11:31:30 +02:00
# -------------------------------Macros -----------------------------------------------
2018-10-11 05:46:59 +02:00
gc . collect ( )
emoticons = AttrDict ( {
# Emoticons, but fancier
' ANGRY_TABLE_FLIP ' : r ' (ノಠ痊ಠ)ノ彡┻━┻ ' ,
' CHEER ' : r ' +。:.゚ヽ(´∀。)ノ゚.:。+゚゚+。:.゚ヽ(*´∀)ノ゚.:。+゚ ' ,
' TABLE_FLIP ' : r ' (╯°□°)╯︵ ┻━┻ ' ,
' WAT ' : r ' ⊙.☉ ' ,
' FF ' : r ' 凸(゚Д゚#) ' ,
' F ' : r ' ( ̄^ ̄)凸 ' ,
' MEH ' : r ' ╮( ̄_ ̄)╭ ' ,
' YAY ' : r ' o(^▽^)o ' ,
} )
for k , v in emoticons . items ( ) :
emoticons [ k ] = unicode_string_sequence ( v )
2018-09-28 23:35:52 +02:00
2018-10-08 11:31:30 +02:00
# ---------------------- Leader Key Macros --------------------------------------------
2018-10-11 05:46:59 +02:00
gc . collect ( )
2018-10-08 11:31:30 +02:00
LEADER_DICTIONARY = {
2018-10-11 05:46:59 +02:00
( KC . F , KC . L , KC . I , KC . P ) : emoticons . ANGRY_TABLE_FLIP ,
( KC . C , KC . H , KC . E , KC . E , KC . R ) : emoticons . CHEER ,
( KC . W , KC . A , KC . T ) : emoticons . WAT ,
( KC . F , KC . F ) : emoticons . FF ,
( KC . F , ) : emoticons . F ,
( KC . M , KC . E , KC . H ) : emoticons . MEH ,
( KC . Y , KC . A , KC . Y ) : emoticons . YAY ,
2018-10-08 11:31:30 +02:00
}
2018-10-11 05:46:59 +02:00
gc . collect ( )
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. " )
2018-10-08 11:31:30 +02:00
# ---------------------- Keymap ---------------------------------------------------------
2018-10-11 05:46:59 +02:00
gc . collect ( )
2018-09-23 12:23:42 +02:00
keymap = [
[
2018-09-23 13:57:19 +02:00
# Default
2018-09-25 03:00:35 +02:00
[ KC . GESC , KC . QUOTE , KC . COMMA , KC . DOT , KC . P , KC . Y , KC . F , KC . G , KC . C , KC . R , KC . L , KC . BKSP ] ,
2018-09-23 12:23:42 +02:00
[ 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 ] ,
2018-10-08 11:31:30 +02:00
[ 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 ] ,
2018-09-23 12:23:42 +02:00
] ,
[
2018-09-23 13:57:19 +02:00
# 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 ] ,
[ 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 . F1 , KC . F2 , KC . SPC , KC . SPC , KC . MO ( 4 ) , KC . LEFT , KC . DOWN , KC . UP , KC . RIGHT ] ,
] ,
[
# Raise1
[ KC . TILD , KC . EXLM , KC . AT , KC . HASH , KC . DLR , KC . PERC , KC . CIRC , KC . AMPR , KC . ASTR , KC . LPRN , KC . RPRN , KC . DEL ] ,
[ KC . TRNS , KC . NO , KC . NO , KC . NO , KC . NO , KC . NO , KC . NO , KC . NO , KC . NO , KC . LBRC , KC . RBRC , KC . BSLS ] ,
[ KC . TRNS , KC . NO , KC . NO , KC . NO , KC . NO , KC . NO , KC . NO , KC . NO , KC . INS , KC . PGDN , KC . PGUP , KC . MINS ] ,
2018-09-23 14:46:21 +02:00
[ KC . RESET , KC . TRNS , KC . TRNS , KC . TRNS , KC . TRNS , KC . NO , KC . NO , KC . EQL , KC . HOME , KC . VOLD , KC . VOLU , KC . END ] ,
2018-09-23 13:57:19 +02:00
] ,
[
# Raise2
[ KC . TRNS , KC . TRNS , KC . TRNS , KC . TRNS , KC . TRNS , KC . TRNS , KC . TRNS , KC . TRNS , KC . N7 , KC . N8 , KC . N9 , KC . BKSP ] ,
[ KC . TRNS , KC . TRNS , KC . TRNS , KC . TRNS , KC . TRNS , KC . TRNS , KC . TRNS , KC . TRNS , KC . N4 , KC . N5 , KC . N6 , KC . NO ] ,
[ KC . TRNS , KC . TRNS , KC . TRNS , KC . TRNS , KC . TRNS , KC . TRNS , KC . TRNS , KC . TRNS , KC . N1 , KC . N2 , KC . N3 , KC . NO ] ,
[ KC . TRNS , KC . TRNS , KC . TRNS , KC . TRNS , KC . TRNS , KC . TRNS , KC . TRNS , KC . TRNS , KC . N0 , KC . N0 , KC . PDOT , KC . ENT ] ,
] ,
[
# Raise3
2018-10-11 05:46:59 +02:00
[ WPM , KC . TRNS , KC . TRNS , KC . TRNS , KC . TRNS , KC . TRNS , KC . TRNS , KC . TRNS , KC . F10 , KC . F11 , KC . F12 , KC . LSHIFT ( KC . INS ) ] ,
2018-09-23 13:57:19 +02:00
[ KC . TRNS , KC . TRNS , KC . TRNS , KC . TRNS , KC . TRNS , KC . TRNS , KC . TRNS , KC . TRNS , KC . F7 , KC . F8 , KC . F9 , KC . NO ] ,
[ KC . TRNS , KC . TRNS , KC . TRNS , KC . TRNS , KC . TRNS , KC . TRNS , KC . TRNS , KC . TRNS , KC . F4 , KC . F5 , KC . F6 , KC . NO ] ,
[ KC . DF ( 0 ) , KC . DF ( 1 ) , KC . TRNS , KC . TRNS , KC . TRNS , KC . TRNS , KC . TRNS , KC . TRNS , KC . F1 , KC . F2 , KC . F3 , KC . NO ] ,
2018-09-23 12:23:42 +02:00
] ,
]