implemented shifting of entire rung

This commit is contained in:
2024-08-22 18:21:07 -04:00
parent d03f997c6a
commit a3259f3b7d
4 changed files with 53 additions and 2 deletions
+19 -1
View File
@@ -40,10 +40,12 @@ import Brick.Keybindings
, keyEvents
, newKeyConfig
, onEvent
, shift
)
import Control.Monad.State.Class (modify)
import Data.Either (fromRight)
import Graphics.Vty.Input.Events (Key (KUp, KDown, KLeft, KRight))
import Graphics.Vty.Input.Events
(Key (KUp, KDown, KLeft, KRight, KHome, KEnd))
import Abacus.App.Actions
import Abacus.App.Types
@@ -69,6 +71,10 @@ eventBindings =
modify beadLeft
, onEvent BeadRightE "Moves a bead to the right" $
modify beadRight
, onEvent RungLeftE "Moves all beads to the left of the rung" $
modify rungLeft
, onEvent RungRightE "Moves all beads to the right of the rung" $
modify rungRight
]
-- | Key bindings
@@ -99,6 +105,18 @@ keyBindings =
, bind 'l'
]
)
, ( RungLeftE
, [ shift KLeft
, bind KHome
, bind 'H'
]
)
, ( RungRightE
, [ shift KRight
, bind KEnd
, bind 'L'
]
)
]
--jl