~ssttevee


#87 gesture.Click stays focused after mouse out a month ago

Comment by ~ssttevee on ~eliasnaur/gio

I've been thinking about whether the focused state belong as a state of a click. Under the current model, an area cannot be both hovered and pressed simultaneously, which by logic is possible.

I can convince myself that a click gesture only involves whether or not the switch on my mouse is depressed and not necessarily the position of the pointer. In contrast, the definition of a hover gesture is whether or not the pointer is within the region, which does depend on the position of the pointer.

Taking this into account, I think the focused state should be moved into its own unit or removed all together.

#87 gesture.Click stays focused after mouse out a month ago

Comment by ~ssttevee on ~eliasnaur/gio

Thanks for the pointers, I've submitted a patch introducing the Enter and Leave pointer.Types.

Should the focused state of gesture.Click be updated to reflect a css hover or a focus like a html button?

#87 gesture.Click stays focused after mouse out a month ago

Ticket created by ~ssttevee on ~eliasnaur/gio

I'm not sure if this is expected behaviour, but it doesn't align with other pointer events that I'm familiar with (which is mostly from the browser). The problem could also be that the use of the word focused doesn't match that of the browser. Right now it seems like a hybrid of hover and focus: mouseover to focus, click elsewhere to unfocus.

So, I assumed focus means hover in browser speak, and dug into the internals.

It looks like router.Events() only returns pointer.Move events when the pointer is intersecting with the specified area thus not giving a chance to unfocus. I had to stop at once I hit the ops package since I'm new here and everything's still way over my head.

My goal is to create a gesture.Hover that works like that of the browser.