Replies: 1 comment 8 replies
-
Hey! Interesting thing you got in your hands! You can read whether an element is focused or not with the Example: #[allow(non_snake_case)]
fn CoolComp() -> Element {
let mut focus = use_focus();
let is_focused = focus_manager.is_focused();
rsx!(
rect {
width: "100",
height: "60",
focus_id: focus.attribute(),
background: "rgb(45, 45, 45)",
color: "white",
label {
"Am I focused? {is_focused}"
}
}
)
} Not sure what you meant by
Let me know if that works or if you still need help :) |
Beta Was this translation helpful? Give feedback.
-
Hello! Amazing library. I got it running on my RGB30 handheld console with little hassle now that it's running the mainline kernel.
I am trying to figure out how I can use the accessibility apis to enable navigation using the gamepad.
I can successfully focus next/prev node using gilrs and use_platform() hook:
Now I am trying to figure out how to get the currently focused nodeId so that I can trigger the click handler:
Is there some way I can access the
focused_id
?freya/crates/core/src/platform_state.rs
Line 8 in 1cd1d2c
Would it make sense to add it to
use_platform_information
or some other way to access the focused_id? Perhaps adding it as a PluginEvent?Or am I doing this from the wrong direction, is there a smarter way to integrate gamepad/inject custom keyboard/accessability events?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions