-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Expand file tree
/
Copy pathinput.go
More file actions
54 lines (52 loc) · 1.32 KB
/
input.go
File metadata and controls
54 lines (52 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package tea
import (
uv "github.com/charmbracelet/ultraviolet"
)
// translateInputEvent translates an input event into a Bubble Tea Msg.
func (p *Program) translateInputEvent(e uv.Event) Msg {
switch e := e.(type) {
case uv.ClipboardEvent:
return ClipboardMsg(e)
case uv.ForegroundColorEvent:
return ForegroundColorMsg(e)
case uv.BackgroundColorEvent:
return BackgroundColorMsg(e)
case uv.CursorColorEvent:
return CursorColorMsg(e)
case uv.CursorPositionEvent:
return CursorPositionMsg(e)
case uv.FocusEvent:
return FocusMsg(e)
case uv.BlurEvent:
return BlurMsg(e)
case uv.KeyPressEvent:
return KeyPressMsg(e)
case uv.KeyReleaseEvent:
return KeyReleaseMsg(e)
case uv.MouseClickEvent:
return MouseClickMsg(e)
case uv.MouseMotionEvent:
return MouseMotionMsg(e)
case uv.MouseReleaseEvent:
return MouseReleaseMsg(e)
case uv.MouseWheelEvent:
return MouseWheelMsg(e)
case uv.PasteEvent:
return PasteMsg(e)
case uv.PasteStartEvent:
return PasteStartMsg(e)
case uv.PasteEndEvent:
return PasteEndMsg(e)
case uv.WindowSizeEvent:
return WindowSizeMsg(e)
case uv.CapabilityEvent:
return CapabilityMsg(e)
case uv.TerminalVersionEvent:
return TerminalVersionMsg(e)
case uv.KeyboardEnhancementsEvent:
return KeyboardEnhancementsMsg(e)
case uv.ModeReportEvent:
return ModeReportMsg(e)
}
return e
}