aboutsummaryrefslogtreecommitdiff
path: root/input.c (unfollow)
Commit message (Collapse)AuthorLines
2019-11-30input: mouse_scroll: cache XKB_KEY_Up and XKB_KEY_DownDaniel Eklöf-2/+9
2019-11-30input: update xcursor on terminal with *keyboard* focus when modifiers changeDaniel Eklöf-4/+2
2019-11-29input: pointer-leave: reset moused *before* doing anything elseDaniel Eklöf-3/+8
And update xcursor. This is currently not necessary, but doesn't hurt.
2019-11-29input: pointer-enter: add debug logDaniel Eklöf-0/+2
2019-11-29input: keyboard_leave: reset focused *before* doing anything elseDaniel Eklöf-4/+6
And update xcursor. This is necessary since we may still have mouse focus. But without keyboard focus, we don't display the 'text' xcursor.
2019-11-28input: keyboard/pointer_leave: warn if we didn't see corresponding enter eventDaniel Eklöf-0/+10
2019-11-28input: keyboard/pointer_enter: assert surface != NULLDaniel Eklöf-0/+5
2019-11-28terminal: use the 'text' xcursor pointer whenever selection is possibleDaniel Eklöf-1/+7
2019-11-28input: pointer_button: apply same workaround as in pointer_motionDaniel Eklöf-1/+18
Sway 1.2 has been seen to send pointer_button events without first having sent pointer_enter.
2019-11-28input: sway 1.2 bug: keyboard_leave() called with surface == NULLDaniel Eklöf-2/+4
2019-11-23input: document why wayl->focused may be NULLDaniel Eklöf-1/+7
2019-11-22input: improve behavior when sway bugs outDaniel Eklöf-3/+17
When we receive a keyboard_key or pointer_motion event without first having received a keyboard_enter or pointer_enter event (that being the "sway bugs" part), we generally don't know _which_ terminal window the event was intended for. However, if we only have *one* window open (always the case for a regular 'foot' process, or when there's a single footclient connected to a foot server process), then obviously we can "guess" which window the event was intended for... so do that. Now, the only time the event is ignored is when we're a server process with more than one window open (= more than one footclient connected).
2019-11-22input: use xkb_keymap_key_repeats() to determine if we should start repeat timerDaniel Eklöf-19/+19
2019-11-22input: keyboard_key: don't start repeater unless we generated outputDaniel Eklöf-54/+57
I.e. what we're effectively doing is *not* repeating modifier keys. Besides being the "right" thing to do, this also works around another Sway 1.2 bug, where being in a focused foot window and then switching to a vt and back would cause us to be stuck in an endless key repeat loop that would only stop when unfocusing, focusing back and then unfocusing once again.
2019-11-22input: workaround buggy Sway sending bad input eventsDaniel Eklöf-0/+21
Sway 1.2 has been seen sending keyboard_key() events without first sending a keyboard_enter() event. This can be triggered by: 1. start a foot terminal 2. unfocus it (move focus to another window) 3. switch to a vt 4. switch back to sway 5. focus the foot terminal At this point, Sway will *not* send the keyboard_enter() event, but instead send a keyboard_key() event. (furthermore, if you now unfocus the window again, sway will send a keyboard_leave() event, still without having sent a keyboard_enter() event). Sway has _also_ been seen crashing in wl_pointer_motion(). Though this was in a build without proper debug information, everything points to a similar issue - i.e. sway is sending a motion event without first having sent an enter event. Workaround this by detecting this and logging a warning the first time it happens. The event is then ignored.
2019-11-22keyboard repeat: pass current input serial to keyboard_key()Daniel Eklöf-1/+3
This fixes an assertion when holding in ctrl+shift+c (copy to clipboard); subsequent "presses" would set the clipboard serial to 0, which we would then assert on in the next iteration when we tried to cancel the previous copy.
2019-11-21input: may get keyboard_exit() event with no focused terminalDaniel Eklöf-1/+5
This happens on Sway when exiting a screen locker. Or at least that's when we see the problem; it's unclear if the event occurs when starting the screen locker, or when exiting it. Or maybe its both. Anyway, don't try to unfocus a NULL-terminal.
2019-11-20Revert "input: remove unneeded(?) term_reset_view() calls"Daniel Eklöf-2/+2
This reverts commit 739c5cf7f026bd7792f94276e8d6b2587a6ff597. The original commit stated: Not sure why these were added here; they don't appear to be needed (we're writing to the client - it's up to the client to echo stuff, in which case we redraw as usual). But, client output doesn't cause a scrollback/view reset.
2019-11-04input: remove unneeded(?) term_reset_view() callsDaniel Eklöf-2/+2
Not sure why these were added here; they don't appear to be needed (we're writing to the client - it's up to the client to echo stuff, in which case we redraw as usual).
2019-11-02Rename: vt_to_slave() -> term_to_slave()Daniel Eklöf-4/+4
2019-10-27wayland: move reload_cursor_theme() and update_cursor_surface() to waylandDaniel Eklöf-1/+1
2019-10-27input: input_repeat() takes a 'struct wayland' pointerDaniel Eklöf-2/+2
2019-10-27wayland: change all wayland callbacks to take a wayland pointerDaniel Eklöf-121/+139
Instead of passing the terminal to the wayland callbacks, pass a 'struct wayland' pointer.
2019-10-27kbd: move into waylandDaniel Eklöf-68/+68
2019-09-26input: scale coordinates in wl_pointer_enter()Daniel Eklöf-2/+2
2019-09-26main: initialize scale to '1'Daniel Eklöf-3/+2
This ensures we always have a valid (but possibly incorrect) scaling value. This allows us to simplify code that uses the scale - it doesn't have to verify the scale if valid. Furthermore, since render_resize() is the function that actually updates term->scale, make sure to call it *before* updating the cursor (otherwise, the cursor will use the old scaling value).
2019-08-30input: take scale into account when converting mouse coords to row/colDaniel Eklöf-2/+3
2019-08-30input: bug: account for margins when converting mouse coords to row/colDaniel Eklöf-2/+2
2019-08-28input: call term_reset_view() instead of duplicating codeDaniel Eklöf-10/+3
2019-08-27input: cancel search on mouse button eventsDaniel Eklöf-0/+2
2019-08-27search: wip: re-direct input while searching, and build a search bufferDaniel Eklöf-3/+15
This adds a new state, 'is_searching'. While active, input is re-directed, and stored in a search buffer. In the future, we'll use this buffer and search for its content in the scrollback buffer, and move the view and create a selection on matches. When rendering in 'is_searching', everything is dimmed. In the future, we'll render the current search buffer on-top of the dimmed "regular" terminal output.
2019-08-19input: back out accidental commit of debug codeDaniel Eklöf-1/+1
2019-08-19csi: implement CSI ? 1007 h/l - alternateScrollDaniel Eklöf-6/+22
When enabled, mouse scrolls in the alternate screen are converted to up/down key presses.
2019-08-15input: remove debug outputDaniel Eklöf-1/+0
2019-08-15input: handle meta modifier when modifying "other" keysDaniel Eklöf-1/+12
When handling keys without a specific map defined (i.e. keys corresponding roughly to xterm's "otherKeys"), recognize the meta modifier and report the correct modifier code.
2019-08-15input: track meta modifierDaniel Eklöf-2/+7
2019-08-12input: free previous XKB state when we get a new oneDaniel Eklöf-0/+20
2019-08-09input: don't paste from primary if client is mouse trackingDaniel Eklöf-1/+1
2019-08-06selection/input: triple click selects an entire rowDaniel Eklöf-12/+22
2019-08-05input: use a timer fd to handle keyboard key repeatDaniel Eklöf-29/+39
Instead of running a repeater thread that writes the key to repeat over a pipe, use a simple timer fd. No more locking or condition signalling. No need to track start/stop/exist states. We simply set up the initial timeout value to be the 'delay', and the interval to be the repeat 'rate'.
2019-08-05selection: mark-word using spaces only as word separatorDaniel Eklöf-1/+2
When the user double-clicks with ctrl pressed, we now select the word under the cursor using spaces only as word separator.
2019-08-02cell: pack more efficiently and store glyph as a wcharDaniel Eklöf-24/+31
The 'attributes' struct is now 8 bytes and naturally packed (used to be 9 bytes, artificially packed). 'cell' struct is now 12 bytes, naturally packed (used to be 13 bytes, artificially packed). Furthermore, the glyph is stored as a wchar instead of a char*. This makes it easier (faster) to do glyph lookup when rendering.
2019-07-30input: fix 'comparison ... is always true' warning (clang)Daniel Eklöf-3/+3
2019-07-30input: use keyboard enter serial only for selection serialDaniel Eklöf-7/+0
2019-07-26input: generate escape sequences for "other" keysDaniel Eklöf-6/+34
This corresponds to xterm's modifyOtherKeys option, though the code needs more testing and cleanup.
2019-07-26mouse: use discrete axis event if availableDaniel Eklöf-22/+33
This improves the scroll experience with certain devices
2019-07-19input: store last seen wayland input serialDaniel Eklöf-1/+10
We need this for clipboard data
2019-07-17selection: implement double-click-to-select-wordDaniel Eklöf-4/+24
2019-07-16csi: implement FocusIn/Out eventsDaniel Eklöf-0/+2
2019-07-15Use vt_to_slave() instead of calling write(term->ptmx, ...) everywhereDaniel Eklöf-3/+4
2019-07-11input: cancel selection on any mouse *except* BTN_LEFTDaniel Eklöf-1/+1
2019-07-11selection: implement copy *to* primaryDaniel Eklöf-1/+1
2019-07-11selection: add selection_from_primary() API (stub for now)Daniel Eklöf-1/+4
2019-07-11selection: add support for pasting from clipboardDaniel Eklöf-0/+5
2019-07-11selection: initial copy-to-clipboard functionalityDaniel Eklöf-0/+7
2019-07-11input: call selection_finalize() when BTN_LEFT is releasedDaniel Eklöf-0/+2
2019-07-11input: ignore mouse motion outside our windowDaniel Eklöf-0/+3
2019-07-11selection: add a selection APIDaniel Eklöf-28/+17
2019-07-11selection: only left button can be used for selectionDaniel Eklöf-6/+14
2019-07-11selection: selections can be made, and are renderedDaniel Eklöf-0/+21
* Start selection on mouse button down * Update selection on motion * Button release cancels selection if there were no motion after start * Renderer detects cells inside the selection and inverts their colors
2019-07-10input: generate BTN_BACK/BTN_FORWARD mouse down events when scrollingDaniel Eklöf-2/+14
2019-07-10scrollback: initial support for mouse scrollingDaniel Eklöf-2/+14
2019-07-09wip: initial scroll back supportDaniel Eklöf-0/+27
Can scroll up and down, and stops when the beginning/end of history is reached. However, it probably breaks when the entire scrollback buffer has been filled - we need to detect when the view has wrapped around to the current terminal offset. The detection of when we've reached the bottom of the history is also flawed, and only works when we overshoot the bottom with at least a page. Resizing the windows while in a view most likely doesn't work. The view will not detect a wrapped around scrollback buffer. I.e. if the user has scrolled back, and is stationary at a view, but there is still output being produced. Then eventually the scrollback buffer will wrap around. In this case, the correct thing to do is make the view start following the beginning of the history. Right now it doesn't, meaning once the scrollback buffer wraps around, you'll start seeing command output...
2019-07-09input: split up keymapDaniel Eklöf-12/+15
This makes the top level table smaller, and faster to search through. Eventually, we could do something fancy, like b-search the top level table.
2019-07-09input: implement keypad application modeDaniel Eklöf-108/+33
This commit also replaces the previous (temporary) key map with a much more complete one.
2019-07-09terminal: rename and redefine cursor keys mode and keypad keys modeDaniel Eklöf-2/+2
2019-07-09input: add support for dead keys (composing)Daniel Eklöf-3/+25
2019-07-05input: bug: row is calculated from the cell *height*, not widthDaniel Eklöf-3/+3
2019-07-05vt: add support for mouse motion reportsDaniel Eklöf-39/+43
2019-07-05vt: add support for \E[?1000h - report mouse button eventsDaniel Eklöf-4/+34
2019-07-05input: mouse eventsDaniel Eklöf-0/+80
2019-07-03logging: disable debug logging by defaultDaniel Eklöf-1/+1
2019-06-23vt: implement DECCKM (cursor key sends either SS3 or CSI escapes)Daniel Eklöf-25/+24
2019-06-22input: reduce utf8 buffer sizeDaniel Eklöf-1/+3
2019-06-22input: add a key mapping table, mapping key syms to escape sequencesDaniel Eklöf-12/+123
At the same time, also add support for the shift modifier.
2019-06-21input: stop key repeater when input focus is lostDaniel Eklöf-3/+7
2019-06-19wip: initial input handlingDaniel Eklöf-0/+173