MartinHowarth / shimmer

Create games in python, without hassle - batteries included!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add focusable box

MartinHowarth opened this issue ยท comments

This is a possible solution for #39. Some overlap with the z based event system issue as well.

This box has a focusable attribute. Only one box can be focused at once, and there is a global stack of focused ordering (e.g. one with current focus disappears, so the next one down gets focus automatically).

One way to take focus is by clicking on the box - c.f. overlapping windows.

Possible effects:

  • makes focused thing appear on top (high visual z index)

  • For any mouse event within the box, only it and it's children are allowed to handle them

  • need special case for drag event? Because can drag off the box, c.f. special handling in drag anchor

  • the focus box and its children get first dibs on keyboard events, but do not capture all of them

  • need to consider whether the children event handlers are removed from the global director event system if they are part of a focus group. This would stop them being called twice if the focus box handles passing the events down??

๐ŸŽ‰ This issue has been resolved in version 1.0.0 ๐ŸŽ‰

The release is available on GitHub release

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€