aboutsummaryrefslogtreecommitdiff
path: root/input.c (follow)
Commit message (Collapse)AuthorAgeLines
* selection: extending a selection is now interactiveDaniel Eklöf2020-07-27-1/+1
| | | | | That is, a selection extension can be resized just like an ordinary extension.
* input: pipe: avoid goto's where variables may be uninitializedDaniel Eklöf2020-07-22-6/+9
|
* input: pipe-{visible,scrollback}: redirect stdout/stderr to /dev/nullDaniel Eklöf2020-07-15-1/+13
|
* input: commentsDaniel Eklöf2020-07-15-1/+3
|
* conf: bindings: allow several mappings for the same actionDaniel Eklöf2020-07-15-15/+13
| | | | | If the bindings has different pipe command associated with them, treat them as different actions.
* input: wip: initial support for piping scrollback/view to external toolsDaniel Eklöf2020-07-15-7/+132
|
* input: parse_key_binding: free key-codes list if 'bindings' is NULLDaniel Eklöf2020-07-15-1/+2
|
* conf: add definitions for pipe-{scrollback,view} bindingsDaniel Eklöf2020-07-15-0/+5
|
* input: keyboard: keymap: close(fd) on early-return when failing to mmapDaniel Eklöf2020-07-14-0/+1
|
* input: keyboard: keymap: use xkb_keymap_new_from_buffer()Daniel Eklöf2020-07-14-2/+4
|
* input: keyboard: detect failure to mmap keymapDaniel Eklöf2020-07-14-0/+17
|
* input: include seat name in debug log outputDaniel Eklöf2020-07-11-4/+4
|
* seat: use separate 'enter' serials for keyboard and mouseDaniel Eklöf2020-07-09-4/+6
|
* multi-seat: improve handling of multiple (mouse) pointersDaniel Eklöf2020-07-09-34/+37
| | | | | | | | * xcursor always set for all pointers * xcursor sometimes not updated when it should be * mouse grabbed state wasn't per seat, but global (i.e. "does at least one seat enable mouse grabbing") * selection enabled state wasn't per seat
* focus in/out: terminal checks whether it is a state change or notDaniel Eklöf2020-07-09-17/+3
|
* input: only call term_kbd_focus_{in,out}() on actual state changeDaniel Eklöf2020-07-09-7/+20
| | | | | | That is, only call term_kbd_focus_in() if we're the *first* seat focusing that terminal, and only call term_kbd_focus_out() if we're the *last* seat that focused it.
* xcursor: trigger theme reload in pointer-enter eventDaniel Eklöf2020-07-08-0/+3
| | | | | | | | | | | | | | | | Previously, we triggered a theme reload on output changes. This is completely wrong. We may get a new output with a scale different from the output the pointer is actually on. Now, we store the current scale along with the theme. We then trigger a call to reload the xcursor theme *every* time the pointer enters a surface. When it does, we use the current scale factor of the terminal that owns that surface. If the terminal covers multiple outputs, with different scale factors, we'll use the largest scale factor. This may not be 100% correct. But to fix that, we'd need to track which regions of a surface are mapped on which outputs. Too complicated I say.
* multi-seat: re-enable selection support (excluding OSC 52)Daniel Eklöf2020-07-08-14/+17
|
* multi-seat: re-enable scrollback search supportDaniel Eklöf2020-07-08-1/+1
|
* multi-seat: re-enable mouse button+motion reporting supportDaniel Eklöf2020-07-08-6/+16
|
* multi-seat: enable xcursor theme support againDaniel Eklöf2020-07-08-4/+4
|
* wip: multi-seat supportDaniel Eklöf2020-07-08-180/+190
| | | | | Compiles and runs, but mouse, clipboard and other things have been disabled.
* input: add key mapping for XKB_KEY_KP_DecimalDaniel Eklöf2020-06-27-0/+1
|
* selection: don't automatically no-op operations if selection isn't enabledDaniel Eklöf2020-05-16-14/+17
| | | | | | | | | | | | | | | | | | When the client is capturing the mouse, selection can only be done by holding done shift. This is why a lot of selection functions are no-ops if selection isn't currently enabled. However, there are many cases where we actually need to modify the selection. In particular, selection_cancel(). Thus, only check for enabled selection when we're dealing with user input. Bonus: this also fixes a bug where an ongoing selection were finalized as soon as the user released shift, even if he was still holding down the mouse button.
* util.h: new header file defining commonly used macrosDaniel Eklöf2020-05-01-2/+1
|
* misc: replace all explicit zero-initializers with empty initializersDaniel Eklöf2020-04-13-2/+2
|
* mbstate: fix compile warning on systems where mbstate_t isn't an integralDaniel Eklöf2020-04-13-1/+1
| | | | | An empty initializer still ensures the entire object is zero-initialized.
* input: slow trackpad scrolling now eventually scroll a lineDaniel Eklöf2020-04-10-1/+17
| | | | | | | | | | | | | | | Before, we converted each axis event's scroll amount to an integer and scrolled that many lines. However, axis events are speed sensitive - very slow scrolling will result in events with a scroll amount that is < 1.0. For us, this meant we never scrolled a single line. You could slow scroll all day if you wanted, and still we would never scroll a single line. Fix this by aggregating the scroll amount from axis events until the scroll amount is > 1.0, and then scroll.
* input: right mouse click extends the current selectionDaniel Eklöf2020-04-04-0/+4
|
* input: hardcoded left mouse button handler requires click-count <= 3Daniel Eklöf2020-04-04-1/+1
| | | | | | | | This enables user mappings for the left mouse button with click count > 3 I.e. it is now possible to create custom quad-click mappings (except we don't yet support this in footrc).
* input: only cancel selection on left mouse button clicksDaniel Eklöf2020-04-04-4/+3
|
* search: replace hard-coded key bindings with "user configurable" onesDaniel Eklöf2020-03-18-24/+40
| | | | | | | | 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: bindings: don't match raw key code alone - mods must also matchDaniel Eklöf2020-03-18-1/+4
|
* input: bind key bindings to raw key codes tooDaniel Eklöf2020-03-18-1/+43
| | | | | | | | | | | | | | | | | | | | | | | | Before, when looking for a matching user key binding, we only matched *symbols*. This means that the physical keys that generate a specific key binding is layout dependent. What's worse, it may not even be possible to generate the key binding at all. Russian is one such layout, where all the "normal" (us) symbols are replaced. By using raw key codes, we can get around this - the key code has a direct mapping to the physical key. However, matching raw key codes **only** doesn't always make sense either. For now, match **both** symbols _and_ key codes. Symbols take precedence. TODO: we might have to make this configurable _per binding_. Note: 'search' mode still uses mostly hardcoded shortcuts that still have this problem (i.e. ctrl+g doesn't work with a russian layout).
* input: key-binding: log error when we fail to translate to XKB symbolDaniel Eklöf2020-03-18-1/+10
|
* input: remove Sway 1.2 keyboard/pointer workaroundsDaniel Eklöf2020-03-14-52/+0
| | | | | | | | | | | | | | | Sway 1.4 is better than 1.2, in that we always have keyboard focus when we get a keyboard_key() event. That however is because it doesn't send keyboard_leave() on e.g. a TTY switch. Still, this is good enough - foot handles this and doesn't crash. We are also able to process input without having to refocus the window. And, Sway master (what will become Sway 1.5) has fixed this for real - we now get a keyboard_leave() and pointer_leave() event on a TTY switch. And the corresponding enter events when switching back.
* input: add debug logs to all keyboard/pointer enter/leave/action eventsDaniel Eklöf2020-03-14-4/+22
|
* input: maximize: unset fullscreen before toggling maximized stateDaniel Eklöf2020-03-12-0/+2
|
* config: mouse-bindings: verify button isn't already mappedDaniel Eklöf2020-03-12-0/+4
| | | | | | | | | A button may only be mapped to a single action. Detect when the user tried to map the same button to multiple actions and error out. To clear a binding (for example, to free up a button from the default bindings), one can set the action it is bound to to `NONE` (e.g. `primary-paste=NONE`).
* config/input: implement mouse bindingsDaniel Eklöf2020-03-12-9/+21
| | | | | | | | | | * New config section, "mouse-bindings", where bindings are defined on the form "action=BTN_<name> * pointer_button() handler now scans the bindings list instead of hardcoding primary-paste to BTN_MIDDLE. * The implementation handles single- double- and triple clicks in the bindings, but there is currently no way to define anything but a single-click binding in the configuration.
* bindings: add minimize/maximize/fullscreen actionsDaniel Eklöf2020-03-12-0/+18
| | | | These actions are by default not bound to anything.
* input: parse_key_binding_for_action: export functionDaniel Eklöf2020-03-09-4/+4
|
* input: parse_key_binding_for_action: repair LOG_DBG statementDaniel Eklöf2020-03-09-1/+1
|
* search: add support for user configurable key bindingsDaniel Eklöf2020-03-08-7/+12
| | | | No default bindings defined yet, though.
* input: convert the rest of the normal key bindings to configurable bindingsDaniel Eklöf2020-03-08-81/+90
| | | | | | | | | | | | | | | | | New actions defined and implemented: * scrollback up/down * font size up/down/reset * spawn terminal Break out key combo parsing to a new function, parse_key_binding_for_action(). This function parses a string containing one or more space separated key combo definitions on the form (mod1+mod2+...+key), where key is a XKB key name (e.g. KP_Add). Convert all hardcoded key bindings to configuration based bindings. These still cannot actually be configured by the user, but at least lives in the conf struct.
* wip: initial framework for dealing with key/mouse bindings in different modesDaniel Eklöf2020-03-08-17/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds initial support for defining key and mouse bindings that are applied in different terminal modes/states. For example, there are two arrays dealing with key and mouse bindings in the "normal" mode. Most bindings will go here. There's also an array for "search" mode. These bindings will be used when the user has started a scrollback search. In the future, there may be a model selection mode as well. Or maybe "search" and "modal selection" will be combined into a single "keyboard" mode. We'll see. Since the keyboard bindings depend on the current XKB keymap, translation from the user specified key combination string cannot be done when loading the configuration, but must be done when we've received a keymap from the wayland server. We should explore if it's possible to load some kind of default keymap just to be able to verify the validity of the key combination strings at configuration load time, to be able to reject the configuration at startup. A couple of key bindings have been added as proof of concept. Mouse bindings aren't handled at all yet, and is likely to be re-written. For example, we can probably translate the configuration strings at configuration load time.
* render: never render CSD and/or search box "immediately"Daniel Eklöf2020-03-06-9/+2
| | | | | | | | | | Handle the CSDs and the search box the same way we handle the main grid; when we need to redraw them, call render_refresh_{csd,search}(). This sets a flag that is checked after each FDM iteration. All actual rendering is done here. This also ties the commits of the Wayland sub-surfaces to the commit of the main surface.
* input: do a full CSD repaint on pointer motion over CSD buttonsDaniel Eklöf2020-03-03-31/+12
| | | | This fixes repainting issues on mutter.
* csd: initial implementation of minimize/maximize/close buttonsDaniel Eklöf2020-03-02-0/+81
|
* input: don't change xcursor if active surface isn't the main gridDaniel Eklöf2020-03-02-1/+1
|
* config: make CSD user configurableDaniel Eklöf2020-03-02-16/+15
| | | | | | | | | | | | | | The user can now configure the following: * Whether to prefer CSDs or SSDs. But note that this is only a hint to the compositor - it may deny our request. Furthermore, not all compositors implement the decoration manager protocol, meaning CSDs will be used regardless of the user configuration (GNOME/mutter being the most prominent one). * Title bar size and color, including transparency * Border size and color, including transparency Also drop support for rendering the CSDs inside the main surface.
* input: raise window 'move' timeout to 200msDaniel Eklöf2020-03-01-1/+1
| | | | | 100ms was a bit low and prevented double-tap on touchpads from working.
* input: use xdg_toplevel_resize_edge enum typeDaniel Eklöf2020-03-01-2/+2
|
* input: start window move right away if user starts dragging the windowDaniel Eklöf2020-02-29-0/+19
| | | | | | | | | | | | When the user left-clicks the title-bar, we start a timer. When the timer has elapsed, we initiate a 'move' operation. However, if the user clicked, and then started dragging right away, there was a very visible lag since we waited for the timeout before starting the move. Now, on a pointer motion event we detect a running 'move' timer, and abort it and instead start the 'move' operation right away.
* input: fix 'unused variable' warning (release builds)Daniel Eklöf2020-02-29-1/+2
|
* input: cleanupDaniel Eklöf2020-02-29-71/+69
|
* input: don't update xcursor on keyboard enter/leaveDaniel Eklöf2020-02-29-4/+2
| | | | | | | | | I'm not sure why I added this in the first place... our cursor doesn't depend on keyboard focus. Furthermore, with CSDs, we may get keyboard enter events for the CSD surfaces, and these should definitely *not* update the xcursor as if it was inside the main surface.
* input: csd: add a small delay before initiating a moveDaniel Eklöf2020-02-29-5/+36
| | | | | This ensures the user has time to double-click to toggle the maximized state.
* wayland: remove all usages of wayl_terminal_from_surface()Daniel Eklöf2020-02-29-3/+6
| | | | Use the 'user data' pointer from the wayland surface instead.
* wayland: store pointer to window instance in all surfacesDaniel Eklöf2020-02-29-1/+7
|
* input: reset mouse state on pointer leaveDaniel Eklöf2020-02-29-0/+3
|
* input: toggle maximized state when double-clicking the title barDaniel Eklöf2020-02-29-12/+11
|
* input: handle double/triple click state regardless of surfaceDaniel Eklöf2020-02-29-21/+23
|
* input: handle CSD border corners correctlyDaniel Eklöf2020-02-29-31/+87
| | | | That is, change to correct cursor, and do resize correctly.
* input: temporary code to trigger maximize/minimizeDaniel Eklöf2020-02-26-0/+12
|
* input: wip: trigger move/resize when left-clicking CSDDaniel Eklöf2020-02-25-5/+73
|
* input: pointer-motion/button: ignore actions in non-main surfacesDaniel Eklöf2020-02-24-0/+7
|
* input: pointer-leave: reset 'active-surface' in terminalDaniel Eklöf2020-02-24-1/+3
|
* input: pointer-enter: differentiate between the surfacesDaniel Eklöf2020-02-24-3/+33
|
* term: resize: pre-calculate right/bottom marginsDaniel Eklöf2020-02-24-2/+2
|
* input: fix xcursor getting stuckDaniel Eklöf2020-02-15-0/+8
| | | | | | | | | | | Apparently, a frame callback for the cursor surface is *never* triggered if we get a pointer-leave event *before* the callback is triggered. At least on Sway 1.4. This caused the cursor being stuck, and never updating once this state was reached. Fix by destroying the cursor frame callback on pointer-leave.
* input: ctrl+= increases font size, not resets itDaniel Eklöf2020-02-10-2/+2
|
* input: hook ctrl+{=,0} to term_font_size_reset()Daniel Eklöf2020-02-08-0/+5
|
* input: hook ctrl+{plus/KP-Add/minus/KP-Subtract} to term_font_size_{increase,decrease}Daniel Eklöf2020-02-08-0/+12
|
* presentation: store input timestamp in a per-commit contextDaniel Eklöf2020-01-21-2/+3
| | | | | This should reduce the risk of mixing up an input timestamp with the corresponding rendered frame.
* input: implement metaSendsEscape and eightBitMetaDaniel Eklöf2020-01-20-31/+69
|
* input: reset XKB compose state on keyboard leaveDaniel Eklöf2020-01-14-0/+1
|
* Revert "input: generate key down events on keyboard-enter"Daniel Eklöf2020-01-14-9/+1
| | | | This reverts commit 84739d78c626ad12543417dc1e3038abd6a4e2d5.
* input: generate key down events on keyboard-enterDaniel Eklöf2020-01-13-1/+9
|
* input: reset modifier state on keyboard-leaveDaniel Eklöf2020-01-13-0/+5
|
* input: commentsDaniel Eklöf2020-01-11-45/+57
|
* input: keymap_lookup: only do lookup, don't sent to clientDaniel Eklöf2020-01-11-11/+12
|
* input: add a switch-based function that translates XKB keysym to escape dataDaniel Eklöf2020-01-11-19/+105
|
* input: break out keymap lookup to a separate functionDaniel Eklöf2020-01-11-25/+35
|
* input: scroll: call term_mouse_up() once, after all term_mouse_down()Daniel Eklöf2020-01-04-0/+1
| | | | | Note that scroll button release events are not actually sent to the client, but this makes the code more correct, logically.
* selection: track selection type; normal or block selectionDaniel Eklöf2020-01-03-1/+3
|
* input: keyboard-leave: move comment to where it belongsDaniel Eklöf2020-01-02-3/+3
|
* term: rename term_focus_{in,out} -> term_kbd_focus_{in,out}Daniel Eklöf2020-01-02-2/+2
|
* wayland: rename focused/moused to kbd_focus/mouse_focusDaniel Eklöf2020-01-02-17/+17
|
* wayland: optionally use the presentation time protocol to measure input lagDaniel Eklöf2019-12-31-0/+2
| | | | | | | | | | | | | | | | | | | This adds a flag, -p,--presentation-timings, that enables input lag measuring using the presentation time Wayland protocol. When enabled, we store a timestamp when we *send* a key to the slave. Then, when we commit a frame for rendering to the compositor, we request presentation feedback. We also store a timestamp for when the frame was committed. The 'presented' callback then looks at the input and commit timestamps, and compares it with the presented timestamp. The delay is logged at INFO when the delay was less than one frame interval, at WARN when it was one frame interval, and at ERR when it was two or more frame intervals. We also update statistic counters that we log when foot is shut down.
* term: term_spawn_new(): new function, spawns a new foot/footclient processDaniel Eklöf2019-12-21-0/+5
| | | | Bind ctrl+shift+return to it
* cursor blink: move reset to pty inputDaniel Eklöf2019-12-19-3/+0
|
* input: restart cursor blink on keyboard inputDaniel Eklöf2019-12-16-0/+3
| | | | This makes the cursor stay unblinking while typing.
* input: discard canceled compose sequencesDaniel Eklöf2019-12-02-0/+2
|
* term: mouse reporting functions no longer take modifier stateDaniel Eklöf2019-11-30-8/+4
| | | | | | | | | | | | | | | | The mouse reporting functions are called from input when we receive Wayland mouse events. We used to pass the current keyboard modifier (shift, alt, ctrl, etc) to the terminal functions. This however is wrong, since we may receive Wayland mouse events without having keyboard focus. When we don't have keyboard focus, the modifier state doesn't apply to us. Remove the modifier arguments from the terminal mouse reporting functions. These functions now read this state directly instead, but only when the terminal instance in question has keyboard focus.
* input: doh! mouse_scroll: first argument to keyboard_key() is a struct waylandDaniel Eklöf2019-11-30-2/+2
| | | | This is the problem with void* user data pointers in callbacks...
* input: mouse_scroll: cache XKB_KEY_Up and XKB_KEY_DownDaniel Eklöf2019-11-30-2/+9
|
* input: update xcursor on terminal with *keyboard* focus when modifiers changeDaniel Eklöf2019-11-30-4/+2
|
* input: pointer-leave: reset moused *before* doing anything elseDaniel Eklöf2019-11-29-3/+8
| | | | And update xcursor. This is currently not necessary, but doesn't hurt.
* input: pointer-enter: add debug logDaniel Eklöf2019-11-29-0/+2
|