about summary refs log tree commit diff
path: root/exwm-input.el (follow)
AgeCommit message (Collapse)AuthorFilesLines
2021-10-29 Update copyright year to 2021Adrián Medraño Calvo1-1/+1
2020-07-12 Make button events working with winner-modeChris Feng1-11/+17
* exwm-input.el (exwm-input--fake-last-command): Extracted for reuse. (exwm-input--on-ButtonPress, exwm-input--on-KeyPress-line-mode): Use it.
2020-05-06 Run hook upon input mode changeAdrián Medraño Calvo1-2/+8
* exwm-input.el (exwm-input-input-mode-change-hook): Add new hook for code to run upon input mode change. (exwm-input--grab-keyboard, exwm-input--release-keyboard): Run it.
2020-03-29 Merge branch 'Curiosidad-Racional/patch-1' into externals/exwmChris Feng1-13/+13
2020-03-29 Additional fix for winner-modeChris Feng1-3/+4
* exwm-input.el (exwm-input--on-KeyPress-line-mode): Check incomplete key presses (which generate no valid events) before running `pre-command-hook' and `post-command-hook'.
2020-03-21 Fixed fail update when current buffer differs from windowCuriosidad-Racional1-13/+13
Local variable `exwm--input-mode' from different buffer when current buffer don't contains #id window. `with-current-buffer' changes buffer after `cl-case' with local `exwm--input-mode'
2020-03-01 Make exwm-mode buffers work with winner-modeChris Feng1-6/+17
* exwm-input.el (exwm-input--noop): New placeholder command. (exwm-input--on-pre-command, exwm-input--on-post-command): Ignore this command. (exwm-input--on-KeyPress-line-mode): Set `last-command' to make winner-undo start over from the newest config; run `post-command-hook' to make winner-mode save configs; run `pre-command-hook' in case required by some other package.
2020-02-02 Update copyright year to 2020Chris Feng1-1/+1
2019-12-01 Avoid redundant input focus transferChris Feng1-28/+43
* exwm-input.el (exwm-input--set-focus): Check for current focused X window before making an input focus transfer. (exwm-input--on-buffer-list-update): Remove the `this-command' check.
2019-11-03 Add support for accessing keymaps in char-modeChris Feng1-0/+15
* exwm-input.el (exwm-input-invoke-factory): New macro for generating new commands that invoke corresponding prefix keys.
2019-10-27 Loosen the requirements for input focus updateChris Feng1-2/+1
* exwm-input.el (exwm-input--on-buffer-list-update): No more check on current buffer (the check on buffer name was dropped in a1cf0d9b8).
2019-10-13 Fix `exwm-input-set-simulation-key'Chris Feng1-3/+5
* exwm-input.el (exwm-input--read-keys): Return nil on empty input so that `exwm-input-set-simulation-key' can ignore it. (exwm-input-set-simulation-key): Improve prompt.
2019-10-07 Add minibuffer-keyboard-quit to the default pre-post-command-blacklistSteven Allen1-1/+3
* exwm-input.el (exwm-input-pre-post-command-blacklist): Add `minibuffer-keyboard-quit' to the blacklist. This is invoked when the user aborts a the minibuffer with C-g.
2019-10-06 Set the current buffer before handling key eventsSteven Allen1-12/+13
There's no guarantee that the global current buffer matches the selected window's buffer. For example, the following will output "*Messages*" regardless of the actual current buffer: (progn (run-at "1 sec" nil (lambda () (with-current-buffer (get-buffer "*Messages*") (sit-for 5)))) (run-at "2 sec" nil (lambda () (message (buffer-name))))) * exwm-input.el (exwm-input--on-KeyPress): Set the current buffer to selected window's current buffer.
2019-10-02 Avoid calling `x-focus-frame' on non-graphical framesChris Feng1-0/+2
* exwm-workspace.el (exwm-workspace--client-p): Also account for non-graphical frames. * exwm-input.el (exwm-input--on-minibuffer-setup) (exwm-input--on-minibuffer-exit): Exclude emacsclient frames.
2019-10-02 Allow customizing undetectable commandsChris Feng1-1/+5
* exwm-input.el (exwm-input-pre-post-command-blacklist): List of commands undetectable with `post-command-hook'. (exwm-input--on-pre-command): Use it.
2019-09-22 Make input focus continue to work after EXWM exitsChris Feng1-1/+8
* exwm-input.el (exwm-input--exit): Set input focus 'revert-to' to 'PointerRoot' so that user can set input focus to X windows with pointer after EXWM exits (and there's no other WM).
2019-09-22 Skip global keys unavailable in X serverChris Feng1-18/+21
* exwm-input.el (exwm-input--grab-global-prefix-keys): Some global keys might not be available in X server (perhaps due to misconfiguration).
2019-08-18 Make it possible to answer questions from Emacs when in char-modeChris Feng1-4/+55
* exwm-input.el (exwm-input--echo-area-timer): New variable storing the timer used for detecting echo area messages. (exwm-input--on-minibuffer-setup, exwm-input--on-minibuffer-exit) (exwm-input--on-echo-area-dirty, exwm-input--on-echo-area-clear): New functions for grabbing/releasing keyboard when minibuffer/echo becomes active/inactive. (exwm-input--init, exwm-input--exit): Register/Unregister them. (exwm-input--grab-keyboard, exwm-input--release-keyboard): Validate buffers.
2019-08-11 Avoid checking `*temp*' buffersChris Feng1-5/+1
* exwm-input.el (exwm-input--on-buffer-list-update): The way of detecting a switch from a `*temp*' buffer does not always work. Disable it until we find a better way.
2019-08-05 Fix detection of modifier keys in Emacs eventsChris Feng1-18/+21
* exwm-input.el (exwm-input--grab-global-prefix-keys) (exwm-input--fake-key): * exwm-xim.el (exwm-xim--handle-forward-event-request): X11 allows multiple combinations of KEYSYM-MODIFIERS to generate a same KEYSYM, thus the result of an Emacs event to KEYSYM-MODIFIERS conversion is not necessarily unique. Previously the result of `xcb:keysyms:event->keysym' is misused as the modifiers returned is actually the ones should be consumed.
2019-07-14 Added option to have a key that ends exwm-input-send-next-keySebastian Wålinder1-4/+10
* exwm-input.el (exwm-input-send-next-key): Accept an optional end key.
2019-06-16 Avoid workspace switch loop with `mouse-autoselect-window' enabledChris Feng1-2/+7
* exwm-input.el (exwm-input--last-enter-notify-position): New variable storing last mouse position. (exwm-input--on-EnterNotify): Avoid switching workspace when mouse position is not changed (the event is a result of a workspace switch).
2019-03-24 ; Follows upChris Feng1-6/+6
2019-02-11 Fix compatibility issue with Emacs 25Chris Feng1-1/+3
* exwm-input.el (exwm-input--unread-event): `string-version-lessp' is not available on Emacs 25.
2019-02-06 Merge branch 'retain-echo-area-until-input' of ↵Chris Feng1-2/+7
https://github.com/medranocalvo/exwm into medranocalvo/retain-echo-area-until-input
2019-02-06 Cleanup simulation key config issuesIan Eure1-4/+4
* exwm-input.el (exwm-input-simulation-keys): Original key only has one option, so probably shouldn’t be a `choice` type; Move the "User-defined" key value to the top, since that’s the one someone is most likely to want). * exwm-config.el (exwm-config-default): Only set custom vars if there isn’t a saved value for them.
2019-02-06 Add input method supportChris Feng1-11/+4
; The code is basically refactored from ; https://github.com/ch11ng/exim to get better maintenance. * exwm-xim.el: New module making Emacs's builtin input methods usable for interacting with X windows. * exwm-core.el (exwm--intern-atom): New function for intern X11 atoms. * exwm-input.el (exwm-input--init): * exwm-manage.el (exwm-manage--init): Use it.
2019-02-01 Update copyright year to 2019Chris Feng1-1/+1
2019-01-20 Fix issue with managed tray iconsChris Feng1-3/+10
* exwm-input.el (exwm-input--on-ButtonPress): Replay button events destined for managed tray icons.
2018-12-16 Avoid unnecessary focus changes when creating/killing buffersChris Feng1-0/+4
* exwm-input.el (exwm-input--skip-buffer-list-update): New internal variable for skipping the next 'buffer-list-update'. (exwm-input--on-buffer-list-update): Skip when `exwm-input--skip-buffer-list-update` is set. * exwm-manage.el (exwm-manage--manage-window): Set `exwm-input--skip-buffer-list-update` when creating/killing buffers.
2018-12-02 ; Improve debug logs.Chris Feng1-1/+16
2018-11-25 Avoid unnecessary keyboard grab/ungrab in char-modeChris Feng1-7/+8
* exwm-input.el (exwm-input--cache-event): Optimize the handling of single event global key by not grabbing/ungrabbing the keyboard.
2018-11-03 Hide minibuffer upon receiving any eventAdrián Medraño Calvo1-2/+7
* exwm-input.el (exwm-input--event-hook): New variable. (exwm-input--on-ButtonPress, exwm-input--on-KeyPress): Run `exwm-input--event-hook'. * exwm-workspace.el (exwm-workspace--init, exwm-workspace--exit): Hide minibuffer upon noticing an event.
2018-10-21 Restore keyboard grabbing after exiting fullscreenAdrián Medraño Calvo1-0/+2
Recover the difference between the input mode selected by the user and actual one, which might be transient. This was inadvertently removed in recent changes. * exwm-core.el (exwm--selected-input-mode): New variable. * exwm-input.el (exwm-input-grab-keyboard) (exwm-input-release-keyboard): Use it. * exwm-layout.el (exwm-layout-unset-fullscreen): Return to the selected input mode.
2018-10-21 Do away with `exwm-input--input-mode'Adrián Medraño Calvo1-11/+4
* exwm-input.el (exwm-input--update-mode-line): Remove. (exwm-input--on-ButtonPress, exwm-input--on-KeyPress) (exwm-input--update-mode-line, exwm-input-toggle-keyboard): Use `exwm--input-mode' variable directly.
2018-10-14 Merge branch 'medranocalvo/fix-minibuffer-only-focus-jump' into externals/exwmChris Feng1-11/+1
2018-10-08 Support binding mouse events in line-modeAdrián Medraño Calvo1-24/+61
* exwm-input.el (exwm-input--event-passthrough-p): Predicate checking whether an event should be forwarded to Emacs. (exwm-input--on-KeyPress-line-mode): Use it. * exwm-input.el (exwm-input--cache-event): Protect against translations swallow the event. * exwm-input.el (exwm-input--on-ButtonPress-line-mode) (exwm-input--on-ButtonPress-char-mode): New functions. (exwm-input--on-ButtonPress): Forward bound mouse events to Emacs when in line-mode.
2018-10-08 Fix focus jumps with minibuffer-only framesAdrián Medraño Calvo1-11/+1
* exwm-input.el (exwm-input--update-focus): Focus the minibuffer's frame, which is different than that of the `minibuffer-selected-window' on minibuffer-only frames. (exwm-input--on-minibuffer-setup, exwm-input--init) (exwm-input-exit): Remove unneeded function.
2018-10-08 Simplify input handlingAdrián Medraño Calvo1-21/+29
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.
2018-08-19 ; Unimportant tweaksChris Feng1-2/+2
2018-08-13 Trace more functionsAdrián Medraño Calvo1-0/+32
2018-07-15 Fix XTerm crash on startupChris Feng1-10/+12
* exwm-input.el (exwm-input--set-focus): Applications like XTerm crashes on receiving WM_TAKE_FOCUS so only send it to X windows accepting it.
2018-07-15 ; Use `derived-mode-p'.Chris Feng1-7/+7
2018-07-15 Also send a WM_TAKE_FOCUS when setting focus with SetInputFocusChris Feng1-30/+21
* exwm-input.el (exwm-input--set-focus): Send an extra WM_TAKE_FOCUS event to workaround the key replay issue with Xorg 1.20 when keyboard is grabbed.
2018-07-15 Revert "Grab & Replay key events with XI2 and XTEST"Chris Feng1-222/+85
This reverts commit 0680be104f9394e39dd55b5c4e33b9b7e4e77926.
2018-06-18 Grab & Replay key events with XI2 and XTESTChris Feng1-85/+222
; A change has been made in Xorg server 1.20 that replaying a key ; event with keyboard grabbed would generate extra focus change and ; enter/leave events. This basically breaks line-mode for apps like ; Firefox. This commit reimplements the grab & replay functionality ; with XI2 and XTEST. * exwm-input.el (exwm-input--devices): New variable for caching slave keyboards. (exwm-input--update-devices): Update it and re-grab keys if necessary. (exwm-input--on-Hierarchy): Event listener for the Hierarchy event that would in turn call `exwm-input--update-devices' to update the cache. * exwm-input.el (exwm-input--on-KeyPress): Use XI2 KeyPress events. (exwm-input--on-KeyRelease): Event listener for the KeyRelease events. (exwm-input--grab-global-prefix-keys): Use XI2 and also select KeyRelease events. (exwm-input--on-KeyPress-line-mode): Use XI2 KeyPress events and replay key events with XTEST. (exwm-input--on-KeyPress-char-mode, exwm-input--grab-keyboard) (exwm-input--release-keyboard): Use XI2 KeyPress events. * exwm-input.el (exwm-input--init): Initialize the XI2 and XTEST extensions; add listeners for XI2 KeyPress, KeyRelease and Hierarchy events.
2018-04-01 Add support for various key processing variablesChris Feng1-13/+32
* exwm-input.el (exwm-input--mimic-read-event): New function for handling `extra-keyboard-modifiers' and `keyboard-translate-table'. (exwm-input--cache-event): Do not unread events here. (exwm-input--on-KeyPress-line-mode) (exwm-input--on-KeyPress-char-mode): Compare with preprocessed events and unread raw ones. * exwm-input.el (exwm-input--on-KeyPress-line-mode): Add support for `overriding-terminal-local-map'.
2018-03-23 Fix local simulation keysChris Feng1-1/+1
* exwm-input.el (exwm-input--on-KeyPress-line-mode): Do not test `exwm-mode-map' to see if a key should be forwarded to Emacs as it's overridden when local simulation keys are present.
2018-03-23 Avoid entering line-mode after exit minibufferChris Feng1-1/+2
* exwm-input.el (exwm-input--on-pre-command): Keys should be forwarded to the X window (if its Emacs window is currently selected) after exiting the minibuffer.