about summary refs log tree commit diff
path: root/exwm-input.el
diff options
context:
space:
mode:
Diffstat (limited to 'exwm-input.el')
-rw-r--r--exwm-input.el10
1 files changed, 10 insertions, 0 deletions
diff --git a/exwm-input.el b/exwm-input.el
index e5828126f9a3..61858e93d2cf 100644
--- a/exwm-input.el
+++ b/exwm-input.el
@@ -567,6 +567,16 @@ This value should always be overwritten.")
       (exwm-input--update-mode-line id)
       (force-mode-line-update))))
 
+;;;###autoload
+(defun exwm-input-toggle-keyboard (&optional id)
+  "Toggle between 'line-mode' and 'char-mode'."
+  (interactive (list (exwm--buffer->id (window-buffer))))
+  (when id
+    (with-current-buffer (exwm--id->buffer id)
+      (if exwm--keyboard-grabbed
+          (exwm-input-release-keyboard id)
+        (exwm-reset)))))
+
 (defun exwm-input--fake-key (event)
   "Fake a key event equivalent to Emacs event EVENT."
   (let* ((keysym (xcb:keysyms:event->keysym exwm--connection event))