Forward keys defined in `exwm-mode-map' to Emacs by default

* exwm-input.el (exwm-input-prefix-keys): Remove ?\C-c.
(exwm-input--on-KeyPress-line-mode):
* exwm-core.el (): Detect keys in `exwm-mode-map' in line-mode.
This commit is contained in:
Chris Feng 2018-02-26 00:23:40 +08:00
parent 7cef4320cc
commit a6cfe3f22d
2 changed files with 8 additions and 2 deletions

View file

@ -189,6 +189,7 @@ least SECS seconds later."
(active-minibuffer-window) (active-minibuffer-window)
(memq last-input-event exwm-input--global-prefix-keys) (memq last-input-event exwm-input--global-prefix-keys)
(memq last-input-event exwm-input-prefix-keys) (memq last-input-event exwm-input-prefix-keys)
(assq last-input-event (cdr exwm-mode-map))
(gethash last-input-event exwm-input--simulation-keys)) (gethash last-input-event exwm-input--simulation-keys))
(set-transient-map (make-composed-keymap (list exwm-mode-map (set-transient-map (make-composed-keymap (list exwm-mode-map
global-map))) global-map)))

View file

@ -44,8 +44,12 @@
:group 'exwm) :group 'exwm)
(defcustom exwm-input-prefix-keys (defcustom exwm-input-prefix-keys
'(?\C-c ?\C-x ?\C-u ?\C-h ?\M-x ?\M-` ?\M-& ?\M-:) '(?\C-x ?\C-u ?\C-h ?\M-x ?\M-` ?\M-& ?\M-:)
"List of prefix keys EXWM should forward to Emacs when in line-mode." "List of prefix keys EXWM should forward to Emacs when in line-mode.
The point is to make keys like 'C-x C-f' forwarded to Emacs in line-mode.
There is no need to add prefix keys for global/simulation keys or those
defined in `exwm-mode-map' here."
:type '(repeat key-sequence) :type '(repeat key-sequence)
:get (lambda (symbol) :get (lambda (symbol)
(mapcar #'vector (default-value symbol))) (mapcar #'vector (default-value symbol)))
@ -562,6 +566,7 @@ instead."
;; ;;
(memq event exwm-input--global-prefix-keys) (memq event exwm-input--global-prefix-keys)
(memq event exwm-input-prefix-keys) (memq event exwm-input-prefix-keys)
(assq event (cdr exwm-mode-map))
(gethash event exwm-input--simulation-keys))) (gethash event exwm-input--simulation-keys)))
(setq mode xcb:Allow:AsyncKeyboard) (setq mode xcb:Allow:AsyncKeyboard)
(exwm-input--cache-event event)) (exwm-input--cache-event event))