implemented shifting of entire rung
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user