v0.3.0 cf370a0

input_events.go RawHistoryFolder

1package ports
2
3import "time"
4
5// Mods carries input → core modifier flags.
6type Mods uint8
7
8const (
9	ModShift Mods = 1 << iota
10	ModCtrl
11	ModAlt
12	ModSuper
13)
14
15// InputEvent carries input → core notifications.
16type InputEvent interface{ inputEvent() }
17
18// KeyEvent carries input → core key transitions; Keysym is an xkb keysym name.
19// Keycode is the evdev code (xkb keycode - 8) and State the xkb modifier state
20// after this transition; wayland forwards both to clients unchanged. Time is
21// the device timestamp (CLOCK_MONOTONIC), like SwipeBegin.Time.
22type KeyEvent struct {
23	Keysym string
24	// Base is the key's unshifted keysym in the active layout, so Cmd+Shift+1
25	// still matches a cmd+shift+1 bind although it prints exclam.
26	Base    string
27	Mods    Mods
28	Pressed bool
29	Time    time.Duration
30	Keycode uint32
31	State   ModState
32}
33
34// ModState is the serialized xkb modifier state sent in wl_keyboard.modifiers.
35type ModState struct{ Depressed, Latched, Locked, Group uint32 }
36
37func (KeyEvent) inputEvent() {}
38
39// PointerMotion uses global layout coordinates in logical pixels (see OutputPlacement).
40// DX and DY are the accelerated logical deltas and UnaccelDX, UnaccelDY the
41// raw device deltas; all four are 0 for absolute devices. Time is the device
42// timestamp (CLOCK_MONOTONIC).
43type PointerMotion struct {
44	X, Y                 float64
45	DX, DY               float64
46	UnaccelDX, UnaccelDY float64
47	Time                 time.Duration
48}
49
50func (PointerMotion) inputEvent() {}
51
52// PointerButton uses evdev button codes (BTN_LEFT is 0x110). Time is the
53// device timestamp (CLOCK_MONOTONIC).
54type PointerButton struct {
55	Button  uint32
56	Pressed bool
57	Time    time.Duration
58}
59
60func (PointerButton) inputEvent() {}
61
62// AxisSource tells how a scroll was made; values match wl_pointer.axis_source.
63type AxisSource uint8
64
65const (
66	AxisWheel AxisSource = iota
67	AxisFinger
68	AxisContinuous
69)
70
71// ScrollAxis is one scroll direction in a pointer frame. Value is in
72// surface pixels; V120 counts wheel detents in 1/120 steps (wheel only).
73// Stop ends a finger or continuous scroll on this axis.
74type ScrollAxis struct {
75	Set   bool
76	Value float64
77	V120  int32
78	Stop  bool
79}
80
81// PointerAxis is one scroll frame: Vertical, then Horizontal. Time is the
82// device timestamp (CLOCK_MONOTONIC).
83type PointerAxis struct {
84	Source               AxisSource
85	Vertical, Horizontal ScrollAxis
86	Time                 time.Duration
87}
88
89func (PointerAxis) inputEvent() {}
90
91// SwipeBegin starts a three- or four-finger touchpad swipe. Time is the
92// device timestamp (CLOCK_MONOTONIC), shared by the updates and the end.
93type SwipeBegin struct {
94	Fingers int
95	Time    time.Duration
96}
97
98// SwipeUpdate moves the fingers by the unaccelerated deltas DX, DY
99// (touchpad units, as libinput reports them, not natural-scroll inverted).
100type SwipeUpdate struct {
101	DX, DY float64
102	Time   time.Duration
103}
104
105// SwipeEnd lifts the fingers. Cancelled is set when libinput cancelled
106// the swipe (another finger landed).
107type SwipeEnd struct {
108	Cancelled bool
109	Time      time.Duration
110}
111
112func (SwipeBegin) inputEvent()  {}
113func (SwipeUpdate) inputEvent() {}
114func (SwipeEnd) inputEvent()    {}

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