Documentation
¶
Index ¶
Constants ¶
View Source
const ( VkBackspace = 0x08 VkTab = 0x09 VkReturn = 0x0D VkEscape = 0x1B VkSpace = 0x20 VkLShift = 0xA0 VkRShift = 0xA1 VkLControl = 0xA2 VkRControl = 0xA3 VkLMenu = 0xA4 // Left Alt VkRMenu = 0xA5 // Right Alt VkLWin = 0x5B VkRWin = 0x5C VkShift = 0x10 VkControl = 0x11 VkMenu = 0x12 // Alt )
Virtual key codes
Variables ¶
This section is empty.
Functions ¶
func ComboCtrlShift ¶
func ComboCtrlShift() []uint32
ComboCtrlShift returns VK codes for Ctrl+Shift.
func ParseCombo ¶
ParseCombo parses strings like "alt" or "ctrl+shift+d" into VK codes.
Types ¶
type Event ¶
type Event struct {
Type EventType
Binding string
// Source identifies the origin of this event. Native keyboard-hook
// events leave this zero (empty string) which callers must treat as
// equivalent to EventSourceHotkey. Synthesized events (wake-word,
// future programmatic triggers) set this explicitly.
Source EventSource
}
type EventSource ¶ added in v0.35.8
type EventSource string
EventSource identifies the origin of a hotkey event.
const ( // EventSourceHotkey is the default — the event came from a real // keyboard press picked up by the platform hotkey manager. EventSourceHotkey EventSource = "hotkey" // EventSourceWakeword indicates the event was synthesized by the // wake-word adapter to simulate a hotkey press. Consumers that need // different downstream behaviour for wake-word-triggered activations // (e.g. attach an AutoEndPolicy, ignore hold-to-talk semantics) // branch on this value. EventSourceWakeword EventSource = "wakeword" )
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager captures a push-to-talk key combination through a low-level keyboard hook.
func NewManager ¶
NewManager creates a PTT manager. combo is a list of VK codes that must ALL be pressed.
func (*Manager) Reconfigure ¶
Reconfigure swaps the key combination while the hook is running. The keyboard hook stays installed; only the combo tracker is replaced.
Click to show internal directories.
Click to hide internal directories.