From 2376b7c255d858e0a6a502cb72a0cdce24447385 Mon Sep 17 00:00:00 2001 From: fdev31 Date: Thu, 18 Apr 2019 22:52:06 +0200 Subject: [PATCH] implement fast browsing of the unicode input useful for zones with icons --- kittens/unicode_input/main.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/kittens/unicode_input/main.py b/kittens/unicode_input/main.py index 5746a5e55..22e5b341c 100644 --- a/kittens/unicode_input/main.py +++ b/kittens/unicode_input/main.py @@ -391,6 +391,22 @@ class UnicodeInput(Handler): self.refresh() def on_key(self, key_event): + if self.mode is HEX and key_event.type is not RELEASE and not key_event.mods: + if key_event.key is TAB: + val = int(self.line_edit.current_input, 16) + self.line_edit.current_input = hex(val+0x10)[2:] + self.refresh() + return + if key_event.key is UP: + val = int(self.line_edit.current_input, 16) + self.line_edit.current_input = hex(val+1)[2:] + self.refresh() + return + if key_event.key is DOWN: + val = int(self.line_edit.current_input, 16) + self.line_edit.current_input = hex(val-1)[2:] + self.refresh() + return if self.mode is NAME and key_event.type is not RELEASE and not key_event.mods: if key_event.key is TAB: if key_event.mods == SHIFT: