summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Holland <william.holland@codethink.co.uk>2015-05-30 22:29:32 +0100
committerWilliam Holland <william.holland@codethink.co.uk>2015-05-30 22:29:32 +0100
commit95307cc4ac5b6d9d901b997197d08a3fb6f5634e (patch)
treed915cd71d3fc1b62666d8e8c6cd76b9b84dbeeac
parent64377b83e7d900578cc70abfbf8d52d668998511 (diff)
downloadkeyboard-python-95307cc4ac5b6d9d901b997197d08a3fb6f5634e.tar.bz2
Make Key and KeyCombination comparible
-rw-r--r--keyboardpython/key.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/keyboardpython/key.py b/keyboardpython/key.py
index efd6226..5e2d618 100644
--- a/keyboardpython/key.py
+++ b/keyboardpython/key.py
@@ -32,7 +32,8 @@ class KeyCombination:
return to_print
def __eq__(self,other):
- if not isinstance(other,KeyCombination): return False
+ if not isinstance(other,KeyCombination):
+ if not isinstance(other,Key): return False
return str(self) == str(other)
def __ne__(self,other):
@@ -79,7 +80,8 @@ class Key:
self.name = name
def __eq__(self,other):
- if not isinstance(other,Key): return False
+ if not isinstance(other,KeyCombination):
+ if not isinstance(other,Key): return False
return str(self) == str(other)
def __ne__(self,other):