]> git.donarmstrong.com Git - kiibohd-kll.git/commitdiff
Fixing ascii string macro processing
authorJacob Alexander <haata@kiibohd.com>
Thu, 8 Oct 2015 03:05:44 +0000 (20:05 -0700)
committerJacob Alexander <haata@kiibohd.com>
Thu, 8 Oct 2015 03:05:44 +0000 (20:05 -0700)
- Fixing very old naming convention Brace to Bracket
- For now, accepting the old Brace names (will be deprecated at some point)

kll.py
kll_lib/hid_dict.py

diff --git a/kll.py b/kll.py
index 07a822cd149ad876283ce94b3dda7389ca9ff0f8..c4386e0bf7cb34bbadfb38da0e7d52dea37602e0 100755 (executable)
--- a/kll.py
+++ b/kll.py
@@ -147,7 +147,7 @@ def tokenize( string ):
                ( 'ScanCode',         ( r'S((0x[0-9a-fA-F]+)|([0-9]+))', ) ),
                ( 'ScanCodeStart',    ( r'S\[', ) ),
                ( 'CodeEnd',          ( r'\]', ) ),
-               ( 'String',           ( r'"[^"]*"', VERBOSE ) ),
+               ( 'String',           ( r'"[^"]*"', ) ),
                ( 'SequenceString',   ( r"'[^']*'", ) ),
                ( 'Operator',         ( r'=>|:\+|:-|::|:|=', ) ),
                ( 'Comma',            ( r',', ) ),
@@ -268,16 +268,17 @@ def make_seqString( token ):
                ( "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 0x20 ),
                ( "+",       0x12 ),
                ( "&(",      0x11 ),
-               ( "!#$%<>",  0x10 ),
+               ( "!#$%",    0x10 ),
                ( "*",       0x0E ),
                ( ")",       0x07 ),
                ( '"',       0x05 ),
                ( ":",       0x01 ),
-               ( "^",      -0x10 ),
-               ( "_",      -0x18 ),
-               ( "{}|~",   -0x1E ),
-               ( "@",      -0x32 ),
-               ( "?",      -0x38 ),
+               ( "@",      -0x0E ),
+               ( "<>?",    -0x10 ),
+               ( "~",      -0x1E ),
+               ( "{}|",    -0x20 ),
+               ( "^",      -0x28 ),
+               ( "_",      -0x32 ),
        )
 
        listOfLists = []
index 18d0547e5792ca59a817248e98c103cf024cb55c..4206a011d051e7ef3b199c7b86a109ed422c89ab 100644 (file)
@@ -71,8 +71,8 @@ hid_lookup_dictionary = dict([
        ( ('USB', 0x2C), 'KEY_SPACE' ),
        ( ('USB', 0x2D), 'KEY_MINUS' ),
        ( ('USB', 0x2E), 'KEY_EQUAL' ),
-       ( ('USB', 0x2F), 'KEY_LEFT_BRACE' ),
-       ( ('USB', 0x30), 'KEY_RIGHT_BRACE' ),
+       ( ('USB', 0x2F), 'KEY_LEFT_BRACKET' ),
+       ( ('USB', 0x30), 'KEY_RIGHT_BRACKET' ),
        ( ('USB', 0x31), 'KEY_BACKSLASH' ),
        ( ('USB', 0x32), 'KEY_NUMBER' ),
        ( ('USB', 0x33), 'KEY_SEMICOLON' ),
@@ -198,8 +198,8 @@ hid_lookup_dictionary = dict([
        ( ('USB', 0xB5), 'KEY_CURRENCY_SUB' ),
        ( ('USB', 0xB6), 'KEYPAD_LPAREN' ),
        ( ('USB', 0xB7), 'KEYPAD_RPAREN' ),
-       ( ('USB', 0xB8), 'KEYPAD_LBRACE' ),
-       ( ('USB', 0xB9), 'KEYPAD_RBRACE' ),
+       ( ('USB', 0xB8), 'KEYPAD_LBRACKET' ),
+       ( ('USB', 0xB9), 'KEYPAD_RBRACKET' ),
        ( ('USB', 0xBA), 'KEYPAD_TAB' ),
        ( ('USB', 0xBB), 'KEYPAD_BACKSPACE' ),
        ( ('USB', 0xBC), 'KEYPAD_A' ),
@@ -835,8 +835,8 @@ kll_hid_lookup_dictionary['USBCode'] = dict([
        ( 'SPACE', ('USB', 0x2C) ), ( 'SPACEBAR', ('USB', 0x2C) ),
        ( '-', ('USB', 0x2D) ), ( 'MINUS', ('USB', 0x2D) ),
        ( '=', ('USB', 0x2E) ), ( 'EQUALS', ('USB', 0x2E) ), ( 'EQUAL', ('USB', 0x2E) ),
-       ( '{', ('USB', 0x2F) ), ( 'LEFT BRACE', ('USB', 0x2F) ), ( 'LBRACE', ('USB', 0x2F) ),
-       ( '}', ('USB', 0x30) ), ( 'RIGHT BRACE', ('USB', 0x30) ), ( 'RBRACE', ('USB', 0x30) ),
+       ( '[', ('USB', 0x2F) ), ( 'LEFT BRACKET', ('USB', 0x2F) ), ( 'LBRACKET', ('USB', 0x2F) ), ( 'LEFT BRACE', ('USB', 0x2F) ), ( 'LBRACE', ('USB', 0x2F) ),
+       ( ']', ('USB', 0x30) ), ( 'RIGHT BRACKET', ('USB', 0x30) ), ( 'RBRACKET', ('USB', 0x30) ), ( 'RIGHT BRACE', ('USB', 0x30) ), ( 'RBRACE', ('USB', 0x30) ),
        ( '\\', ('USB', 0x31) ), ( 'BACKSLASH', ('USB', 0x31) ),
        ( '#', ('USB', 0x32) ), ( 'NUMBER', ('USB', 0x32) ), ( 'HASH', ('USB', 0x32) ),
        ( ';', ('USB', 0x33) ), ( 'SEMICOLON', ('USB', 0x33) ),