projects
/
matthijs
/
upstream
/
mobilegtd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5f9ae3b
)
Add key_shortname function.
author
Matthijs Kooijman
<matthijs@stdin.nl>
Tue, 3 Nov 2009 14:11:47 +0000
(15:11 +0100)
committer
Matthijs Kooijman
<matthijs@stdin.nl>
Tue, 3 Nov 2009 14:11:47 +0000
(15:11 +0100)
This function contains code previously in another class.
src/gui/gui.py
patch
|
blob
|
history
diff --git
a/src/gui/gui.py
b/src/gui/gui.py
index cf9536b79f7a3496a173af2ea22332b5a55d306a..a07091b3fb06126b37812e7770ab2b4f746041f9 100644
(file)
--- a/
src/gui/gui.py
+++ b/
src/gui/gui.py
@@
-68,6
+68,15
@@
def get_key(key_name):
key=eval('EKey%s'%key_name)
return key
+def key_shortname(key_name):
+ """ Find the one-character name for a key """
+ if not key_name:
+ return None
+ elif key_name == 'Backspace':
+ return 'C'
+ else:
+ return key_name
+
def all_key_names():
return filter(lambda entry:entry[0:4]=='EKey',dir(key_codes))
def all_key_values():