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

How would you implement focus? Is it something Guido should explicitly help with? #8

Open
JobLeonard opened this issue Jun 9, 2014 · 4 comments

Comments

@JobLeonard
Copy link

I've been puzzling over this. I'm only bothering with the mouse - no "TAB to switch focus" problems, although that might also be interesting to investigate. There's two ways to go with this:

  • focus is lost if the user clicks anywhere else. This one's pretty darn easy to implement of course - just add a focus bool, set it to true if a mouse click overlaps and to false if not.
  • focus is lost only if the user clicks on another item that can get focus. This is the one I've been puzzling over. Getting focus is easy, but how to transmit to other UI elements it has lost focus? I figured that one way would be if the Guido library allows you to to send a message to the Interactive object, and that the latter "broadcasts" that message to all other objects registered by triggering a messageReceived function (like it now triggers mouse events). Or perhaps an 'Interactive.grabFocus(this)' function, which triggers a 'lostFocus' function in all other objects? I don't know if this is the best approach though.

Thoughts?

@fjenett
Copy link
Owner

fjenett commented Jun 9, 2014

Good point. Need to research … thanks!

@JobLeonard
Copy link
Author

BTW, does Guido also send key presses to registered objects, like it does with the mouse events? If so, the "disabled list" example could be updated to highlight this, no? (should this be a separate issue?)

@fjenett
Copy link
Owner

fjenett commented Jun 9, 2014

Nope, only mouse stuff. But keypressed might be interesting for fast navigation, that is true. Yes, separate issue please.

@JobLeonard
Copy link
Author

Done:

#9

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