feat/data-dnd e05cb15

swipe.go RawHistoryFolder

1package headlessinput
2
3import (
4	"time"
5
6	"github.com/bnema/neferwl/internal/ports"
7	"golang.org/x/sys/unix"
8)
9
10// A scripted swipe is a quick flick, as libinput reports one: swipeSteps
11// updates of swipeStep touchpad units, one every swipeEvery.
12const (
13	swipeSteps = 10
14	swipeStep  = 40.0
15	swipeEvery = 8 * time.Millisecond
16)
17
18// swipeEvents is a swipe of fingers fingers toward (dx, dy), a unit
19// direction, starting at the device time start.
20func swipeEvents(fingers int, dx, dy float64, start time.Duration) []ports.InputEvent {
21	evs := []ports.InputEvent{ports.SwipeBegin{Fingers: fingers, Time: start}}
22	at := start
23	for range swipeSteps {
24		at += swipeEvery
25		evs = append(evs, ports.SwipeUpdate{DX: dx * swipeStep, DY: dy * swipeStep, Time: at})
26	}
27	return append(evs, ports.SwipeEnd{Time: at})
28}
29
30// monotonic is CLOCK_MONOTONIC, the clock of libinput's timestamps.
31func monotonic() time.Duration {
32	var ts unix.Timespec
33	_ = unix.ClockGettime(unix.CLOCK_MONOTONIC, &ts)
34	return time.Duration(ts.Nano())
35}

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 25

Tags 10

↑↓ moveenter openesc close