Skip to content

Commit

Permalink
Merge pull request #523 from Seanstoppable/fixkeyboardfallthrough
Browse files Browse the repository at this point in the history
Fix keyboard fallthrough
  • Loading branch information
senorprogrammer authored Aug 4, 2019
2 parents a1aafbe + 10772c2 commit c55b542
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions app/wtf_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ func NewWtfApp(app *tview.Application, config *config.Config, configFilePath str
pages: tview.NewPages(),
}

wtfApp.app.SetInputCapture(wtfApp.keyboardIntercept)
wtfApp.widgets = maker.MakeWidgets(wtfApp.app, wtfApp.pages, wtfApp.config)
wtfApp.display = NewDisplay(wtfApp.widgets, wtfApp.config)
wtfApp.focusTracker = NewFocusTracker(wtfApp.app, wtfApp.widgets, wtfApp.config)
wtfApp.validator = NewModuleValidator()

wtfApp.pages.AddPage("grid", wtfApp.display.Grid, true, true)
wtfApp.app.SetRoot(wtfApp.pages, true)
wtfApp.app.SetInputCapture(wtfApp.keyboardIntercept)

wtfApp.validator.Validate(wtfApp.widgets)

Expand Down Expand Up @@ -86,13 +86,11 @@ func (wtfApp *WtfApp) keyboardIntercept(event *tcell.EventKey) *tcell.EventKey {
return nil
case tcell.KeyTab:
wtfApp.focusTracker.Next()
return nil
case tcell.KeyBacktab:
wtfApp.focusTracker.Prev()
return nil
case tcell.KeyEsc:
wtfApp.focusTracker.None()
return nil
}

// Checks to see if any widget has been assigned the pressed key as its focus key
Expand Down

0 comments on commit c55b542

Please sign in to comment.