Hi Creators,
Today, we’re announcing the public release of our Lua library for gamepad and keyboard navigation helpers – Focus Navigation! This library was used to build our console app, and more recently, add support for keyboard + gamepad navigation on desktop and mobile.
We hope this library helps you build experiences that are more customized for different inputs and more accessible to users who prefer to use directional input for UI.
What Is It?
Focus Navigation is a library of helpers for building UI with more complex, app-like functionality that isn’t yet natively supported in the Roblox game engine. This includes things like restoring selection to a previous element after navigating away, having a default child object to select when selection enters a parent object, etc.
For example, this is how selection will behave when the useMostRecentOrDefault
hook is used for the Home page and Details page :
Whereas this is how it will behave otherwise:
As you can see, this can help the user navigate to objects of interest, like an item tile or play button. It also helps eliminate unpredictable behavior (like selection going to the search bar on Home in the demo)!
You can find the repository here: focus-navigation! Check out the documentation for a full rundown of the library’s APIs.
Wait, There’s Gamepad Support on Mobile?
Yes! Snuck this one in here! Right before the holidays, we enabled gamepad support on mobile (edit: in the app) – this includes phones and tablets – and keyboard support for Android.
This should make it so that users can seemlessly join, interact with, and move between experiences without needing to swap their input devices. We’re working through some native issues for keyboards on iOS, but hope to bring that to you soon as well!
Enjoy y’all!