Controllers: classic sliders are focus targets; the D-pad nudges with A held

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Ludovic Marie
2026-10-14 18:42:13 +02:00
parent b58e96436a
commit 79ea17ffc5
3 changed files with 17 additions and 1 deletions
@@ -263,6 +263,18 @@ impl Game<'_> {
self.pad_take_pointer(event_loop);
return;
}
// With A held (a slider grabbed, a drag), the D-pad nudges instead.
if self.pad.menu.held[0] {
let (dx, dy) = match button {
Button::DPadLeft => (-2.0, 0.0),
Button::DPadRight => (2.0, 0.0),
Button::DPadUp => (0.0, -2.0),
_ => (0.0, 2.0),
};
let at = self.cursor;
self.pad_pointer_to(event_loop, (at.0 + dx, at.1 + dy));
return;
}
let from = self.cursor;
let targets = self.pad_targets();
if let Some(i) = gamepad::focus_step(from, button, &targets) {
+4
View File
@@ -283,6 +283,10 @@ pub fn slider(
hover: bool,
active: bool,
) {
if active {
// A controller's D-pad can focus it (Horizon's controller support).
crate::widgets::target([x, y, w, 20.0]);
}
let track = if hover && active {
"gui/sprites/widget/slider_highlighted"
} else {
+1 -1
View File
@@ -82,7 +82,7 @@ and Java's controller mods do), not focus navigation:
(half stack / place one), Y = quick move (shift-click), B = back / close.
- LB / RB switch creative tabs and recipe book pages; right stick scrolls
(creative grid, lists, chat).
- Sliders: A grabs, the stick or D-pad left/right moves, A releases.
- Sliders: hold A on the slider and move the stick, or nudge with the D-pad.
- Text fields: the Steam Deck's keyboard (Steam + X) types into them like a
real keyboard. Other platforms have no on-screen keyboard yet; text input
needs a keyboard.