v0.10.0 d5d679d

pointer_events.go RawHistoryFolder

1package ports
2
3// ConstraintMode is how a pointer constraint holds the pointer.
4type ConstraintMode uint8
5
6const (
7	ConstraintNone ConstraintMode = iota
8	// ConstraintLock keeps the pointer still: only relative motion flows.
9	ConstraintLock
10	// ConstraintConfine keeps the pointer inside Rect.
11	ConstraintConfine
12)
13
14// PointerConstraint is an active pointer constraint. Rect is logical: in
15// PointerConstrained it is window-local and empty means the whole window;
16// core sends input the resolved global rectangle, and in X, Y its cursor
17// position, where input holds a locked pointer. Warp moves input's
18// pointer to X, Y whatever the mode (wp_pointer_warp_v1).
19type PointerConstraint struct {
20	Mode ConstraintMode
21	Rect Rect
22	X, Y float64
23	Warp bool
24}
25
26// Clamp keeps a global point inside the rectangle of a lock or confine;
27// no constraint and an empty rectangle leave it unchanged.
28func (c PointerConstraint) Clamp(x, y float64) (float64, float64) {
29	if c.Mode == ConstraintNone || c.Rect.W <= 0 || c.Rect.H <= 0 {
30		return x, y
31	}
32	x = min(max(x, float64(c.Rect.X)), float64(c.Rect.X+c.Rect.W-1))
33	y = min(max(y, float64(c.Rect.Y)), float64(c.Rect.Y+c.Rect.H-1))
34	return x, y
35}
36
37// PointerConstrained carries wayland → core the constraint active on a
38// window (zwp_pointer_constraints_v1); ID 0 means none is active. A
39// constraint is active only on the window with both pointer and keyboard
40// focus.
41type PointerConstrained struct {
42	ID WindowID
43	PointerConstraint
44}
45
46func (PointerConstrained) clientEvent() {}
47
48// PointerWarp carries wayland → core a client's request to move the
49// pointer to X, Y, window-local logical (wp_pointer_warp_v1). Wayland has
50// checked that the window has the pointer and the point is on it.
51type PointerWarp struct {
52	ID   WindowID
53	X, Y float64
54}
55
56func (PointerWarp) clientEvent() {}

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 23

Tags 10

↑↓ moveenter openesc close