Skip to content

Commit

Permalink
Adding interface.go.
Browse files Browse the repository at this point in the history
  • Loading branch information
Macmod committed Sep 10, 2024
1 parent 57fa19b commit 7ad831a
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tui/interface.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package tui

import (
"github.com/gdamore/tcell/v2"
"github.com/rivo/tview"
)

func handleEscape(returnFocus tview.Primitive) func(*tcell.EventKey) *tcell.EventKey {
return func(event *tcell.EventKey) *tcell.EventKey {
if event.Key() == tcell.KeyEscape {
app.SetRoot(appPanel, true).SetFocus(returnFocus)
return nil
}
return event
}
}

0 comments on commit 7ad831a

Please sign in to comment.