commit
311edd5601
@ -1,59 +0,0 @@
|
||||
#define KEYMAP_COLEMAK { /* Generated keymap for COLEMAK */ {Key_skip, Key_1, Key_2, Key_3, Key_4, Key_5, Key_skip, Key_skip, Key_6, Key_7, Key_8, Key_9, Key_0, Key_skip},\
|
||||
{Key_Backtick, Key_Q, Key_W, Key_F, Key_P, Key_G, Key_skip, Key_skip, Key_J, Key_L, Key_U, Key_Y, Key_Semicolon, Key_Equals},\
|
||||
{Key_PageUp, Key_A, Key_R, Key_S, Key_T, Key_D, Key_Tab, Key_Return, Key_H, Key_N, Key_E, Key_I, Key_O, Key_Quote},\
|
||||
{Key_PageDn, Key_Z, Key_X, Key_C, Key_V, Key_B, Key_Esc, Key_Keymap2, Key_K, Key_M, Key_Comma, Key_Period, Key_Slash, Key_Minus},\
|
||||
{Key_LCtrl, Key_Backspace, Key_LShift, Key_LGUI, Key_KeymapNext_Momentary, Key_skip, Key_skip, Key_skip, Key_skip, Key_KeymapNext_Momentary, Key_RAlt, Key_RShift, Key_Space, Key_RCtrl},\
|
||||
},
|
||||
#define KEYMAP_DVORAK { /* Generated keymap for DVORAK */ {Key_skip, Key_1, Key_2, Key_3, Key_4, Key_5, Key_skip, Key_skip, Key_6, Key_7, Key_8, Key_9, Key_0, Key_skip},\
|
||||
{Key_Backtick, Key_Quote, Key_Comma, Key_Period, Key_P, Key_Y, Key_skip, Key_skip, Key_F, Key_G, Key_C, Key_R, Key_L, Key_Slash},\
|
||||
{Key_PageUp, Key_A, Key_O, Key_E, Key_U, Key_I, Key_Tab, Key_Return, Key_D, Key_H, Key_T, Key_N, Key_S, Key_Minus},\
|
||||
{Key_PageDn, Key_Semicolon, Key_Q, Key_J, Key_K, Key_X, Key_Esc, Key_Keymap2, Key_B, Key_M, Key_W, Key_V, Key_Z, Key_Equals},\
|
||||
{Key_LCtrl, Key_Backspace, Key_LShift, Key_LGUI, Key_KeymapNext_Momentary, Key_skip, Key_skip, Key_skip, Key_skip, Key_KeymapNext_Momentary, Key_RAlt, Key_RShift, Key_Space, Key_RCtrl},\
|
||||
},
|
||||
#define KEYMAP_GENERIC_FN2 { /* Generated keymap for GENERIC_FN2 */ {Key_skip, Key_F1, Key_F2, Key_F3, Key_F4, Key_F5, XXX, Key_LCtrl, Key_RCtrl, XXX, Key_F6, Key_F7, Key_F8, Key_F9, ___, Key_skip},\
|
||||
{Key_Tab, Key_mouseBtnM, Key_mouseUp, Key_skip, Key_mouseWarpNW, Key_mouseWarpNE, XXX, Key_mouseBtnL, Key_mouseBtnR, XXX, Key_playPause, Key_LCurlyBracket, Key_RCurlyBracket, Key_LSquareBracket, Key_RSquareBracket, Key_sleep},\
|
||||
{Key_Home, Key_mouseL, Key_mouseDn, Key_mouseR, Key_mouseWarpSW, Key_mouseWarpSE, Key_nextTrack, Key_LGUI, Key_RAlt, Key_Delete, Key_LArrow, Key_DnArrow, Key_UpArrow, Key_RArrow, Key_F11, Key_F12},\
|
||||
{Key_End, Key_Z, Key_X, Key_C, Key_V, Key_mouseWarpEnd, ___, Key_LShift, Key_RShift, ___, Key_volumeDown, Key_volumeUp, Key_BacklightDn, Key_BacklightUp, Key_Backslash, Key_Pipe},\
|
||||
},
|
||||
#define KEYMAP_GENERIC_FN2_MOO { /* Generated keymap for GENERIC_FN2_MOO */ {Key_skip, Key_F1, Key_F2, Key_F3, Key_F4, Key_F5, Key_NoKey, Key_LCtrl, Key_RCtrl, Key_NoKey, Key_F6, Key_F7, Key_F8, Key_F9, Key_Keymap0, Key_skip},\
|
||||
{Key_Tab, Key_mouseBtnM, Key_mouseUp, Key_skip, Key_mouseWarpNW, Key_mouseWarpNE, Key_NoKey, Key_mouseBtnL, Key_mouseBtnR, Key_NoKey, Key_playPause, Key_LCurlyBracket, Key_RCurlyBracket, Key_LEFT_PAREN, Key_RIGHT_PAREN, Key_sleep},\
|
||||
{Key_Home, Key_mouseL, Key_mouseDn, Key_mouseR, Key_mouseWarpSW, Key_mouseWarpSE, Key_nextTrack, Key_LShift, Key_RShift, Key_Delete, Key_LArrow, Key_DnArrow, Key_UpArrow, Key_RArrow, Key_F11, Key_F12},\
|
||||
{Key_End, Key_Z, Key_X, Key_C, Key_V, Key_mouseWarpEnd, Key_skip, Key_LGUI, Key_RAlt, Key_skip, Key_volumeDown, Key_volumeUp, Key_LSquareBracket, Key_RSquareBracket, Key_Backslash, Key_Pipe},\
|
||||
},
|
||||
#define KEYMAP_MALTRON { /* Generated keymap for MALTRON */ {Key_skip, Key_1, Key_2, Key_3, Key_4, Key_5, Key_skip, Key_skip, Key_6, Key_7, Key_8, Key_9, Key_0, Key_skip},\
|
||||
{Key_Backtick, Key_Q, Key_P, Key_Y, Key_C, Key_B, Key_skip, Key_skip, Key_V, Key_M, Key_U, Key_Z, Key_L, Key_Equals},\
|
||||
{Key_PageUp, Key_A, Key_N, Key_I, Key_S, Key_F, Key_Tab, Key_Return, Key_D, Key_T, Key_H, Key_O, Key_R, Key_Quote},\
|
||||
{Key_PageDn, Key_Comma, Key_Period, Key_J, Key_G, Key_Slash, Key_Esc, Key_Keymap2, Key_Semicolon, Key_W, Key_K, Key_Minus, Key_X, Key_LSquareBracket},\
|
||||
{Key_LGUI, Key_E, Key_LShift, Key_Backspace, Key_KeymapNext_Momentary, Key_skip, Key_skip, Key_skip, Key_skip, Key_KeymapNext_Momentary, Key_RCtrl, Key_RShift, Key_Space, Key_RAlt},\
|
||||
},
|
||||
#define KEYMAP_NUMPAD { /* Generated keymap for NUMPAD */ {___, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___, Key_Keypad7, Key_Keypad8, Key_Keypad9, Key_KeypadMinus, ___},\
|
||||
{___, ___, ___, ___, ___, ___, Key_Keymap1_Momentary, ___, ___, Key_Keymap1_Momentary, ___, Key_Keypad4, Key_Keypad5, Key_Keypad6, Key_KeypadPlus, ___},\
|
||||
{___, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___, Key_Keypad1, Key_Keypad2, Key_Keypad3, Key_Equals, Key_Quote},\
|
||||
{___, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___, Key_Keypad0, Key_KeypadDot, Key_KeypadMultiply, Key_KeypadSlash, Key_Enter},\
|
||||
},
|
||||
#define KEYMAP_QWERTY { /* Generated keymap for QWERTY */ {Key_LEDEffectNext, Key_1, Key_2, Key_3, Key_4, Key_5, Key_LEDEffectNext, Key_LCtrl, Key_RCtrl, Key_skip, Key_6, Key_7, Key_8, Key_9, Key_0, Key_ToggleNumlock},\
|
||||
{Key_Backtick, Key_Q, Key_W, Key_E, Key_R, Key_T, Key_Tab, Key_Backspace, Key_Space, Key_Enter, Key_Y, Key_U, Key_I, Key_O, Key_P, Key_Equals},\
|
||||
{Key_PageUp, Key_A, Key_S, Key_D, Key_F, Key_G, Key_Esc, Key_LGUI, Key_RAlt, Key_skip, Key_H, Key_J, Key_K, Key_L, Key_Semicolon, Key_Quote},\
|
||||
{Key_PageDn, Key_Z, Key_X, Key_C, Key_V, Key_B, Key_KeymapNext_Momentary, Key_LShift, Key_RShift, Key_KeymapNext_Momentary, Key_N, Key_M, Key_Comma, Key_Period, Key_Slash, Key_Minus},\
|
||||
},
|
||||
#define KEYMAP_QWERTY_ALT_CMD { /* Generated keymap for QWERTY_ALT_CMD */ {Key_LEDEffectNext, Key_1, Key_2, Key_3, Key_4, Key_5, Key_skip, Key_LCtrl, Key_RCtrl, Key_skip, Key_6, Key_7, Key_8, Key_9, Key_0, Key_Keymap2},\
|
||||
{Key_Backtick, Key_Q, Key_W, Key_E, Key_R, Key_T, Key_KeymapNext_Momentary, Key_Backspace, Key_Space, Key_KeymapNext_Momentary, Key_Y, Key_U, Key_I, Key_O, Key_P, Key_Equals},\
|
||||
{Key_PageUp, Key_A, Key_S, Key_D, Key_F, Key_G, Key_Tab, Key_LAlt, Key_RGUI, Key_Return, Key_H, Key_J, Key_K, Key_L, Key_Semicolon, Key_Quote},\
|
||||
{Key_PageDn, Key_Z, Key_X, Key_C, Key_V, Key_B, Key_Esc, Key_LShift, Key_RShift, Key_skip, Key_N, Key_M, Key_Comma, Key_Period, Key_Slash, Key_Minus},\
|
||||
},
|
||||
#define KEYMAP_QWERTY_MOO { /* Generated keymap for QWERTY_MOO */ {Key_LEDEffectNext, Key_1, Key_2, Key_3, Key_4, Key_5, Key_skip, Key_LCtrl, Key_RCtrl, Key_skip, Key_6, Key_7, Key_8, Key_9, Key_0, Key_Keymap2},\
|
||||
{Key_Backtick, Key_Q, Key_W, Key_E, Key_R, Key_T, Key_KeymapNext_Momentary, Key_Backspace, Key_Space, Key_KeymapNext_Momentary, Key_Y, Key_U, Key_I, Key_O, Key_P, Key_Equals},\
|
||||
{Key_Backslash, Key_A, Key_S, Key_D, Key_F, Key_G, Key_Tab, Key_LShift, Key_RShift, Key_Return, Key_H, Key_J, Key_K, Key_L, Key_Semicolon, Key_Quote},\
|
||||
{Key_PageDn, Key_Z, Key_X, Key_C, Key_V, Key_B, Key_Esc, Key_LGUI, Key_RAlt, Key_skip, Key_N, Key_M, Key_Comma, Key_Period, Key_Slash, Key_Minus},\
|
||||
},
|
||||
#define KEYMAP_QWERTY_PIERS { /* Generated keymap for QWERTY_PIERS */ {Key_skip, Key_1, Key_2, Key_3, Key_4, Key_5, Key_skip, Key_LCtrl, Key_RCtrl, Key_skip, Key_6, Key_7, Key_8, Key_9, Key_0, Key_skip},\
|
||||
{Key_Backtick, Key_Q, Key_W, Key_E, Key_R, Key_T, Key_KeymapNext_Momentary, Key_Backspace, Key_Space, Key_KeymapNext_Momentary, Key_Y, Key_U, Key_I, Key_O, Key_P, Key_Equals},\
|
||||
{Key_PageUp, Key_A, Key_S, Key_D, Key_F, Key_G, Key_Tab, Key_LGUI, Key_RAlt, Key_Return, Key_H, Key_J, Key_K, Key_L, Key_Semicolon, Key_Quote},\
|
||||
{Key_PageDn, Key_Z, Key_X, Key_C, Key_V, Key_B, Key_Esc, Key_RShift, Key_RShift, Key_skip, Key_N, Key_M, Key_Comma, Key_Period, Key_Slash, Key_Minus},\
|
||||
},
|
||||
#define KEYMAP_WORKMAN { /* Generated keymap for WORKMAN */ {Key_skip, Key_1, Key_2, Key_3, Key_4, Key_5, Key_skip, Key_skip, Key_6, Key_7, Key_8, Key_9, Key_0, Key_skip},\
|
||||
{Key_Backtick, Key_Q, Key_D, Key_R, Key_W, Key_B, Key_skip, Key_skip, Key_J, Key_F, Key_U, Key_P, Key_Semicolon, Key_Equals},\
|
||||
{Key_PageUp, Key_A, Key_S, Key_H, Key_T, Key_G, Key_Tab, Key_Return, Key_Y, Key_N, Key_E, Key_O, Key_I, Key_Quote},\
|
||||
{Key_PageDn, Key_Z, Key_X, Key_M, Key_C, Key_V, Key_Esc, Key_Keymap0, Key_K, Key_L, Key_Comma, Key_Period, Key_Slash, Key_Minus},\
|
||||
{Key_LGUI, Key_Backspace, Key_LShift, Key_LCtrl, Key_KeymapNext_Momentary, Key_skip, Key_skip, Key_skip, Key_skip, Key_KeymapNext_Momentary, Key_RCtrl, Key_RShift, Key_Space, Key_RAlt},\
|
||||
},
|
@ -1,6 +0,0 @@
|
||||
#NAME: COLEMAK
|
||||
skip 1 2 3 4 5 skip skip 6 7 8 9 0 skip
|
||||
` Q W F P G skip skip J L U Y ; =
|
||||
PageUp A R S T D Tab Return H N E I O '
|
||||
PageDn Z X C V B Esc Keymap2 K M , . / -
|
||||
LCtrl Backspace LShift LGUI KeymapNext_Momentary skip skip skip skip KeymapNext_Momentary RAlt RShift Space RCtrl
|
@ -1,6 +0,0 @@
|
||||
#NAME: DVORAK
|
||||
skip 1 2 3 4 5 skip skip 6 7 8 9 0 skip
|
||||
` ' , . P Y skip skip F G C R L /
|
||||
PageUp A O E U I Tab Return D H T N S -
|
||||
PageDn ; Q J K X Esc Keymap2 B M W V Z =
|
||||
LCtrl Backspace LShift LGUI KeymapNext_Momentary skip skip skip skip KeymapNext_Momentary RAlt RShift Space RCtrl
|
@ -1,5 +0,0 @@
|
||||
#NAME: GENERIC_FN2
|
||||
skip F1 F2 F3 F4 F5 XXXXXXXXX LCtrl RCtrl XXXXXX F6 F7 F8 F9 ___ skip
|
||||
Tab mouseBtnM mouseUp skip mouseWarpNW mouseWarpNE XXXXXXXXX mouseBtnL mouseBtnR XXXXXX playPause { } [ ] sleep
|
||||
Home mouseL mouseDn mouseR mouseWarpSW mouseWarpSE nextTrack LGUI RAlt Delete LArrow DnArrow UpArrow RArrow F11 F12
|
||||
End Z X C V mouseWarpEnd _________ LShift RShift ______ volumeDown volumeUp BacklightDn BacklightUp \ |
|
@ -1,5 +0,0 @@
|
||||
#NAME: GENERIC_FN2_MOO
|
||||
skip F1 F2 F3 F4 F5 NoKey LCtrl RCtrl NoKey F6 F7 F8 F9 Keymap0 skip
|
||||
Tab mouseBtnM mouseUp skip mouseWarpNW mouseWarpNE NoKey mouseBtnL mouseBtnR NoKey playPause { } LEFT_PAREN RIGHT_PAREN sleep
|
||||
Home mouseL mouseDn mouseR mouseWarpSW mouseWarpSE nextTrack LShift RShift Delete LArrow DnArrow UpArrow RArrow F11 F12
|
||||
End Z X C V mouseWarpEnd skip LGUI RAlt skip volumeDown volumeUp [ ] \ |
|
@ -1,6 +0,0 @@
|
||||
#NAME: MALTRON
|
||||
skip 1 2 3 4 5 skip skip 6 7 8 9 0 skip
|
||||
` Q P Y C B skip skip V M U Z L =
|
||||
PageUp A N I S F Tab Return D T H O R '
|
||||
PageDn , . J G / Esc Keymap2 ; W K - X [
|
||||
LGUI E LShift Backspace KeymapNext_Momentary skip skip skip skip KeymapNext_Momentary RCtrl RShift Space RAlt
|
@ -1,5 +0,0 @@
|
||||
#NAME: NUMPAD
|
||||
___ ___ ___ ___ ___ ___ _________________ ___ ___ _________________ ___ Keypad7 Keypad8 Keypad9 KeypadMinus ___
|
||||
___ ___ ___ ___ ___ ___ Keymap1_Momentary ___ ___ Keymap1_Momentary ___ Keypad4 Keypad5 Keypad6 KeypadPlus ___
|
||||
___ ___ ___ ___ ___ ___ _________________ ___ ___ _________________ ___ Keypad1 Keypad2 Keypad3 Equals '
|
||||
___ ___ ___ ___ ___ ___ _________________ ___ ___ _________________ ___ Keypad0 KeypadDot KeypadMultiply KeypadSlash Enter
|
@ -1,5 +0,0 @@
|
||||
#NAME: QWERTY
|
||||
LEDEffectNext 1 2 3 4 5 LEDEffectNext LCtrl RCtrl skip 6 7 8 9 0 ToggleNumlock
|
||||
` Q W E R T Tab Backspace Space Enter Y U I O P =
|
||||
PageUp A S D F G Esc LGUI RAlt skip H J K L ; '
|
||||
PageDn Z X C V B KeymapNext_Momentary LShift RShift KeymapNext_Momentary N M , . / -
|
@ -1,5 +0,0 @@
|
||||
#NAME: QWERTY_MOO
|
||||
LEDEffectNext 1 2 3 4 5 skip LCtrl RCtrl skip 6 7 8 9 0 Keymap2
|
||||
` Q W E R T KeymapNext_Momentary Backspace Space KeymapNext_Momentary Y U I O P =
|
||||
\ A S D F G Tab LShift RShift Return H J K L ; '
|
||||
PageDn Z X C V B Esc LGUI RAlt skip N M , . / -
|
@ -1,5 +0,0 @@
|
||||
#NAME: QWERTY_ALT_CMD
|
||||
LEDEffectNext 1 2 3 4 5 skip LCtrl RCtrl skip 6 7 8 9 0 Keymap2
|
||||
` Q W E R T KeymapNext_Momentary Backspace Space KeymapNext_Momentary Y U I O P =
|
||||
PageUp A S D F G Tab LAlt RGUI Return H J K L ; '
|
||||
PageDn Z X C V B Esc LShift RShift skip N M , . / -
|
@ -1,5 +0,0 @@
|
||||
#NAME: QWERTY_PIERS
|
||||
skip 1 2 3 4 5 skip LCtrl RCtrl skip 6 7 8 9 0 skip
|
||||
` Q W E R T KeymapNext_Momentary Backspace Space KeymapNext_Momentary Y U I O P =
|
||||
PageUp A S D F G Tab LGUI RAlt Return H J K L ; '
|
||||
PageDn Z X C V B Esc RShift RShift skip N M , . / -
|
@ -1,6 +0,0 @@
|
||||
#NAME: WORKMAN
|
||||
skip 1 2 3 4 5 skip skip 6 7 8 9 0 skip
|
||||
` Q D R W B skip skip J F U P ; =
|
||||
PageUp A S H T G Tab Return Y N E O I '
|
||||
PageDn Z X M C V Esc Keymap0 K L , . / -
|
||||
LGUI Backspace LShift LCtrl KeymapNext_Momentary skip skip skip skip KeymapNext_Momentary RCtrl RShift Space RAlt
|
@ -1,55 +0,0 @@
|
||||
use warnings;
|
||||
use strict;
|
||||
|
||||
my @data = <STDIN>;
|
||||
|
||||
use Data::Dumper;
|
||||
|
||||
my $name = 'Unnamed';
|
||||
my @map;
|
||||
for my $line (@data) {
|
||||
chomp($line);
|
||||
if ($line =~ /^#NAME: (.*)/i) {
|
||||
$name = $1;
|
||||
next
|
||||
}
|
||||
|
||||
my @keys = split(/\s+/, $line);
|
||||
push @map, join(', ', map{ ''.lookup($_).'' } @keys);
|
||||
}
|
||||
|
||||
print "#define KEYMAP_$name { /* Generated keymap for $name */ ";
|
||||
for my $line (@map) {
|
||||
print "\t{". $line ."},\\\n";
|
||||
}
|
||||
print "},\n";
|
||||
|
||||
sub lookup {
|
||||
|
||||
my %table = (
|
||||
'{' => 'Key_LCurlyBracket',
|
||||
'}' => 'Key_RCurlyBracket',
|
||||
'['=> 'Key_LSquareBracket',
|
||||
']'=> 'Key_RSquareBracket',
|
||||
'|'=> 'Key_Pipe',
|
||||
'\\' => 'Key_Backslash',
|
||||
|
||||
';' => 'Key_Semicolon',
|
||||
',' => 'Key_Comma',
|
||||
'.' => 'Key_Period',
|
||||
'/' => 'Key_Slash',
|
||||
"'" => 'Key_Quote',
|
||||
'`' => 'Key_Backtick',
|
||||
'-' => 'Key_Minus',
|
||||
'=' => 'Key_Equals',
|
||||
'___' => '___',
|
||||
'XXX' => 'XXX');
|
||||
|
||||
my $x = shift;
|
||||
return $x if $x =~ /\(.*\)/;
|
||||
return '___' if ($x =~ /_{2,}/);
|
||||
return 'XXX' if ($x =~ /X{2,}/);
|
||||
|
||||
return 'Key_'.$x unless defined $table{$x};
|
||||
return $table{$x};
|
||||
}
|
Loading…
Reference in new issue