aboutsummaryrefslogtreecommitdiff
path: root/alacritty/src/input.rs
Commit message (Collapse)AuthorAge
* Implement kitty's keyboard protocolKirill Chibisov2023-12-06
| | | | | | | | The protocol enables robust key reporting for the applications, so they could bind more keys and the user won't have collisions with the normal control keys. Links: https://sw.kovidgoyal.net/kitty/keyboard-protocol Fixes #6378.
* Fix Vi cursor not being dirty when scrollingKirill Chibisov2023-11-14
|
* Remove `alacritty_config` from alacritty_terminalKirill Chibisov2023-11-10
| | | | | There's no need to force alacritty's user configuration on other users of the crate, thus provide the options actually used by alacritty_terminal itself.
* Fix typosPavel Roskin2023-10-25
|
* Prefer exact matches for bindings in mouse modePavel Roskin2023-10-25
| | | | | | Only consider bindings without Shift if there are no actions defined for the actual mouse event. Closes #7292.
* Add inline vi mode searchChristian Duerr2023-10-20
| | | | | | This patch adds inline search to vi mode using `f`/`F` and `t`/`T` as default bindings. The behavior matches that of vim. Fixes #7203.
* Add bindings for macOS tabsKirill Chibisov2023-09-04
| | | | | This doesn't represnet the movement to add tabs on any other platform, unless winit could add a similar API for them.
* Update winit to 0.29.1-betaKirill Chibisov2023-09-04
| | | | | | | | Make use of new winit frame throttling mechanism used in RedrawRequested, which removes the need for having Wayland queue to ask for the frame callbacks. Fixes #7011.
* Remove winit dependency from alacritty_configMax Brunsfeld2023-08-17
|
* Ignore scrolling multiplier on touchscreenstv2023-08-05
|
* Use ahash instead of fnv and regular hash functionKirill Chibisov2023-07-24
| | | | | | | | After evaluation of the ahash with the data alacritty uses it was discovered that it's 1.5-2x times faster when getting the already hashed values, which is the primary cases for alacritty's renderer. Given that ahash is generally faster, all the HashSet and HashMap's inside the alacritty were changed to use it as a hasher function.
* Fix keys like `+` not working on neo layoutsKirill Chibisov2023-07-20
| | | | | | The key_without_modifier removes all the modifiers including the multiple shift levels, which is not desired. In alacritty we just wanted to treat uppercase and lowercase latters the same, which we can with the help of builtin functions.
* Prefer logical key for named keysKirill Chibisov2023-07-13
| | | | | | Some keyboard layouts have named logical keys via shift combinations of some sorts. So prefer them. Fixes #7076.
* Raise double click threshold to 400msKirill Chibisov2023-07-13
| | | | This should improve the situation with some touchpads. GTK4 is also using the same value.
* Fix `window.option_as_alt=Both`Kirill Chibisov2023-07-13
| | | Fixes #7077.
* Update to the new winit keyboard APIKirill Chibisov2023-07-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main highlight of this update is that alacritty will now use new keyboard API from the winit, which resolves a lot of issues around key bindings, such as ability to bind dead keys. It also fixes long standing issues with the virtual key code bindings and make bindings in general more predictable. It also makes our default Vi key bindings fully working. Given that alacritty was using `VirtualKey` directly in the bindings from the winit, and winit simply removed the enum, we've added internal conversions to minimize the fallout, but new way to specify the bindings should be more intuitive. Other part of this update fixes some forward compatibility bugs with the Wayland backend, given that wayland-rs 0.30 is fully forward compatible. The update also fixes weird Maximized startup issues on GNOME Wayland, however they were present on any sane compositor. Fixes #6842. Fixes #6455. Fixes #6184. Fixes #5684. Fixes #3574. Fixes #3460. Fixes #1336. Fixes #892. Fixes #458. Fixes #55.
* Remove mouse double_click/triple_click optionsSonu Bardai2023-06-29
| | | Fixes #6962.
* Allow mode-exclusive bindings in any modeChristian Duerr2023-04-15
| | | | | | This patch enables binding chains that go beyond mode changes by allowing bindings to be defined for modes they do not usually have an effect in.
* Use paste for ESC action and IME commitChristian Duerr2023-04-15
| | | | | | Route string terminal input through 'ActionContext::paste' instead of char by char write improving performance by utilizing bracketed paste mode when it's reasonable.
* Reset char suppression for every key bindingChristian Duerr2023-04-15
| | | | | | | | | | Previously the character suppression was only reset whenever a key was released. However this did not take key repetition into account. Now every key down also resets the character suppression. This should work since the `ReceivedCharacter` is always received immediately after the `KeyboardInput` without the chance of a racing condition where another keyboard event interrupts the two.
* Relax horizontal scrollingKirill Chibisov2023-02-19
| | | | | | Apply horizontal scrolling when the angle between the axis X and (x, y) vector is lower than 25 degrees. Fixes #6711.
* Add touch input supportChristian Duerr2023-02-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch builds upon the prior work by @4z3 and @bytbox to add touchscreen support to Alacritty. While some inspiration was taken from @4z3's patch, it was rewritten from scratch. This patch supports 4 basic touch interactions: - Tap - Scroll - Select - Zoom Tap allows emulating the mouse to enter a single LMB click. While it would be possible to add more complicated mouse emulation including support for RMB and others, it's likely more confusing than anything else and could conflict with other more useful touch actions. Scroll and Select are started by horizontal or vertical dragging. While selection isn't particularly accurate with a fat finger, it works reasonably well and the separation from selection through horizontal and vertical start feels pretty natural. Since horizontal drag is reserved for selection we do not support horizontal scrolling inside the terminal. While it would be possible to somewhat support it by starting a selection with vertical movement and then scrolling horizontally afterwards, it would likely just confuse people so it was left out. Zoom is pretty simple in just changing the font size when a two-finger pinch gesture is used. Performance of this is pretty terrible especially on low-end hardware since this obviously isn't a cheap operation, but it seems like a worthwhile addition since small touchscreen devices are most likely to need frequent font size adjustment to make output readable. Closes #3671.
* Don't send ESC for `OptionAsAlt::None`Kirill Chibisov2023-02-12
| | | | This doesn't solve issue for `RALT`/`LALT`, but that part is impossible until winit's keyboard v2 API.
* Update winit to 0.28Kirill Chibisov2023-02-02
| | | | | | | | Fixes #6644. Fixes #6615. Fixes #6558. Fixes #6515. Fixes #3187. Fixes #62.
* Add support for horizontal scrollingKirill Chibisov2023-01-16
| | | | | | This adds support for horizontal mouse scrolling in mouse mode and alternative scrolling modes. Fixes #2185.
* Update glutin to 0.30.0Kirill Chibisov2022-11-03
| | | | | | | | | | | | | | | The glutin 0.30.0 update decouples glutin from winit which provides us with basis for a multithreaded renderer. This also improves robustness of our configuration picking, context creation, and surface handling. As an example we're now able to start on systems without a vsync, we don't try to build lots of contexts to check if some config works, and so on. That also brings us possibility to handle context losses, but that's a future work. Fixes #1268.
* Fix clippy warningsChristian Duerr2022-10-12
| | | | | This patch applies all clippy lints currently present on the latest clippy master than are compatible with our oldstable clippy (only exception is the `_else(||` stuff).
* Add inline input method supportKirill Chibisov2022-08-29
| | | | | | This commit adds support for inline IME handling. It also makes the search bar use underline cursor instead of using '_' character. Fixes #1613.
* Remove redundant dirty updatesKirill Chibisov2022-07-25
| | | | | | In some cases dirty was set without any ui update leading to extra redraws, this commit resolves this. Co-authored-by: Greg Depoire--Ferrer <greg@gregdf.com>
* Replace `map().unwrap_or()` with `map_or()`Chris Copeland2022-07-20
| | | Use a `map_or` instead of a `map().unwrap_or()` chain.
* Add support for hyperlink escape sequenceKirill Chibisov2022-07-10
| | | | | | | This commit adds support for hyperlink escape sequence `OSC 8 ; params ; URI ST`. The configuration option responsible for those is `hints.enabled.hyperlinks`. Fixes #922.
* Use DeviceId/WindowId::dummy in tests52252252022-07-09
|
* Add vi action to center view around vi cursorjeremycostanzo2022-06-10
|
* Fix selection copy without button releasemahkoh2022-04-16
| | | | | | | | | | | | | | | To prevent the current selection clipboard from being overwritten right before pasting, text is no longer copied solely because the user scrolled the scrollback buffer. The selection also isn't copied when a mouse button other than LMB/RMB are released, since these are the only ones capable of modifying the selection range. This should prevent issues where the selection of the user gets unexpectedly overwritten, especially in scenarios where the user is currently in the process of pasting something into Alacritty. Signed-off-by: Julian Orth <ju.orth@gmail.com>
* Extract `SizeInfo` from alacritty_terminalKirill Chibisov2022-04-06
| | | | | The `SizeInfo` is a SizeInfo used for rendering, which contains information about padding, and such, however all the terminal need is number of visible lines and columns.
* Reset blinking on search bindings in Vi modeKirill Chibisov2022-03-25
| | | | | | The Vi cursor is used as the current match indicator, however when it's blinking during search jumps the current match is invisible. Fixes #5934.
* Add `ToggleMaximized` key binding actionChris Copeland2022-02-27
|
* Don't load font twice during display creationKirill Chibisov2022-02-18
| | | | | This commit finishes the effort from a64553b to avoid reloading font twice during startup, since the original issue is with getting font metrics without building the glyph cache.
* Add damage tracking and reporting to compatible compositorsKirill Chibisov2022-02-02
| | | | | | | | | | | | | | This allows compositors to only process damaged (that is, updated) regions of our window buffer, which for larger window sizes (think 4k) should significantly reduce compositing workload under compositors that support/honor it, which is good for performance, battery life and lower latency over remote connections like VNC. On Wayland, clients are expected to always report correct damage, so this makes us a good citizen there. It can also aid remote desktop (waypipe, rdp, vnc, ...) and other types of screencopy by having damage bubble up correctly. Fixes #3186.
* Reset cursor blinking on ToggleViModeKirill Chibisov2022-01-21
| | | Fixes #4468.
* Fix CreateNewWindow CLI fallbackChristian Duerr2021-12-23
| | | | | | | | | | | | | | The existing behavior for the new CreateNewWindow actions was to always pass in their own options, which would discard the existing options configured on the terminal's PTY config. To fix this the behavior for CreateNewWindow is now the same as for the initial window creation, the config values are overwritten conditionally based on their individual presence in the CLI options. However all temporary CLI options set on the "master" Alacritty instance are discarded by all future windows. Fixes #5659.
* Remove shared PID/FD variablesChristian Duerr2021-12-19
| | | | | | | | | | | | | | | | The existing PID/FD atomics in alacritty_terminal/src/tty/unix.rs were shared across all Alacritty windows, causing problem with the new multiwindow feature. Instead of sharing these between the different windows, the master FD and shell PID are now stored on the `window_context`. Unfortunately this makes spawning new daemons a little more complicated, having to pass through additional parameters. To ease this a little bit the helper method `spawn_daemon` has been defined on the `ActionContext`, making it accessible from most parts of Alacritty's event loop. Fixes #5700.
* Add parameters to `msg create-window` subcommandKirill Chibisov2021-11-22
| | | | | | | | | | | | | | | Alacritty's `msg create-window` subcommand would previously inherit all the CLI parameters from the original executable. However not only could this lead to unexpected behavior, it also prevents multi-window users from making use of parameters like `-e`, `--working-directory`, or `--hold`. This is solved by adding a JSON-based message format to the IPC socket messages which instructs the Alacritty server on which CLI parameters should be used to create the new window. Fixes #5562. Fixes #5561. Fixes #5560.
* Add multi-window supportChristian Duerr2021-10-23
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously Alacritty would always initialize only a single terminal emulator window feeding into the winit event loop, however some platforms like macOS expect all windows to be spawned by the same process and this "daemon-mode" can also come with the advantage of increased memory efficiency. The event loop has been restructured to handle all window-specific events only by the event processing context with the associated window id. This makes it possible to add new terminal windows at any time using the WindowContext::new function call. Some preliminary tests have shown that for empty terminals, this reduces the cost of additional terminal emulators from ~100M to ~6M. However at this point the robustness of the daemon against issues with individual terminals has not been refined, making the reliability of this system questionable. New windows can be created either by using the new `CreateNewWindow` action, or with the `alacritty msg create-window` subcommand. The subcommand sends a message to an IPC socket which Alacritty listens on, its location can be found in the `ALACRITTY_SOCKET` environment variable. Fixes #607.
* Add ExpandSelection mouse binding actionJason Heard2021-07-29
| | | Fixes #4132.
* Fix clippy warningsChristian Duerr2021-07-03
|
* Improve rendering performanceChristian Duerr2021-05-22
| | | | | | | | | | | | | | | | | | | | | | | | | | This PR combines a couple of optimizations to drastically reduce the time it takes to gather everything necessary for rendering Alacritty's terminal grid. To help with the iteration over the grid, the `DisplayIter` which made heavy use of dynamic dispatch has been replaced with a simple addition to the `GridIterator` which also had the benefit of making the code a little easier to understand. The hints/search check for each cell was always performing an array lookup before figuring out that the cell is not part of a hint or search. Since the general case is that the cell is neither part of hints or search, they've been wrapped in an `Option` to make verifying their activity a simple `is_some()` check. For some reason the compiler was also struggling with the `cursor` method of the `RenderableContent`. Since the iterator is explicitly drained, the performance took a hit of multiple milliseconds for a single branch. Our implementation does never reach the case where draining the iterator would be necessary, so this sanity check has just been replaced with a `debug_assert`. Overall this has managed to reduce the time it takes to collect all renderable content from ~7-8ms in my large grid test to just ~3-4ms.
* Fix selection flooding Wayland connectionChristian Duerr2021-04-17
| | | | | | | | | | This resolves an issue where an excessive clipboard update frequency would cause the Wayland display server to ignore necessary selection updates. Instead of copying the selection to the clipboard during the selection process, it is now only copied once the mouse button is released. Fixes #4953.
* Fix mouse reportsChristian Duerr2021-04-16
| | | | | | | The patch 9cb5562 has introduced a regression which would abort if a mouse report's line was bigger than zero, which is the exact opposite of when a mouse report is required. Fixes #4980.
* Fix mouse point crash on resizeChristian Duerr2021-04-15
| | | | | | | | | This resolves an issue with Alacritty crashing after a resize, due to the last cached mouse point being out of bounds. Instead of caching the mouse point, it is now computed on demand to make sure it can never be invalid. Fixes #4977.