need getFocus in addition to setFocus

right now, the standard way to do buttons is to capture the movement by doing:

display.getCurrentStage():setFocus(event.target)

on the “began” phase and

display.getCurrentStage():setFocus(nil)

on the “ended” phase. But that leaves the case where user puts the finger down outside, then moves into the object and releases in it. The way around it is to set the “BeganObject” local var to event.target, and check it within the “moved” and “ended” phases, but it would be a lot easier if there was a getFocus function so I could just check during the “moved” and “ended” phases if the object is currently capturing the touch. [import]uid: 160496 topic_id: 30012 reply_id: 330012[/import]

Actually, even better - make a new eventlistener - “focustouch” - that would do all that stuff internally - set the focus on “began”, only send “moved” and “ended”/“canceled” if the focus was set, and reset the focus when “ended”/“canceled”.

People are constantly asking in the forums about how to do that. This would make it transparent. [import]uid: 160496 topic_id: 30012 reply_id: 120207[/import]

Actually, even better - make a new eventlistener - “focustouch” - that would do all that stuff internally - set the focus on “began”, only send “moved” and “ended”/“canceled” if the focus was set, and reset the focus when “ended”/“canceled”.

People are constantly asking in the forums about how to do that. This would make it transparent. [import]uid: 160496 topic_id: 30012 reply_id: 120207[/import]