aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples/data/uzbl/plugins/keycmd.py
diff options
context:
space:
mode:
authorGravatar Mason Larobina <mason.larobina@gmail.com>2009-11-19 20:39:18 +0800
committerGravatar Mason Larobina <mason.larobina@gmail.com>2009-11-19 20:39:18 +0800
commitd23d26b84d76dcd0839d55602345e72a297d0049 (patch)
treeb77b6cdc9e722c46b6909324d7354bebf411f376 /examples/data/uzbl/plugins/keycmd.py
parent00f7036a0134792e83bb7ebce0724be0ac1175a3 (diff)
General bugfixes in the bind plugin.
1. Use sets in the keycmd plugin for the held list. 2. Remove the bind filter function in the bind plugin. 3. Compare the mod_cmd and keylet.held sets instead of using a string comparison to determine if the user is holding down the correct modkeys for any given bind. 4. Raise exceptions instead of printing errors in the bind plugin. 5. Raise the builtin SyntaxError exception for parsing failures.
Diffstat (limited to 'examples/data/uzbl/plugins/keycmd.py')
-rw-r--r--examples/data/uzbl/plugins/keycmd.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/examples/data/uzbl/plugins/keycmd.py b/examples/data/uzbl/plugins/keycmd.py
index 8961f74..976eee7 100644
--- a/examples/data/uzbl/plugins/keycmd.py
+++ b/examples/data/uzbl/plugins/keycmd.py
@@ -31,7 +31,7 @@ class Keylet(object):
def __init__(self):
# Modcmd tracking
- self.held = []
+ self.held = set()
self.modcmd = ''
self.is_modcmd = False
@@ -169,7 +169,7 @@ def clear_modcmd(uzbl, clear_held=False):
k.is_modcmd = False
k._repr_cache = False
if clear_held:
- k.held = []
+ k.held = set()
config = uzbl.get_config()
if 'modcmd' not in config or config['modcmd'] != '':
@@ -271,8 +271,7 @@ def key_press(uzbl, key):
k.held.remove('Tab')
if key not in k.held:
- k.held.append(key)
- k.held.sort()
+ k.held.add(key)
else:
k.is_modcmd = True