Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Back button on non touch device #34

Closed
Ptosiek opened this issue Oct 3, 2023 · 2 comments
Closed

Back button on non touch device #34

Ptosiek opened this issue Oct 3, 2023 · 2 comments

Comments

@Ptosiek
Copy link
Contributor

Ptosiek commented Oct 3, 2023

I'm struggling a bit setting the focus on proper widget (Trying to replace the code setting focus_widget/delete_focus).
I did have fixed it but I actually wonder. If I understand properly the logic:

  • If we have touch, no focus is set by default, which ends up being the back button
  • If we don't have touch, the focus tried to be set on first element or back button.

Now we can have the case where touch is broken/user wants to use the physical buttons anyway. (I guess that it's why the delete_focus is made only when not on the Pi). So we need something to focus by default: which ends up being the (graphical) back button in that case.
But, we can always leave the screen by using the physical one so it's a bit redundant. Actually for a 'pure' non touch device the graphical back button is hardly gonna be used.

I think by:

  1. having the back button never focusable.
  2. having always focus set a similar way if touch/no touch device.

This would very much simplify the code around setting the next focus widget . The only con is see is that even on touch device we will have something focused in (as in: a menu item compared to the back button previously) when opening menu

(for 1. we could remove the graphical back button for non-touch devices, but probably better not doing it)

P.S: Prob an error in the documentation:
image
A and E in that case should be Left (<) and Right (>)

@Ptosiek
Copy link
Contributor Author

Ptosiek commented Oct 3, 2023

Seems to be a rabbit hole and NO_FOCUS policy not always working.
Will keep the actual logic for now

@Ptosiek Ptosiek closed this as completed Oct 3, 2023
@hishizuka
Copy link
Owner

hishizuka commented Oct 5, 2023

Hi @Ptosiek , thanks for your opinion.

My thoughts are right in line with your predictions,

  1. If mouse or touch can be used, don't show focus (no need to show it).
  2. If only buttons can be used, set the focus

The graphical back button was created in case only 2 or 3 buttons can be used.
For example,
https://www.dfrobot.com/product-1866.html

Thanks for pointing out the documentation. I'm not sure I have all the right wording. I will fix it soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants