summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README45
1 files changed, 42 insertions, 3 deletions
diff --git a/README b/README
index 1b6e647..561d869 100644
--- a/README
+++ b/README
@@ -1,6 +1,6 @@
-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:
+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
@@ -14,6 +14,45 @@ Escape
Alt modified keys
Ctrl modified keys
+Objects:
+
+ Key(name)
+ Takes a string name.
+
+ KeyCombination(*keys):
+ Takes either instances of Key or strings which are given to new Key
+ instances as a name. If given only one Key it is considered
+ equivelent to that Key, e.g. KeyCombination('j') == Key('j') is true
+
+ contains_key(key):
+ return boolean determined by whether key is in the combination of
+ self
+
+ add_key(key):
+ add copy of key to the combination of self
+
+ add_keyCombination(instance_of_KeyCombination):
+ for each key in the instance given as an argument, add that key to
+ self
+
+ remove_key(key):
+ if the combination includes a key which shares a name with the key
+ given to the function then remove it from the combination
+
+ diff(instance_of_KeyCombination):
+ return a list of copies of keys that appear in exactly one of self
+ and the argument given
+
+Functions:
+
+ getkey(fd)
+ waits for keypress and returns returns KeyCombination containing all
+ keys pressed.
+
+ queue_keypresses(q,signal,fd)
+ takes a Queue q, a mutable with boolean value signal. While signal is
+ true it listens for keypresses putting them in q.
+
Example:
import sys