implemented movement of single beads

This commit is contained in:
2024-08-22 16:53:01 -04:00
parent af72ca74af
commit d03f997c6a
4 changed files with 55 additions and 2 deletions
+15 -1
View File
@@ -43,7 +43,7 @@ import Brick.Keybindings
)
import Control.Monad.State.Class (modify)
import Data.Either (fromRight)
import Graphics.Vty.Input.Events (Key (KUp, KDown))
import Graphics.Vty.Input.Events (Key (KUp, KDown, KLeft, KRight))
import Abacus.App.Actions
import Abacus.App.Types
@@ -65,6 +65,10 @@ eventBindings =
modify moveUp
, onEvent MoveDownE "Moves the cursor down" $
modify moveDown
, onEvent BeadLeftE "Moves a bead to the left" $
modify beadLeft
, onEvent BeadRightE "Moves a bead to the right" $
modify beadRight
]
-- | Key bindings
@@ -85,6 +89,16 @@ keyBindings =
, bind 'j'
]
)
, ( BeadLeftE
, [ bind KLeft
, bind 'h'
]
)
, ( BeadRightE
, [ bind KRight
, bind 'l'
]
)
]
--jl