summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Holland <william.holland@codethink.co.uk>2015-06-07 13:44:01 +0100
committerWilliam Holland <william.holland@codethink.co.uk>2015-06-07 13:44:01 +0100
commit237f58a00a0375f200f40ccfd4db5ec4fc167d29 (patch)
tree67d42aeac208bfb1f68ee697bb6e4d989e060446
parent5eb9aade42d257125ac80e564b4a20c1ba4499d6 (diff)
downloadkeyboard-python-237f58a00a0375f200f40ccfd4db5ec4fc167d29.tar.bz2
Update README
-rw-r--r--README19
1 files changed, 7 insertions, 12 deletions
diff --git a/README b/README
index b1e8a84..1b6e647 100644
--- a/README
+++ b/README
@@ -17,29 +17,24 @@ Ctrl modified keys
Example:
import sys
- from keyboardpython import key, getkey
+ import keyboardpython as kbpy
- alt_A = key.Key('A',key.ALT)
- alt_a = key.Key('a',key.ALT)
+ alt_A = kbpy.Key('A',key.ALT)
+ alt_a = kbpy.Key('a',key.ALT)
fd = sys.stdin.fileno()
- set_to_read_key(fd)
+ kbpy.init(fd)
k = getkey(fd)
- reset_tty(fd)
+ kbpy.close(fd)
if k == alt_A:
print "You pressed Alt+A!"
elif k == alt_a:
print "You pressed Alt+a!"
- elif k.has_modifier(key.ALT):
+ elif k.contains_key(key.ALT):
print "You pressed Alt but not A"
- elif k.name in 'aA':
+ elif k.string in 'aA':
print "You pressed a but not Alt"
else:
print "You didn't press Alt or A :("
-PLEASE NOTE: The parser was written experimentally, it works on
-my machine but that is not to say that it will fully work for
-anybody else. If you encounter problems please email me at
-
-snowy[dot]the[dot]crow[at]gmail[dot]com