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-09-22T11·10+0800
committerChris Feng <chris.w.feng@gmail.com>2016-09-22T11·10+0800
commitf96f565d548521a87e0f3a23bfab7f5b836e4640 (patch)
tree5b9bf6a9d37f226ff77a2468427d9fd52f461418 /exwm-input.el
parent43af6bb6a295fc843bd8b1f890cca1c246293e90 (diff)
Add support for keyboard macro
* exwm-core.el (exwm--kmacro-map): New keymap used when executing
keyboard macros.
(exwm-mode): Use `exwm--kmacro-map' to override the default keymap.
* exwm-input.el (exwm-input--on-KeyPress-line-mode): Send extra key
events when defining keyboard macros.
Diffstat (limited to 'exwm-input.el')
-rw-r--r--exwm-input.el6
1 files changed, 5 insertions, 1 deletions
diff --git a/exwm-input.el b/exwm-input.el
index dd65b6e8f12f..8101cbd52882 100644
--- a/exwm-input.el
+++ b/exwm-input.el
@@ -454,7 +454,11 @@ This value should always be overwritten.")
                              :propagate 0
                              :destination (slot-value key-press 'event)
                              :event-mask xcb:EventMask:NoEvent
-                             :event raw-data))))
+                             :event raw-data)))
+        ;; Make Emacs aware of this event when defining keyboard macros.
+        (when (and defining-kbd-macro event)
+          (set-transient-map '(keymap (t . (lambda () (interactive)))))
+          (exwm-input--unread-event event)))
       (xcb:+request exwm--connection
           (make-instance 'xcb:AllowEvents
                          :mode mode