From ea7ff93a1030132c2098602b7b9180521cea3dcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacek=20TeMPOraL=20Z=C5=82ydach?= <temporal.pl@gmail.com> Date: Sun, 29 Oct 2017 18:31:45 +0100 Subject: [PATCH] Enabled proper handling of modifier keys. Solves issue #24. --- clim/input-protocol.lisp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/clim/input-protocol.lisp b/clim/input-protocol.lisp index 859b067c..ea09091c 100644 --- a/clim/input-protocol.lisp +++ b/clim/input-protocol.lisp @@ -142,6 +142,7 @@ (let ((char (keyboard-event-character event)) (keysym (keyboard-event-key-name event)) #+(or aclpc acl86win32) (modstate (slot-value event 'silica::modifier-state)) + #-(or aclpc acl86win32) (modstate (event-modifier-state event)) temp) (cond ((and (member event *asynchronous-abort-gestures* :test #'keyboard-event-matches-gesture-name-p) @@ -149,7 +150,7 @@ (setq temp (frame-top-level-process temp))) (process-interrupt temp #'(lambda () (process-abort-gesture stream event)))) ((and (characterp char) - #+(or aclpc acl86win32) (not (> modstate +shift-key+)) + (not (> modstate +shift-key+)) ; we have a modifier key other than SHIFT active - need to put full event into the queue (in another branch) (or (ordinary-char-p char) (diacritic-char-p char))) (queue-put (stream-input-buffer stream) char)) @@ -387,18 +388,15 @@ (process-event-locally stream gesture) nil) -(defmethod receive-gesture - ((stream input-protocol-mixin) gesture) +(defmethod receive-gesture ((stream input-protocol-mixin) gesture) ;; don't translate it gesture) -(defmethod receive-gesture - ((stream input-protocol-mixin) (gesture character)) +(defmethod receive-gesture ((stream input-protocol-mixin) (gesture character)) (process-abort-or-accelerator-gesture stream gesture) gesture) -(defmethod receive-gesture - ((stream input-protocol-mixin) (gesture key-press-event)) +(defmethod receive-gesture ((stream input-protocol-mixin) (gesture key-press-event)) (process-abort-or-accelerator-gesture stream gesture) gesture) -- GitLab