about summary refs log tree commit diff
path: root/exwm-input.el
diff options
context:
space:
mode:
authorChris Feng <chris.w.feng@gmail.com>2016-07-12T03·55+0800
committerChris Feng <chris.w.feng@gmail.com>2016-07-12T03·55+0800
commit9c8e95b376124ca192e65a3dca33dd40ca6ecee3 (patch)
tree475c576868a9047954e34a58f2d6f7026d56a5f1 /exwm-input.el
parent4a1b177bceb7e47ea75ddf779bf609d563713ffe (diff)
Fix a bug of simulation keys
* exwm-input.el (exwm-input--on-KeyPress-line-mode)
(exwm-input--on-KeyPress-char-mode): Force events to be added to
`this-command-keys'.
(exwm-input-send-next-key): The read event can now be (t . EVENT).
Diffstat (limited to 'exwm-input.el')
-rw-r--r--exwm-input.el10
1 files changed, 8 insertions, 2 deletions
diff --git a/exwm-input.el b/exwm-input.el
index e786f0defd5f..2622253bae65 100644
--- a/exwm-input.el
+++ b/exwm-input.el
@@ -294,7 +294,9 @@ It's updated in several occasions, and only used by `exwm-input--set-focus'.")
                      (memq event exwm-input--simulation-prefix-keys)))
         (setq mode xcb:Allow:AsyncKeyboard)
         (unless minibuffer-window (setq exwm-input--during-key-sequence t))
-        (push event unread-command-events))
+        ;; Feed this event to command loop.  Also force it to be added to
+        ;; `this-command-keys'.
+        (push (cons t event) unread-command-events))
       (xcb:+request exwm--connection
           (make-instance 'xcb:AllowEvents
                          :mode (or mode xcb:Allow:ReplayKeyboard)
@@ -317,7 +319,9 @@ It's updated in several occasions, and only used by `exwm-input--set-focus'.")
           (setq exwm-input--temp-line-mode t
                 exwm-input--during-key-sequence t)
           (exwm-input--grab-keyboard))  ;grab keyboard temporarily
-        (push event unread-command-events))))
+        ;; Feed this event to command loop.  Also force it to be added to
+        ;; `this-command-keys'.
+        (push (cons t event) unread-command-events))))
   (xcb:+request exwm--connection
       (make-instance 'xcb:AllowEvents
                      :mode xcb:Allow:AsyncKeyboard
@@ -443,6 +447,8 @@ It's updated in several occasions, and only used by `exwm-input--set-focus'.")
           (setq key (read-key (format "Send key: %s (%d/%d)"
                                       (key-description keys)
                                       (1+ i) times)))
+          (when (and (listp key) (eq (car key) t))
+            (setq key (cdr key)))
           (unless (listp key) (throw 'break nil))))
       (setq exwm-input--during-key-sequence nil)
       (setq keys (vconcat keys (vector key)))