MCPcopy Create free account
hub / github.com/coder/ghostty-web / createKeyEvent

Function createKeyEvent

lib/input-handler.test.ts:42–58  ·  view source on GitHub ↗
(
  code: string,
  key: string,
  modifiers: { ctrl?: boolean; alt?: boolean; shift?: boolean; meta?: boolean } = {}
)

Source from the content-addressed store, hash-verified

40
41// Helper to create mock keyboard event
42function createKeyEvent(
43 code: string,
44 key: string,
45 modifiers: { ctrl?: boolean; alt?: boolean; shift?: boolean; meta?: boolean } = {}
46): MockKeyboardEvent {
47 return {
48 code,
49 key,
50 ctrlKey: modifiers.ctrl ?? false,
51 altKey: modifiers.alt ?? false,
52 shiftKey: modifiers.shift ?? false,
53 metaKey: modifiers.meta ?? false,
54 repeat: false,
55 preventDefault: mock(() => {}),
56 stopPropagation: mock(() => {}),
57 };
58}
59
60// Helper to create mock clipboard event
61function createClipboardEvent(text: string | null): MockClipboardEvent {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…