summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Holland <william.holland@codethink.co.uk>2015-05-28 23:53:40 +0100
committerWilliam Holland <william.holland@codethink.co.uk>2015-05-28 23:53:40 +0100
commit3bc11fa4cdbc89c6c1fcb712afee69cfda5e5629 (patch)
tree0d6b2fc07ad4394bd152aa960b2c8a71dcd099d5
parent29899c4d3cef97c540e83ffc5f696cd467853280 (diff)
downloadkeyboard-python-3bc11fa4cdbc89c6c1fcb712afee69cfda5e5629.tar.bz2
Add README
-rw-r--r--README41
1 files changed, 41 insertions, 0 deletions
diff --git a/README b/README
new file mode 100644
index 0000000..0e74ee4
--- /dev/null
+++ b/README
@@ -0,0 +1,41 @@
+Keyboard-python is a simple module for parsing keyboard input.
+It is useful because it can tell you keypresses without the need
+for the Enter key to be pressed and can parse the following:
+
+F-keys
+Home
+End
+PageUp
+PageDown
+Tab
+Insert
+Delete
+Escape
+Alt modified keys
+Ctrl modified keys
+
+Example:
+
+ from keyboardpython import key, getkey
+
+ alt_A = key.Key('A',key.ALT)
+ alt_a = key.Key('a',key.ALT)
+
+ k = getkey()
+
+ if k == alt_A:
+ print "You pressed Alt+A!"
+ elif k == alt_a:
+ print "You pressed Alt+a!"
+ elif k.has_modifier(key.ALT):
+ print "You pressed Alt but not A"
+ elif k.name 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