-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1dac3bd
commit daf4aac
Showing
5 changed files
with
39 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,22 @@ | ||
using Toybox.WatchUi as Ui; | ||
|
||
class TimerDelegate extends Ui.BehaviorDelegate { | ||
class TimerDelegate extends Ui.InputDelegate { | ||
|
||
hidden var model; | ||
hidden var started = false; | ||
|
||
function initialize(mdl) { | ||
model = mdl; | ||
BehaviorDelegate.initialize(); | ||
InputDelegate.initialize(); | ||
} | ||
|
||
function onSelect() { | ||
if (!started){ | ||
function onKey(evt) { | ||
if(evt.getKey() == Ui.KEY_ENTER && !started) { | ||
model.start(); | ||
started = true; | ||
} | ||
return true; | ||
} | ||
|
||
return true; | ||
} else { | ||
return InputDelegate.onKey(evt); | ||
} | ||
} | ||
} |