From c1f2498a1fe12761201b34af0428292c11456dab Mon Sep 17 00:00:00 2001 From: malc Date: Sun, 16 Dec 2012 02:31:48 +0400 Subject: [PATCH] Beat it into submission Just trying to follow pretty picture at http://www.neo-layout.org/ --- wsi.ml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/wsi.ml b/wsi.ml index 9e31c68..08d3cc8 100644 --- a/wsi.ml +++ b/wsi.ml @@ -378,15 +378,12 @@ let getmodifiermappingreq () = ;; let getkeysym code mask = - let shinc = (mask land 1) lxor ((mask land state.capslmask) lsr 1) in - let msh = ((mask land 0x10) lsr 4) - + ((mask land 0x20) lsr 5) - + ((mask land 0x40) lsr 6) - + ((mask land 0x80) lsr 7) - in - let index = (1 lsl msh) + shinc in + let shift = (mask land 1) lxor ((mask land state.capslmask) lsr 1) in + let mod3 = if mask land 0x80 = 0x80 then 4 else 0 in + let mod4 = if mask land 0x20 = 0x20 then 8 else 0 in + let index = mod3 + mod4 + shift in let keysym = state.keymap.(code-state.mink).(index) in - if shinc = 1 && keysym = 0 + if index land 1 = 1 && keysym = 0 then state.keymap.(code-state.mink).(index - 1) else keysym ;; -- 2.11.4.GIT