tvos How to let the user move focus more freely? - tvos

I am constructing a card-game (for tvos) where the user should be able to remove cards from a board.
At the end of the game only a few cards may be left at the board, and they might e.g. be arranged as the buttons in the picture below.
How can I let the user move focus from say button 1 to button 0 or 2?
In un-accepted answers to a similar question at SO, it was suggested that one should use an UIFocusGuide. I do not think that answer is applicable to my problem, because in that approach one must tell the focusGuide the preferredFocusedView in advance (e.g. before the user swipes in siri-remote)! In my case, the preferred next focus depends on the swipe direction, e.g. the focusHeading.

UIFocusGuide is the applicable way to handle this issue, and it is possible to assign each focus guide a preferredFocusedView in advance of knowing which direction the user would move (based on which button has the initial focus).
For example, here's a solution for your edited example that shows how it's possible to move the focus from focused button 1 to either button 0 or to button 2.
If the user swipes up or left, the focus would move into one of the green focus guides, which would change the preferred focus view to button 0.
If the user happened to swipe down or right from button 1, the focus would move into one of the blue focus guides, and button 2 would become focused.
As the focus changes, you update the focus guides to guide the focus back in the return direction. For example, once button 0 gained focus, you would update preferredFocusedView for the green focus guides to prefer button 1, so the user could then move down or right from focused button 0 and end up back at button 1.
Just keep in mind that you only need a focus guide if the Focus Engine can't determine the next view. You should test different scenarios to determine when a guide would actually be required.

Related

Editing Flip Card

In my Blazor application, I have implemented a card-flip on mouse click. Now I wanted to add the edit functionality, that is as the user clicks on Edit button they enters in edit mode and can edit the card contents directly from the UI. Any lead on how can I achieve it, would be helpful.
Here is the code BlazorFiddle
You could start by creating 2 templates for your front and back card layout, one template for Display and one template for Edit, then you could toggle visibility on those templates on an event and copy new values to replace the original ones when the event is fired to exit the Edit template or binding to an object/properties.
Check my take on your code using the binding option.
Also changed the flip event to a double click so you can click the inputs without flipping the card, it's still a little buggy for me, I can only click on the input in some areas of its end, other areas seems like the 'card back' div gets in the way, but I think it's a start so you could try out something on that line of thought and/or fixing those other issues.
https://blazorfiddle.com/s/dvz9ppon

Button on form looks like it is being constantly pressed after being clicked

I have a form in Access 2013 that uses a button to jump to another form.
However when the button is clicked certain requirements have to be met in order for the jump process to actually be executed. If the requirements are not met the user is forced to stay on the current form (with the button).
When this happens the button stays in the clicked (i.e. pressed down) state on the form, making it look like it's being constantly pressed.
(Note: If the button is clicked again and the requirements again aren't met it pops back out...)
Is there any way to change the appearance of the button back to the unclicked appearance after every click when the user is forced to stay on the current form?
Many thanks in advance for any kind of help!
A regular button can stay depressed for a short while, while its _Click() event procedure is running.
But once that finishes, it always returns to its normal state.
So the assumption was, that a toggle button was used instead, which turned out to be correct.

Buttons and links keyboard triggers

While doing research I came across this statement:
Warning: Be careful when marking up links with the button role.
Buttons are expected to be triggered using the Space key, while links
are expected to be triggered using the Enter key.
Does anyone know why a different key is used for buttons / links?
Is it ok to trigger using both Space and Enter?
Before reading this I, as a user, would have had no idea when to use Space or Enter.
Had a quick look at Google to see what they do.
For links Space scrolls down and Enter triggers
For buttons both Space and Enter trigger
Buttons are form elements.
If you select a checkbox element, space will toggle the checkbox while enter will submit the form.
So to be coherent, buttons act the same way. In practice, they accept both enter and space without any difference.
It is not only ok but you have to
Read inside the Third rule of ARIA:
For example, if using role=button the element must be able to receive focus and a user must be able to activate the action associated with the element using both the enter (on WIN OS) or return (MAC OS) and the space key.
This is for historical reason, not that it has been defined in any official recommendation, as far as I know
For instance an old bug from 2000 (https://bugzilla.mozilla.org/show_bug.cgi?id=56495) already stated that space bar was expected to work on buttons. Maybe an inheritance from Windows behavior.
I am speculating to answer #1, but I believe the keys used to activate buttons versus hyperlinks are holdovers from operating systems. For hyperlinks, think of Windows Help in Windows 95 and its reliance on in-content links, or Hypercard on the Mac prior to that. Also note that Space has scrolled a page in browsers since (IIRC) day one.
To answer number 2, no it is not OK. This is because a space bar triggers a page scroll and many users expect that when focus is on a hyperlink that pressing Space will just scroll the page.
In short, honor the keyboard mappings that are in place since there are users who rely on them and messing with them can have catastrophic consequences for users of assistive tech along with users with disabilities who do not use assistive tech.
Let me re-state what you saw at Mozilla:
A hyperlink can be fired by pressing the enter key. But a true button can be fired by pressing the enter key or the space bar. When a hyperlink has focus and the user presses the space bar, the page will scroll one screenful.
And then let me add this:
I think it’s also worth mentioning that events triggered by a space bar only fire when the key is released, whereas using the Enter key will fire the event as soon as you press the key down (prior to releasing it).
Source: Links, Buttons, Submits, and Divs, Oh Hell.

How to make the on click feature not last only while holding down the mouse?

I am trying to get my search boxes to change a different colour on click but at the moment it only changes colour for the duration of time I am holding down on my mouse. As soon as I let go of pressing down the cursor it changes back. How do I make it so it changes colour but as soon as I click something else on the page (even whitespace) it changes back to the original colour?
Take a look at this:
http://jsfiddle.net/LPVfn/
Cheers!
James
use
.search:focus
instead of
.search:active
There is a js library called HoverIntent. Maybe you could use it to get the desired effect.
http://cherne.net/brian/resources/jquery.hoverIntent.html
I'm currently using it to delay displaying a div tooltip for a few milliseconds after the user hovers over the search box.

What technology is used to display these elegant clickable options?

I am creating a small form where the user
Enters some text in an input box
Chooses from a bunch of options
regarding the actions that need to
be taken with the data
Clicks a submit button
Disconnect does something similar in a better way:
you can click on any of the five divisions here. This is wonderful because it makes it easier for users to perform the same task and simplifies choose and click to click.
What technology is used to display such a menu?
A nice way of doing this is - which doesn't need javascript - is to use radio buttons, but make them invisible. The clickable text and icon go inside of the label for each radio button, so you can click the label or icon to select the radio button.
This ensures a few important things:
Only one item can be selected
The selection is passed back with the form
The browser's native form handling still works
Accessibility options still work
You do have to be careful to make the labels obviously clickable, since you lose the visual cue of having the radio buttons visible.
IE6 & 7 also require a hack - they have a weird behaviour that a display:none or visibility:hidden radio button or checkbox cannot be selected by clicking its label.
Here's an example: http://www.spookandpuff.com/examples/clickableToggles.html
(I haven't included the icons - you can easily add these by setting them as the background in CSS for each item (don't use <img> tags).
Edit Oh man - I just read the question properly! Sorry, you want the behaviour to be 'choose' rather than 'choose and submit'... An easy way to do this is to add some javascript to the inputs to have them auto-submit the forms when they're selected. I've updated the example to show this.
Looks like JavaScript: https://github.com/disconnectme/disconnect.me