From 14986ea4dd15b614dcb87a13b670ebf42a25aea0 Mon Sep 17 00:00:00 2001 From: malc Date: Tue, 29 Nov 2016 18:11:31 +0300 Subject: [PATCH] Move zero keycode handling where it belongs --- main.ml | 9 +++------ wsi.ml | 3 ++- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/main.ml b/main.ml index 3f14c5e..b968786 100644 --- a/main.ml +++ b/main.ml @@ -2892,7 +2892,7 @@ object (self) set1 active first qsearch ); - | _ when (key != 0 && not (Wsi.isspecialkey key)) -> + | _ when not (Wsi.isspecialkey key) -> let pattern = m_qsearch ^ toutf8 key in let active, first = match search m_active pattern 1 with @@ -2985,8 +2985,7 @@ object (self) method key key mask = match state.mode with | Textentry te -> - (* for whatever reason mode switch emits zero first - skip it *) - if key != 0 then textentrykeyboard key mask te; + textentrykeyboard key mask te; coe self | Birdseye _ | View | LinkNav _ -> self#key1 key mask @@ -6039,9 +6038,7 @@ let uioh = object method key key mask = begin match state.mode with - | Textentry textentry -> - (* for whatever reason mode switch emits zero first - skip it *) - if key != 0 then textentrykeyboard key mask textentry + | Textentry textentry -> textentrykeyboard key mask textentry | Birdseye birdseye -> birdseyekeyboard key mask birdseye | View -> viewkeyboard key mask | LinkNav linknav -> linknavkeyboard key mask linknav diff --git a/wsi.ml b/wsi.ml index 61b88f5..5ab140c 100644 --- a/wsi.ml +++ b/wsi.ml @@ -523,7 +523,8 @@ let readresp sock = let keysym = getkeysym code mask in vlog "keysym = %x %c mask %#x code %d" keysym (Char.unsafe_chr keysym) mask code; - state.t#key keysym mask; + if keysym != 0 + then state.t#key keysym mask | 3 -> (* key release *) if Array.length state.keymap > 0 -- 2.11.4.GIT