diff options
author | Ben Konrath <ben@bagu.org> | 2009-11-25 14:39:00 -0500 |
---|---|---|
committer | Ben Konrath <ben@bagu.org> | 2009-11-25 14:39:00 -0500 |
commit | 590cbea96cade12c33a4740f36fc2a95daab4ab0 (patch) | |
tree | 8b7373ce162b4c93d39be31e02a100999176e706 | |
parent | f2f3af89522432065dd54d88cd81b8902de04b34 (diff) | |
download | caribou-590cbea96cade12c33a4740f36fc2a95daab4ab0.tar.gz |
re-work how keysyms are handled
-rw-r--r-- | src/keyboardcommon.py | 14 | ||||
-rw-r--r-- | src/keysyms.py | 13 | ||||
-rw-r--r-- | src/qwerty.py | 24 |
3 files changed, 25 insertions, 26 deletions
diff --git a/src/keyboardcommon.py b/src/keyboardcommon.py deleted file mode 100644 index 2593a83..0000000 --- a/src/keyboardcommon.py +++ /dev/null @@ -1,14 +0,0 @@ -# from OnBoard.utils.py -keysyms = { "space" : 0xff80, - "insert" : 0xff9e, - "home" : 0xff50, - "page_up" : 0xff55, - "page_down" : 0xff56, - "end" : 0xff57, - "delete" : 0xff9f, - "return" : 0xff0d, - "backspace" : 0xff08, - "left" : 0xff51, - "up" : 0xff52, - "right" : 0xff53, - "down" : 0xff54 } diff --git a/src/keysyms.py b/src/keysyms.py new file mode 100644 index 0000000..1382e05 --- /dev/null +++ b/src/keysyms.py @@ -0,0 +1,13 @@ +space = 0xff80 +insert = 0xff9e +home = 0xff50 +page_up = 0xff55 +page_down = 0xff56 +end = 0xff57 +delete = 0xff9f +enter = 0xff0d +backspace = 0xff08 +left = 0xff51 +up = 0xff52 +right = 0xff53 +down = 0xff54 diff --git a/src/qwerty.py b/src/qwerty.py index 5637fce..c5d8695 100644 --- a/src/qwerty.py +++ b/src/qwerty.py @@ -1,6 +1,6 @@ # -*- coding: UTF-8 -*- -import keyboardcommon +import keysyms # TODO add horizontal keysize - will be able to specify a mulitplier # TODO add key colour @@ -10,19 +10,19 @@ import keyboardcommon # TODO finish numbers and punctuation layout # key format ("label", keysym) -bs = ("⌫", keyboardcommon.keysyms["backspace"]) -# return -rt = ("↲", keyboardcommon.keysyms["return"]) +bs = ("⌫", keysyms.backspace) +# enter +en = ("↲", keysyms.enter) # space -sp = ("␣", keyboardcommon.keysyms["space"]) +sp = ("␣", keysyms.space) # up -up = ("↑", keyboardcommon.keysyms["up"]) +up = ("↑", keysyms.up) # down -dn = ("↓", keyboardcommon.keysyms["down"]) +dn = ("↓", keysyms.down) # left -le = ("←", keyboardcommon.keysyms["left"]) +le = ("←", keysyms.left) # right -ri = ("→", keyboardcommon.keysyms["right"]) +ri = ("→", keysyms.right) # define keys to switch layers here @@ -39,15 +39,15 @@ lt = ("abc", "lowercase") # keyboard layouts - put a single utf-8 character or a tuple defined above lowercase = ( ("?", "q", "w", "e", "r", "t", "y", "u", "i", "o", "p"), ( np, "a", "s", "d", "f", "g", "h", "j", "k", "l", bs), - ( su, "z", "x", "c", "v", "b", "n", "m", ".", sp, rt) ) + ( su, "z", "x", "c", "v", "b", "n", "m", ".", sp, en) ) uppercase = ( ("?", "Q", "W", "E", "R", "T", "Y", "U", "I", "O", "P"), ( np, "A", "S", "D", "F", "G", "H", "J", "K", "L", bs), - ( sd, "Z", "X", "C", "V", "B", "N", "M", ".", sp, rt) ) + ( sd, "Z", "X", "C", "V", "B", "N", "M", ".", sp, en) ) num_punct = ( ("!", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0"), ( lt, "@", "$", "/", "+", "-", up, "\"", ",", "#", bs), - ("'", "(", ")", ";", ":", le, dn, ri, ".", sp, rt) ) + ("'", "(", ")", ";", ":", le, dn, ri, ".", sp, en) ) # the layout that appears in position 0 will be visible # when the keyboard is first created |