FS#277 - Button2 events broken
Attached to Project:
Uzbl
Opened by Steve Cain (stvc) - 2011-07-27 06:16:20 AM
Last edited by Brendan Taylor (bct) - 2011-07-31 06:47:20 PM
Opened by Steve Cain (stvc) - 2011-07-27 06:16:20 AM
Last edited by Brendan Taylor (bct) - 2011-07-31 06:47:20 PM
|
DetailsI just updated from an older version and I found that middle mouse button (Button2) events broke. I did a bisect and found that commit 06c8a781c660b573ac64eb40cace7aa81add3312 is the culprit. To fix, you can either undo that specific commit, or apply this patch:
diff --git a/examples/data/plugins/keycmd.py b/examples/data/plugins/keycmd.py index 1bb70e3..d0ec77b 100644 --- a/examples/data/plugins/keycmd.py +++ b/examples/data/plugins/keycmd.py @@ -216,10 +216,13 @@ def inject_str(str, index, inj): def parse_key_event(uzbl, key): ''' Build a set from the modstate part of the event, and pass all keys thro keylet = uzbl.keylet - - modstate, key = splitquoted(key) - modstate = set(['<%s>' % keylet.modmap_key(k) for k in modstate.split('|') + if ' ' in key: + modstate, key = splitquoted(key) + modstate = set(['<%s>' % keylet.modmap_key(k) for k in modstate.split(' + else: + modstate = set() + key = keylet.modmap_key(key) return modstate, key |
This task depends upon
Closed by Brendan Taylor (bct)
2011-07-31 06:47:20 PM
Reason for closing: Fixed
Additional comments about closing: thanks! merged into experimental, will release again soon.
2011-07-31 06:47:20 PM
Reason for closing: Fixed
Additional comments about closing: thanks! merged into experimental, will release again soon.
diff --git a/examples/data/plugins/keycmd.py b/examples/data/plugins/keycmd.py
index 1bb70e3..d0ec77b 100644
--- a/examples/data/plugins/keycmd.py
+++ b/examples/data/plugins/keycmd.py
@@ -216,10 +216,13 @@ def inject_str(str, index, inj):
def parse_key_event(uzbl, key):
''' Build a set from the modstate part of the event, and pass all keys through modmap '''
keylet = uzbl.keylet
-
- modstate, key = splitquoted(key)
- modstate = set(['<%s>' % keylet.modmap_key(k) for k in modstate.split('|') if k])
+ if ' ' in key:
+ modstate, key = splitquoted(key)
+ modstate = set(['<%s>' % keylet.modmap_key(k) for k in modstate.split('|') if k])
+ else:
+ modstate = set()
+
key = keylet.modmap_key(key)
return modstate, key
Steve, I tried to apply your patch with: patch -p1
and i get each time:
patch: **** malformed patch at line 6: def parse_key_event(uzbl, key):
Maybe this will help...
Cheers.
Here's the actual patch: http://pastebin.com/DKPyfJ4Y