MCPcopy Create free account
hub / github.com/basecamp/hey-cli / keyPress

Function keyPress

internal/tui/tui_test.go:61–84  ·  view source on GitHub ↗
(key string)

Source from the content-addressed store, hash-verified

59 ID: 101,
60 Summary: "Meeting notes",
61 CreatedAt: time.Date(2025, 3, 1, 9, 0, 0, 0, time.UTC),
62 Seen: true,
63 Creator: mail.Contact{Name: "Bob"},
64 },
65 }
66}
67
68func keyPress(key string) tea.KeyPressMsg {
69 k := tea.Key{Text: key}
70 switch key {
71 case "ctrl+c":
72 k = tea.Key{Code: 'c', Mod: tea.ModCtrl}
73 case "esc":
74 k = tea.Key{Code: tea.KeyEscape}
75 case "enter":
76 k = tea.Key{Code: tea.KeyEnter}
77 case "tab":
78 k = tea.Key{Code: tea.KeyTab}
79 case "shift+tab":
80 k = tea.Key{Code: tea.KeyTab, Mod: tea.ModShift}
81 case "left":
82 k = tea.Key{Code: tea.KeyLeft}
83 case "right":
84 k = tea.Key{Code: tea.KeyRight}
85 case "up":
86 k = tea.Key{Code: tea.KeyUp}
87 case "down":

Callers 10

TestTabCyclesFocusFunction · 0.85
TestDoubleCtrlCQuitsFunction · 0.85
TestEscExitsThreadFunction · 0.85
TestQExitsThreadFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected