diff options
author | Chris Feng <chris.w.feng@gmail.com> | 2017-02-24T15·30+0800 |
---|---|---|
committer | Chris Feng <chris.w.feng@gmail.com> | 2017-02-24T15·30+0800 |
commit | b79a3c52a5ebd2a663e47fe6d473400cf38bdcf4 (patch) | |
tree | 4195c10277fae584c3b94a28ed3673496f13ee03 /exwm-input.el | |
parent | f299ca5ed7056842aa59e9978061bca650316a71 (diff) | |
parent | d0e98957485afa6a91d3c8be1520d65e46987718 (diff) |
Merge branch 'Stebalien/expose-line-mode-passthrough' into externals/exwm
Diffstat (limited to 'exwm-input.el')
-rw-r--r-- | exwm-input.el | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/exwm-input.el b/exwm-input.el index d410bec7912e..809f41ecec19 100644 --- a/exwm-input.el +++ b/exwm-input.el @@ -420,7 +420,7 @@ This value should always be overwritten.") (defvar exwm-input--during-command nil "Indicate whether between `pre-command-hook' and `post-command-hook'.") -(defvar exwm-input--line-mode-passthrough nil +(defvar exwm-input-line-mode-passthrough nil "Non-nil makes 'line-mode' forwards all events to Emacs.") (defvar exwm-input--line-mode-cache nil "Cache for incomplete key sequence.") @@ -449,7 +449,7 @@ This value should always be overwritten.") (setq event (xcb:keysyms:keysym->event exwm--connection (car keysym) (logand state (lognot (cdr keysym))))) - (or exwm-input--line-mode-passthrough + (or exwm-input-line-mode-passthrough exwm-input--during-command ;; Forward the event when there is an incomplete key ;; sequence or when the minibuffer is active. @@ -629,16 +629,15 @@ This value should always be overwritten.") (let (key keys) (dotimes (i times) ;; Skip events not from keyboard - (setq exwm-input--line-mode-passthrough t) - (catch 'break - (while t - (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--line-mode-passthrough nil) + (let ((exwm-input-line-mode-passthrough t)) + (catch 'break + (while t + (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 keys (vconcat keys (vector key))) (exwm-input--fake-key key)))) |