MCPcopy
hub / github.com/gdamore/tcell / TestKeyRepeatNoAlt

Function TestKeyRepeatNoAlt

vt/tests/key_test.go:302–320  ·  view source on GitHub ↗

TestKeyRepeatNoAlt ensures that alt keys do not repeat

(t *testing.T)

Source from the content-addressed store, hash-verified

300
301// TestKeyRepeatNoAlt ensures that alt keys do not repeat
302func TestKeyRepeatNoAlt(t *testing.T) {
303 term := vt.NewMockTerm()
304 defer MustClose(t, term)
305
306 MustStart(t, term)
307
308 // Keep the initial repeat quick, but make later repeats very slow so the test
309 // does not sit on a timer boundary.
310 term.SetRepeat(time.Millisecond*50, time.Second)
311
312 term.KeyPress(vt.KeyLAlt)
313 term.KeyPress(vt.KeyZ)
314 time.Sleep(100 * time.Millisecond)
315 term.KeyPress(vt.KeyZ)
316 term.KeyRelease(vt.KeyZ)
317 term.KeyRelease(vt.KeyLAlt)
318
319 CheckRead(t, term, "\x1bz")
320}
321
322// TestKeyRepeatShift ensures that shifted keys still work as long as repeat is held down.
323func TestKeyRepeatShift(t *testing.T) {

Callers

nothing calls this directly

Calls 7

SetRepeatMethod · 0.95
KeyPressMethod · 0.95
KeyReleaseMethod · 0.95
NewMockTermFunction · 0.92
MustCloseFunction · 0.85
MustStartFunction · 0.85
CheckReadFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…