Added shortcut keys possibility to Menus
This commit is contained in:
9
main.go
9
main.go
@@ -128,7 +128,7 @@ func main() {
|
||||
},
|
||||
)
|
||||
changeFocus(fileSelector)
|
||||
}}, &ui.ItemEntry{Name: "_Save", Callback: func() {
|
||||
}}, &ui.ItemEntry{Name: "_Save", Shortcut: 's', Callback: func() {
|
||||
if tabContainer.GetTabCount() > 0 {
|
||||
tab := tabContainer.GetTab(tabContainer.GetSelectedTabIdx())
|
||||
te := tab.Child.(*ui.TextEdit)
|
||||
@@ -287,6 +287,13 @@ main_loop:
|
||||
if ev.Key() == tcell.KeyCtrlQ { // TODO: replace with shortcut keys in menus
|
||||
break main_loop
|
||||
}
|
||||
|
||||
if ev.Modifiers() & tcell.ModCtrl != 0 {
|
||||
handled := bar.HandleEvent(ev)
|
||||
if handled {
|
||||
continue // Avoid passing the event to the focusedComponent
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
focusedComponent.HandleEvent(ev)
|
||||
|
Reference in New Issue
Block a user