FlxKeyShortcutHandler
This commit is contained in:
@@ -4,13 +4,12 @@
|
||||
// Hold left-click to hide the habit text and see the image clearly:
|
||||
(when entryTexts (if FlxG.mouse.pressed (remove entryTexts) (add entryTexts)))
|
||||
// Handle keyboard input:
|
||||
(let [:FlxKey id (FlxG.keys.firstJustPressed)]
|
||||
(unless (= id -1)
|
||||
(shortcutHandler.handleKey (.toLowerCase (id.toString))))))
|
||||
(when shortcutHandler
|
||||
(shortcutHandler.update)))
|
||||
|
||||
(prop &mut :FlxTypedGroup<FlxText> entryTexts null)
|
||||
(prop &mut :FlxTypedGroup<FlxSprite> rewardBlockers null)
|
||||
(prop &mut :KeyShortcutHandler<Entry> shortcutHandler null)
|
||||
(prop &mut :FlxKeyShortcutHandler<Entry> shortcutHandler null)
|
||||
|
||||
(prop &mut :HabitModel model null)
|
||||
|
||||
@@ -21,7 +20,7 @@
|
||||
|
||||
(method setModel [m]
|
||||
(set model m)
|
||||
(set shortcutHandler (new KeyShortcutHandler))
|
||||
(set shortcutHandler (new FlxKeyShortcutHandler))
|
||||
|
||||
(let [p (m.totalPoints)
|
||||
&mut i 0
|
||||
|
Reference in New Issue
Block a user