added reset key
This commit is contained in:
parent
2f50ed51be
commit
52c7634121
@ -57,7 +57,9 @@ import Graphics.Vty.Input.Events
|
|||||||
, KPageDown
|
, KPageDown
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
import Lens.Micro.Platform ((%=))
|
||||||
|
|
||||||
|
import Abacus
|
||||||
import Abacus.App.Actions
|
import Abacus.App.Actions
|
||||||
import Abacus.App.Types
|
import Abacus.App.Types
|
||||||
|
|
||||||
@ -90,6 +92,8 @@ eventBindings =
|
|||||||
modify rungLeft
|
modify rungLeft
|
||||||
, onEvent RungRightE "Moves all beads to the right of the rung" $
|
, onEvent RungRightE "Moves all beads to the right of the rung" $
|
||||||
modify rungRight
|
modify rungRight
|
||||||
|
, onEvent ResetBeadsE "Resets the beads on the abacus" $
|
||||||
|
abacus %= resetAbacus
|
||||||
] ++ map
|
] ++ map
|
||||||
( \n -> onEvent (SelRungE n) "Moves to a numbered rung" $
|
( \n -> onEvent (SelRungE n) "Moves to a numbered rung" $
|
||||||
modify $ selRung n
|
modify $ selRung n
|
||||||
@ -148,6 +152,9 @@ keyBindings =
|
|||||||
, bind 'L'
|
, bind 'L'
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
, ( ResetBeadsE
|
||||||
|
, [bind 'r']
|
||||||
|
)
|
||||||
] ++ map
|
] ++ map
|
||||||
( \n ->
|
( \n ->
|
||||||
( SelRungE n
|
( SelRungE n
|
||||||
|
@ -60,6 +60,7 @@ data KeyEventID
|
|||||||
| BeadRightE
|
| BeadRightE
|
||||||
| RungLeftE
|
| RungLeftE
|
||||||
| RungRightE
|
| RungRightE
|
||||||
|
| ResetBeadsE
|
||||||
| SelRungE Int
|
| SelRungE Int
|
||||||
deriving (Eq, Ord, Show)
|
deriving (Eq, Ord, Show)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user