aboutsummaryrefslogtreecommitdiff
path: root/input.h (follow)
Commit message (Collapse)AuthorAgeLines
* Don't use fancy Unicode quotes, stick to ASCIIDaniel Eklöf2024-02-06-2/+2
|
* input: remove the concept of "significant" modifiersDaniel Eklöf2024-02-06-1/+1
| | | | | | | | | | | | | | | | | | | For the purpose of matching key bindings, "significant" modifiers are no more. We're really only interested in filtering out "locked" modifiers. We're already doing this, so there's no need to *also* match against a set of "significant" modifiers. Furthermore, we *never* want to consider locked keys (e.g. when emitting escapes to the client application), thus we can filter those out already when retrieving the set of active modifiers. The exception is the kitty keyboard protocol, which has support for CapsLock and NumLock. Since we're already re-retrieving the "consumed" modifiers (using the GTK style, rather than normal "XKB" style, to better match the kitty terminal), we might as well re-retrieve the effective modifiers as well.
* input: add basic support for touchscreen inputCismonX2023-07-05-0/+1
| | | | Closes #517
* refactor: track current xcursor using an enum, instead of a char pointerDaniel Eklöf2023-07-03-2/+3
|
* replace gettimeofday with clock_gettimePranjal Kole2022-01-15-0/+1
| | | | | | | | | | | | | POSIX.1-2008 has marked gettimeofday(2) as obsolete, recommending the use of clock_gettime(2) instead. CLOCK_MONOTONIC has been used instead of CLOCK_REALTIME because it is unaffected by manual changes in the system clock. This makes it better for our purposes, namely, measuring the difference between two points in time. tv_sec has been casted to long in most places since POSIX does not define the actual type of time_t.
* config, input: allow configuring select-override modifiersfeeptr@codeberg.org2021-12-02-0/+5
|
* pgo: add stub for xcursor_for_csd_border()Daniel Eklöf2021-11-30-1/+1
|
* terminal: Make seat xcursor update focus awareJonas Ådahl2021-11-29-0/+2
| | | | | | | When term_xcursor_update_for_seat() was called on e.g. keyboard focus loss, it'd update the curret xcursor to 'text' even if it was e.g. on top of the window title, or resize areas. This makes the function a bit more focus aware, and will not be so eager to set the text xcursor.
* input: implement support for mouse wheel left/rightDaniel Eklöf2021-08-07-0/+17
| | | | | | | | | | | | | We now emit button 6/7 events (when the client application grabs the mouse). This buttons map to mouse wheel horizontal scroll events. Or, left/right tilting, if you like. Wayland report these as ‘axis’ events (just like regular scroll wheel events), and thus we need to translate those scroll events to button events. libinput does not define any mouse buttons for wheel tilts, so we add our own defitions. These are added last in the BTN_* range, just before the BTN_JOYSTICK events.
* config: key/mouse bindings: refactor: less parsing in keyboard_enter()Daniel Eklöf2020-08-13-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This simplifies the handling of mouse and keyboard bindings. Before, the bindings where parsed *both* when loading the configuration, and then on every keyboard enter event. This was done since keys require a keymap to be decoded. Something we don't have at configuration time. The idea was that at config time, we used a default keymap just to verify the key combo strings were valid. The following has changed: * The bindings in the config struct is now *one* key combo per entry. Previously, it was one *action* per entry, and each entry had one or more key combos. Doing it this way makes it easier when converting the binding in the keyboard enter event (which previously had to expand the combos anyway). * The bindings in the config struct no longer contains any unparsed strings. A key binding contains a decoded 'modifier' struct (which specifies whether e.g. ctrl, or shift, or ctrl+shift must be pressed for the binding to be used). It also contains a decoded XKB keysym. * A mouse binding in the config struct is similar to a key binding, except it contains the button, and click count instead of the XKB key sym. * The modifiers in the user-specified key combo is decoded at config time, by using the pre-defined XKB constants XKB_MOD_NAME_<modifier>. The result is stored in a 'modifiers' struct, which is just a collection of booleans; one for each supported modifier. The supported modifiers are: shift, ctrl, alt and meta/super. * The key sym is decoded at config time using xkb_keysym_from_name(). This call does *not* depend on a keymap. * The mouse button is decoded at config time using a hardcoded mapping table (just like before). * The click count is currently hard-coded to 1. * In the keyboard enter event, all we need to do is pre-compute the xkb_mod_mask_t variable for each key/mouse binding, and find all the *key codes* that map to the (already decoded) symbol. For mouse bindings, the modifiers are the *only* reason we convert the mouse bindings at all. In fact, on button events, we check if the seat has a keyboard. If not, we use the mouse bindings from the configuration directly, and simply filter out those with a non-empty set of modifiers.
* config: wip: add support for modifiers in mouse bindingsDaniel Eklöf2020-08-13-0/+3
| | | | | | | Mouse bindings can now include modifiers. They are specified in pretty much the same way as in keyboard bindings: Control+BTN_LEFT
* wip: multi-seat supportDaniel Eklöf2020-07-08-1/+1
| | | | | Compiles and runs, but mouse, clipboard and other things have been disabled.
* search: replace hard-coded key bindings with "user configurable" onesDaniel Eklöf2020-03-18-6/+2
| | | | | | | | They aren't really user configurable. At least not yet. However, with this, we now handle raw key codes just like the normal key bindings. Meaning, e.g. ctrl+g, ctrl+a, ctrl+e etc now works while searching with e.g. a russian layout.
* input: parse_key_binding_for_action: export functionDaniel Eklöf2020-03-09-0/+5
|
* search: add support for user configurable key bindingsDaniel Eklöf2020-03-08-0/+3
| | | | No default bindings defined yet, though.
* input: input_repeat() takes a 'struct wayland' pointerDaniel Eklöf2019-10-27-2/+2
|
* input: mouse eventsDaniel Eklöf2019-07-05-0/+1
|
* wip: initial input handlingDaniel Eklöf2019-06-19-0/+9