From d399737e25c249d427ed4bc18401eb3e9793c857 Mon Sep 17 00:00:00 2001 From: John Marstall Date: Mon, 16 Oct 2017 17:38:37 -0500 Subject: [PATCH] Adds Event properties and Layer shortcuts for focus, unfocus, selected. --- FocusEngine.coffee | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/FocusEngine.coffee b/FocusEngine.coffee index 7036698..6e7b05e 100644 --- a/FocusEngine.coffee +++ b/FocusEngine.coffee @@ -266,3 +266,10 @@ measureDistance = (target, direction) -> # Pythagorean theorem to measure the hypoteneuse absoluteDistance = Math.sqrt(distanceX * distanceX + distanceY * distanceY) return absoluteDistance + +Events.Focus = "focus" +Layer::onFocus = (cb) -> @on(Events.Focus, cb) +Events.Unfocus = "unfocus" +Layer::onUnfocus = (cb) -> @on(Events.Unfocus, cb) +Events.Selected = "selected" +Layer::onSelected = (cb) -> @on(Events.Selected, cb)