implemented movement of single beads
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user