summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Holland <william.holland@codethink.co.uk>2015-05-30 21:40:53 +0100
committerWilliam Holland <william.holland@codethink.co.uk>2015-05-30 22:13:47 +0100
commit613cbf3015672acf2174aa6950c47051eaa4eb6e (patch)
tree92211663cc2a39c7f912b8fbe0746100b441be84
parent6272a668b40e84fc720fc6ceba4301a9d2f8665d (diff)
downloadkeyboard-python-613cbf3015672acf2174aa6950c47051eaa4eb6e.tar.bz2
Make sorting keys in KeyCombination consitent
-rw-r--r--keyboardpython/key.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/keyboardpython/key.py b/keyboardpython/key.py
index fa26b25..fec1075 100644
--- a/keyboardpython/key.py
+++ b/keyboardpython/key.py
@@ -25,7 +25,6 @@ class KeyCombination:
else:
assert isinstance(k,Key)
self.keys = list(set(keys))
- self.keys.sort(key=lambda x: x.name)
def __str__(self):
keys = self.keys
@@ -53,7 +52,7 @@ class KeyCombination:
assert isinstance(_key,Key)
if self.contains_key(_key): return
self.keys.append(_key)
- self.keys.sort(key=lambda x: x.name)
+ self.keys = list(set(keys))
def remove_key(self,key):
assert isinstance(_key,Key)
@@ -65,7 +64,7 @@ class KeyCombination:
assert isinstance(key_comb,KeyCombination)
for _key in key_comb.keys:
self.keys.append(_key)
- self.keys.sort(key=lambda x: x.name)
+ self.keys = list(set(keys))
def diff(self,key_comb):
assert isinstance(key_comb,KeyCombination)