MCPcopy Create free account
hub / github.com/Macmod/godap / explorerPageKeyHandler

Function explorerPageKeyHandler

tui/explorer.go:616–659  ·  view source on GitHub ↗
(event *tcell.EventKey)

Source from the content-addressed store, hash-verified

614}
615
616func explorerPageKeyHandler(event *tcell.EventKey) *tcell.EventKey {
617 if event.Key() == tcell.KeyTab || event.Key() == tcell.KeyBacktab {
618 explorerRotateFocus()
619 return nil
620 }
621
622 // Handle keys that don't require a selected node first.
623 switch event.Key() {
624 case tcell.KeyCtrlF:
625 openFinder(&explorerCache, "LDAP Explorer")
626 return event
627 case tcell.KeyCtrlB:
628 openExplorerSettingsForm()
629 return event
630 }
631
632 currentNode := treePanel.GetCurrentNode()
633 if currentNode == nil {
634 return event
635 }
636
637 switch event.Key() {
638 case tcell.KeyCtrlP:
639 openPasswordChangeForm(currentNode)
640 case tcell.KeyCtrlL:
641 openMoveObjectForm(currentNode, func(newObjectDN string) {
642 newParentNode := reloadParentNode(currentNode)
643
644 idx := findEntryInChildren(newObjectDN, newParentNode)
645
646 otherNodeToSelect := newParentNode
647
648 if idx > 0 {
649 siblings := newParentNode.GetChildren()
650 otherNodeToSelect = siblings[idx]
651 }
652
653 treePanel.SetCurrentNode(otherNodeToSelect)
654 reloadExplorerAttrsPanel(otherNodeToSelect, CacheEntries)
655 })
656 }
657
658 return event
659}

Callers

nothing calls this directly

Calls 8

explorerRotateFocusFunction · 0.85
openFinderFunction · 0.85
openExplorerSettingsFormFunction · 0.85
openPasswordChangeFormFunction · 0.85
openMoveObjectFormFunction · 0.85
reloadParentNodeFunction · 0.85
findEntryInChildrenFunction · 0.85
reloadExplorerAttrsPanelFunction · 0.85

Tested by

no test coverage detected