aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples
diff options
context:
space:
mode:
authorGravatar keis <keijser@gmail.com>2009-10-14 18:00:17 +0200
committerGravatar keis <keijser@gmail.com>2009-10-15 04:04:00 +0200
commit3be7f04d436a7a08ae0ea33d73cc4c73173ae63b (patch)
tree0ae55898481c1c6f8a68d071f6f8ebec6893866b /examples
parent02aa78b2d2e8117de894ea75d87f437d94458738 (diff)
add backspace event.
Diffstat (limited to 'examples')
-rw-r--r--examples/data/uzbl/scripts/plugins/keycmd.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/examples/data/uzbl/scripts/plugins/keycmd.py b/examples/data/uzbl/scripts/plugins/keycmd.py
index 565d054..467053b 100644
--- a/examples/data/uzbl/scripts/plugins/keycmd.py
+++ b/examples/data/uzbl/scripts/plugins/keycmd.py
@@ -310,6 +310,14 @@ def keycmd_strip_word(uzbl, sep):
update_event(uzbl, k, False)
+def keycmd_backspace(uzbl, _foo):
+ k = get_keylet(uzbl)
+ k.cmd = k.cmd[:k.cursor-1] + k.cmd[k.cursor:]
+ k.cursor -= 1
+
+ update_event(uzbl, k, False)
+
+
def set_cursor_pos(uzbl, index):
'''Allow setting of the cursor position externally. Supports negative
indexing.'''
@@ -339,6 +347,7 @@ def init(uzbl):
'KEY_RELEASE': key_release,
'SET_KEYCMD': set_keycmd,
'KEYCMD_STRIP_WORD': keycmd_strip_word,
+ 'KEYCMD_BACKSPACE': keycmd_backspace,
'SET_CURSOR_POS': set_cursor_pos}
uzbl.connect_dict(connects)