summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGilles Castel <gilles@castel.dev>2020-01-22 10:17:53 +0100
committerGitHub <noreply@github.com>2020-01-22 10:17:53 +0100
commitd3b26f2a5736f37b470880ca2931465b3afef03a (patch)
tree156425b3fc3e94fd86a4f2ddcbdf74cec65ce456
parent591ffe2d0be2ef0e60bd9362dd147274e173b9b0 (diff)
parenta8b8eaf06d83451c1023dab3d4e1288e76c26b81 (diff)
Merge pull request #7 from feynmanliang/patch-1
Support F-key shortcuts
-rw-r--r--normal.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/normal.py b/normal.py
index f8c9e90..7fadcc9 100644
--- a/normal.py
+++ b/normal.py
@@ -47,15 +47,18 @@ def normal_mode(self, event, char):
if event.type != X.KeyRelease:
return
+ handled = False
if len(pressed) > 1:
paste_style(self, pressed)
-
- if len(pressed) == 1:
+ handled = True
+ elif len(pressed) == 1:
# Get the only element in pressed
ev = next(iter(pressed))
handled = handle_single_key(self, ev)
- if not handled:
- replay(self)
+
+ # replay events to Inkscape if we couldn't handle them
+ if not handled:
+ replay(self)
events.clear()
pressed.clear()