2018-10-16 13:04:39 +02:00
from kmk . boards . klarank import Firmware
2018-12-05 02:03:13 +01:00
from kmk . consts import LeaderMode , UnicodeMode
2018-10-16 13:04:39 +02:00
from kmk . keycodes import KC
from kmk . keycodes import generate_leader_dictionary_seq as glds
from kmk . macros . simple import send_string
from kmk . macros . unicode import compile_unicode_string_sequences as cuss
keyboard = Firmware ( )
keyboard . debug_enabled = True
2018-12-05 02:03:13 +01:00
keyboard . unicode_mode = UnicodeMode . LINUX
2018-11-06 06:14:20 +01:00
keyboard . tap_time = 750
2018-10-16 13:04:39 +02:00
emoticons = cuss ( {
# Emojis
' BEER ' : r ' 🍺 ' ,
' BEER_TOAST ' : r ' 🍻 ' ,
' FACE_CUTE_SMILE ' : r ' 😊 ' ,
' FACE_HEART_EYES ' : r ' 😍 ' ,
' FACE_JOY ' : r ' 😂 ' ,
' FACE_SWEAT_SMILE ' : r ' 😅 ' ,
' FACE_THINKING ' : r ' 🤔 ' ,
' FIRE ' : r ' 🔥 ' ,
' FLAG_CA ' : r ' 🇨🇦 ' ,
' FLAG_US ' : r ' 🇺🇸 ' ,
' HAND_CLAP ' : r ' 👏 ' ,
' HAND_HORNS ' : r ' 🤘 ' ,
' HAND_OK ' : r ' 👌 ' ,
' HAND_THUMB_DOWN ' : r ' 👎 ' ,
' HAND_THUMB_UP ' : r ' 👍 ' ,
' HAND_WAVE ' : r ' 👋 ' ,
' HEART ' : r ' ❤️ ' ,
' MAPLE_LEAF ' : r ' 🍁 ' ,
' POOP ' : r ' 💩 ' ,
' TADA ' : r ' 🎉 ' ,
# Emoticons, but fancier
' ANGRY_TABLE_FLIP ' : r ' (ノಠ痊ಠ)ノ彡┻━┻ ' ,
' CELEBRATORY_GLITTER ' : r ' +。:.゚ヽ(´∀。)ノ゚.:。+゚゚+。:.゚ヽ(*´∀)ノ゚.:。+゚ ' ,
' SHRUGGIE ' : r ' ¯ \ _(ツ)_/¯ ' ,
' TABLE_FLIP ' : r ' (╯°□°)╯︵ ┻━┻ ' ,
} )
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-19 10:49:37 +02:00
keyboard . leader_mode = LeaderMode . TIMEOUT
2018-10-16 13:04:39 +02:00
keyboard . leader_dictionary = {
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 ,
}
2018-10-21 02:53:58 +02:00
_______ = KC . TRNS
xxxxxxx = KC . NO
HELLA_TD = KC . TD (
KC . A ,
KC . B ,
send_string ( ' macros in a tap dance? I think yes ' ) ,
KC . TG ( 1 ) ,
)
2018-10-16 13:04:39 +02:00
keyboard . keymap = [
[
[ KC . GESC , KC . QUOT , KC . COMM , KC . DOT , KC . P , KC . Y , KC . F , KC . G , KC . C , KC . R , KC . L , KC . BSPC ] ,
[ 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 . LGUI , KC . SCLN , KC . Q , KC . J , KC . K , KC . X , KC . B , KC . M , KC . W , KC . V , KC . Z , KC . LALT ] ,
2018-10-21 02:53:58 +02:00
[ KC . LCTL , KC . LEAD , KC . LSHIFT ( KC . LGUI ) , KC . MO ( 2 ) , KC . MO ( 3 ) , KC . LSFT , KC . SPC , KC . MO ( 1 ) , KC . LEFT , KC . DOWN , KC . UP , KC . RGHT ] ,
2018-10-16 13:04:39 +02:00
] ,
[
[ KC . GESC , xxxxxxx , xxxxxxx , KC . F10 , KC . F11 , KC . F12 , xxxxxxx , KC . PSLS , KC . N7 , KC . N8 , KC . N9 , KC . BSPC ] ,
[ KC . TAB , xxxxxxx , xxxxxxx , KC . F7 , KC . F8 , KC . F9 , xxxxxxx , KC . PAST , KC . N4 , KC . N5 , KC . N6 , _______ ] ,
[ KC . LGUI , xxxxxxx , xxxxxxx , KC . F4 , KC . F5 , KC . F6 , xxxxxxx , KC . PMNS , KC . N1 , KC . N2 , KC . N3 , _______ ] ,
[ KC . LCTL , xxxxxxx , _______ , KC . F1 , KC . F2 , KC . F3 , KC . SPC , _______ , KC . N0 , KC . DOT , xxxxxxx , KC . EQL ] ,
] ,
[
[ KC . GESC , xxxxxxx , xxxxxxx , xxxxxxx , xxxxxxx , xxxxxxx , xxxxxxx , xxxxxxx , KC . BSLS , KC . LBRC , KC . RBRC , KC . DEL ] ,
[ KC . TAB , xxxxxxx , xxxxxxx , xxxxxxx , xxxxxxx , xxxxxxx , xxxxxxx , xxxxxxx , xxxxxxx , xxxxxxx , xxxxxxx , KC . MINS ] ,
[ KC . LGUI , xxxxxxx , xxxxxxx , xxxxxxx , xxxxxxx , xxxxxxx , xxxxxxx , xxxxxxx , KC . LBRC , xxxxxxx , xxxxxxx , KC . INS ] ,
[ KC . LCTL , xxxxxxx , _______ , _______ , xxxxxxx , _______ , xxxxxxx , xxxxxxx , KC . HOME , KC . PGDN , KC . PGUP , KC . END ] ,
] ,
[
2018-10-21 02:53:58 +02:00
[ KC . GRV , KC . EXLM , KC . AT , KC . HASH , KC . DLR , KC . PERC , KC . CIRC , KC . AMPR , KC . ASTR , KC . LPRN , KC . RPRN , KC . SLSH ] ,
[ KC . TAB , xxxxxxx , xxxxxxx , xxxxxxx , xxxxxxx , xxxxxxx , xxxxxxx , xxxxxxx , xxxxxxx , xxxxxxx , xxxxxxx , KC . MINS ] ,
[ KC . LGUI , xxxxxxx , xxxxxxx , xxxxxxx , xxxxxxx , xxxxxxx , xxxxxxx , xxxxxxx , xxxxxxx , xxxxxxx , xxxxxxx , xxxxxxx ] ,
[ KC . LCTL , KC . DBG , HELLA_TD , xxxxxxx , _______ , _______ , xxxxxxx , xxxxxxx , KC . MUTE , KC . VOLD , KC . VOLU , xxxxxxx ] ,
2018-10-16 13:04:39 +02:00
] ,
]
if __name__ == ' __main__ ' :
keyboard . go ( )