Pick with the mouse
Click a tile to pick it, scroll to move the selection. Hovering does not move the selection: the keyboard keeps that, and a click acts on whatever is under the cursor instead. A click on the margin, on a gap, or on an empty cell of a ragged last row does nothing. Tiles are already subsurfaces, so a click on a thumbnail identifies its tile by which surface the event arrived on — no hit-testing needed. Only the chrome around them (padding, labels, gaps) needs Layout::hit, which inverts the same maths elem() lays out with, and is tested against it. Picking waits for press and release on the same tile, so sliding off a tile before letting go is not a pick. wp_cursor_shape_v1 sets the pointer shape, which spares us a cursor theme and libwayland-cursor; without it the cursor keeps whatever shape the window underneath gave it. It is optional — a compositor without it just gets whatever shape was already there.
This commit is contained in:
@@ -95,8 +95,16 @@ chooser_cmd=wl-pick --format portal
|
||||
| `→` `←` / `l` `h` / `Tab` `Shift+Tab` | next / previous tile |
|
||||
| `↓` `↑` / `j` `k` | move a row |
|
||||
| `Home` `End` | first / last |
|
||||
| `Enter` | pick |
|
||||
| `Enter` | pick the selection |
|
||||
| `Escape` / `q` | cancel |
|
||||
| click | pick that tile |
|
||||
| scroll | next / previous tile |
|
||||
|
||||
Hovering deliberately does not move the selection — the keyboard keeps it, and a
|
||||
click acts on whatever is under the cursor. Clicking the margin, a gap, or an
|
||||
empty cell of a ragged last row does nothing. Tiles are subsurfaces, so a click
|
||||
on a thumbnail identifies its tile by surface; only clicks on the chrome around
|
||||
them need hit-testing.
|
||||
|
||||
Navigation reads raw evdev keycodes, so it is layout-independent — but it also
|
||||
means virtual-keyboard clients such as `wtype` (which invent their own keymap)
|
||||
@@ -181,5 +189,6 @@ shm.rs memfd allocation and the ARGB painter
|
||||
|
||||
```
|
||||
cargo build --release
|
||||
cargo test # grid geometry, ellipsising, output formats, glyph output
|
||||
cargo test # grid geometry and hit-testing, ellipsising, output
|
||||
# formats, glyph output
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user