diff options
author | Adrián Medraño Calvo <adrian@medranocalvo.com> | 2018-10-08T12·00+0000 |
---|---|---|
committer | Adrián Medraño Calvo <adrian@medranocalvo.com> | 2018-10-08T12·00+0000 |
commit | dff1ef6a3c36fd7d8b3a3bafbd66a91b8e576b26 (patch) | |
tree | 3cee64b88e0658c8e0d8a57297c875fe169fcb8a /exwm-core.el | |
parent | 472f7cb82b67b98843f10c12e6bda9b8ae7262bc (diff) |
Simplify input handling
No functional change. * exwm-input.el (exwm-input--current-input-mode): New function indicating keyboard input mode. (exwm-input--on-KeyPress, exwm-input--update-mode-line): Use `exwm-input--current-input-mode'. (exwm-input-grab-keyboard, exwm-input-release-keyboard) (exwm-input--update-mode-line): Simplify. * exwh-core.el (exwm--on-KeyPress): Remove variable, use `exwm--keyboard-grabbed' and `exwm-input--current-input-mode' instead.
Diffstat (limited to 'exwm-core.el')
-rw-r--r-- | exwm-core.el | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/exwm-core.el b/exwm-core.el index 66eb98cf905f..612a26f59fde 100644 --- a/exwm-core.el +++ b/exwm-core.el @@ -158,9 +158,7 @@ least SECS seconds later." (defvar-local exwm--mode-line-format nil) ;save mode-line-format (defvar-local exwm--floating-frame-position nil) ;set when hidden. (defvar-local exwm--fixed-size nil) ;fixed size -(defvar-local exwm--keyboard-grabbed nil) ;Keyboard grabbed. -(defvar-local exwm--on-KeyPress ;KeyPress event handler - #'exwm-input--on-KeyPress-line-mode) +(defvar-local exwm--input-mode 'line-mode) ;Keyboard grabbed. ;; Properties (defvar-local exwm--desktop nil "_NET_WM_DESKTOP.") (defvar-local exwm-window-type nil "_NET_WM_WINDOW_TYPE.") @@ -252,7 +250,7 @@ least SECS seconds later." "*Keyboard*" "---" ["Toggle keyboard mode" exwm-input-toggle-keyboard] - ["Send key" exwm-input-send-next-key exwm--keyboard-grabbed] + ["Send key" exwm-input-send-next-key (eq exwm--input-mode 'line-mode)] ;; This is merely a reference. ("Send simulation key" :filter (lambda (&rest _args) |