I have a very simple menu to browse through a gallery of images, containing buttons for “Previous Image”, “Next Image” and “Back out of this Menu”. In the graph for this menu widget, I disable the Prev and Next buttons when the ends of the gallery are reached.
Disabled buttons still accept keyboard focus, which is not ideal for the user in this case, so I’ve tried to work around this by changing the navigation rules whenever a button is enabled or disabled, using “Set Navigation Rule”.
However, it seems that none of the changes I make using this function actually work. I can see that the navigation rules point to the correct widgets if I print them out using Get Navigation, but the actual behaviour when I attempt to navigate using the keyboard is always unchanged from the initial rules set when the widget was first created. Is there an obvious reason why this isn’t working?
Alternatively, is there a way to disable and enable “Is focusable” for buttons at runtime?
What is the real world problem you guys are trying to solve? If you want to stop user from pressing Left or Right when you reach the bounds, consider toggling visibility using Set Visibility node. That will address your issue with focus as well. If you choose Collapsed it will not appear at all (good outcome) or if you choose Hit Test Invisible it will become non-interactive.
My problem is that i have an additional focusable Widget which can be Visible or not alongside with other Widget (Main Menu buttons). Additional Widget is located above/upper the Main Widget. So when additional Widget is Hidden/Collapsed i can navigate from upper Main Menu button (Resume) to lower one (Quit) and vise versa (cross navigation in circle in both ways Up and Down). But when i Open additional Widget and Close it then i can’t circle Up from Resume to Quit. It just stops. I don’t know why. I tried both Hidden and Collapsed but this is not helped.