Skip to content

Commit

Permalink
Merge pull request #1173 from input-output-hk/ffakenz/fix-tui-key-bin…
Browse files Browse the repository at this point in the history
…dings

fix tui key bindings for exiting
  • Loading branch information
ch1bo committed Nov 23, 2023
2 parents e5da3f6 + b872cc0 commit d411872
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ changes.
- **BREAKING** Changes to persisted state:
- The internal chain state serialization changed when switching to inline datums.

- Fixed TUI key bindings for exiting in dialogs.

## [0.13.0] - 2023-10-03

- **BREAKING** Update to plutus 1.9. This changes the script hashes.
Expand Down
4 changes: 3 additions & 1 deletion hydra-tui/src/Hydra/TUI/Handlers.hs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ handleEvent ::
BrickEvent Name (HydraEvent Tx) ->
EventM Name RootState ()
handleEvent cardanoClient client e = do
handleGlobalEvents e
handleVtyEventVia (handleExtraHotkeys (handleEvent cardanoClient client)) () e
zoom logStateL $ handleVtyEventVia handleVtyEventsLogState () e
handleAppEventVia handleTick () e
Expand All @@ -52,6 +51,9 @@ handleEvent cardanoClient client e = do
zoom connectionL $ handleBrickEventsConnection cardanoClient client e
zoom (logStateL . logMessagesL) $
handleAppEventVia handleHydraEventsInfo () e
-- XXX: Global events must be handled as the very last step.
-- Any `EventM` that decides to `Continue` would override the `Halt` decision.
handleGlobalEvents e

handleExtraHotkeys :: (BrickEvent w e -> EventM n s ()) -> Vty.Event -> EventM n s ()
handleExtraHotkeys f = \case
Expand Down
1 change: 1 addition & 0 deletions hydra-tui/src/Hydra/TUI/Handlers/Global.hs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ handleVtyQuitEvents = \case
EvKey (KChar 'c') [MCtrl] -> halt
EvKey (KChar 'd') [MCtrl] -> halt
EvKey (KChar 'q') [] -> halt
EvKey (KChar 'Q') [] -> halt
_ -> pure ()

handleVtyGlobalEvents :: Vty.Event -> EventM n s ()
Expand Down

0 comments on commit d411872

Please sign in to comment.