Documentation
¶
Index ¶
- Constants
- func MagicSerialNumber(sn string) string
- type Device
- type DeviceDefinition
- type DeviceDriver
- type DeviceMatrix
- type EncoderMapper
- type EncoderSetter
- type Handler
- type HandlerFunc
- type KeyOverrideEntry
- type LightingMode
- type LzmaDefPageWriter
- type LzmaDefPageWriterFunc
- type MacroDriver
- type Pos
- type UnlockStatus
- type ViaChannelID
- type ViaCommand
- type ViaKeyboardValueID
- type ViaQmkLEDMatrixValue
- type ViaQmkRGBLightValue
- type ViaQmkRGBMatrixValue
- type VialCommand
- type VialRGBGetCommand
- type VialRGBSetCommand
- type VialRGBer
Constants ¶
const ( // MagicSerialPrefix is a value in the serial number of HID devices // that the Vial desktop app uses to identify compatible devices. MagicSerialPrefix = "vial:f64c2b3c" ViaProtocolVersion = 0x09 VialProtocolVersion = 0x00000006 VialUnlockCounterMax = 50 VialUnlockHoldDuration = 2 * time.Second )
const ( ViaChannelCustom ViaChannelID = 0x00 ViaChannelBacklight = 0x01 ViaChannelRGBLight = 0x02 ViaChannelRGBMatrix = 0x03 ViaChannelQMKAudio = 0x04 ViaChannelQMKLEDMatrix = 0x05 )
const (
VialRGBProtocolVersion = 1
)
Variables ¶
This section is empty.
Functions ¶
func MagicSerialNumber ¶
MagicSerialNumber returns a string value that the Vial desktop app can recognize as a Vial-compatible device based on a "magic" value (see MagicSerialPrefix constant in this package). If the provided string `sn` is not the zero value, it is appended with a separator to the prefix and returned; otherwise just the prefix is returned.
Types ¶
type Device ¶
type Device struct {
// contains filtered or unexported fields
}
func NewDevice ¶
func NewDevice(def DeviceDefinition, driver DeviceDriver) *Device
func (*Device) UnlockStatus ¶
func (dev *Device) UnlockStatus() UnlockStatus
func (*Device) UseVialRGB ¶
type DeviceDefinition ¶
type DeviceDefinition struct { Name string `json:"name"` VendorID string `json:"vendorId"` ProductID string `json:"productId"` Matrix DeviceMatrix `json:"matrix"` Lighting string `json:"lighting"` UnlockKeys []Pos `json:"-"` LzmaDefLength uint16 `json:"-"` LzmaDefWriter LzmaDefPageWriter // contains filtered or unexported fields }
func (*DeviceDefinition) UseVialRGB ¶
func (def *DeviceDefinition) UseVialRGB(drv VialRGBer)
type DeviceDriver ¶
type DeviceMatrix ¶
type EncoderMapper ¶
type EncoderSetter ¶
type HandlerFunc ¶
type KeyOverrideEntry ¶
type KeyOverrideEntry struct { Trigger uint16 Replacement uint16 Layers uint16 TriggerMods uint8 NegativeModMask uint8 SupressedMods uint8 Options uint8 }
the key override structure as it is stored in eeprom and transferred to vial-gui; it is deserialized into key_override_t by vial_get_key_override
type LightingMode ¶
type LightingMode string
const ( LightingModeVialRGB LightingMode = "vialrgb" LightingModeQMKRGBLight LightingMode = "qmk_rgblight" LightingModeQMKBacklight LightingMode = "qmk_backlight" )
type LzmaDefPageWriter ¶
type LzmaDefPageWriterFunc ¶
func (LzmaDefPageWriterFunc) WriteLzmaDefPage ¶
func (fn LzmaDefPageWriterFunc) WriteLzmaDefPage(buf []byte, page uint16) bool
type MacroDriver ¶
type UnlockStatus ¶
type UnlockStatus uint8
const ( Locked UnlockStatus = iota Unlocked UnlockInProgress )
func (UnlockStatus) String ¶
func (i UnlockStatus) String() string
type ViaChannelID ¶
type ViaChannelID uint8
type ViaCommand ¶
type ViaCommand uint8
ViaCommand represents a command from the VIA command set. VIA is a graphical configurator for QMK firmware. Vial is an open source alternative to VIA, and shares some of the same command set as its predecessor. Not all VIA commands are supported by this package, only the ones that are necessary for Vial.
const ( ViaCmdGetProtocolVersion ViaCommand = 0x01 ViaCmdGetKeyboardValue ViaCommand = 0x02 ViaCmdSetKeyboardValue ViaCommand = 0x03 ViaCmdDynamicKeymapGetKeycode ViaCommand = 0x04 ViaCmdDynamicKeymapSetKeycode ViaCommand = 0x05 ViaCmdDynamicKeymapReset ViaCommand = 0x06 ViaCmdLightingSetValue ViaCommand = 0x07 ViaCmdLightingGetValue ViaCommand = 0x08 ViaCmdLightingSave ViaCommand = 0x09 ViaCmdEepromReset ViaCommand = 0x0A ViaCmdBootloaderJump ViaCommand = 0x0B ViaCmdKeymapMacroGetCount ViaCommand = 0x0C ViaCmdKeymapMacroGetBufferSize ViaCommand = 0x0D ViaCmdKeymapMacroGetBuffer ViaCommand = 0x0E ViaCmdKeymapMacroSetBuffer ViaCommand = 0x0F ViaCmdKeymapMacroReset ViaCommand = 0x10 ViaCmdKeymapGetLayerCount ViaCommand = 0x11 ViaCmdKeymapGetBuffer ViaCommand = 0x12 ViaCmdKeymapSetBuffer ViaCommand = 0x13 ViaCmdVialPrefix ViaCommand = 0xFE ViaCmdUnhandled ViaCommand = 0xFF )
func (ViaCommand) String ¶
func (i ViaCommand) String() string
type ViaKeyboardValueID ¶
type ViaKeyboardValueID uint8
const ( ViaKbdUptime ViaKeyboardValueID = 0x01 ViaKbdLayoutOptions ViaKeyboardValueID = 0x02 ViaKbdSwitchMatrixState ViaKeyboardValueID = 0x03 ViaKbdFirmwareVersion ViaKeyboardValueID = 0x04 ViaKbdDeviceIndication ViaKeyboardValueID = 0x05 )
func (ViaKeyboardValueID) String ¶
func (i ViaKeyboardValueID) String() string
type ViaQmkLEDMatrixValue ¶
type ViaQmkLEDMatrixValue uint8
const ( ViaQmkLEDMatrixBrightness ViaQmkLEDMatrixValue = iota + 1 ViaQmkLEDMatrixEffect ViaQmkLEDMatrixEffectSpeed )
func (ViaQmkLEDMatrixValue) String ¶
func (i ViaQmkLEDMatrixValue) String() string
type ViaQmkRGBLightValue ¶
type ViaQmkRGBLightValue uint8
const ( ViaQmkRGBLightBrightness ViaQmkRGBLightValue = iota + 0x80 ViaQmkRGBLightEffect ViaQmkRGBLightEffectSpeed ViaQmkRGBLightColor )
func (ViaQmkRGBLightValue) String ¶
func (i ViaQmkRGBLightValue) String() string
type ViaQmkRGBMatrixValue ¶
type ViaQmkRGBMatrixValue uint8
const ( ViaQmkRGBMatrixBrightness ViaQmkRGBMatrixValue = iota + 1 ViaQmkRGBMatrixEffect ViaQmkRGBMatrixEffectSpeed ViaQmkRGBMatrixColor )
func (ViaQmkRGBMatrixValue) String ¶
func (i ViaQmkRGBMatrixValue) String() string
type VialCommand ¶
type VialCommand uint8
const ( VialCmdGetKeyboardID VialCommand = 0x00 VialCmdGetSize VialCommand = 0x01 VialCmdGetDef VialCommand = 0x02 VialCmdGetEncoder VialCommand = 0x03 VialCmdSetEncoder VialCommand = 0x04 VialCmdGetUnlockStatus VialCommand = 0x05 VialCmdUnlockStart VialCommand = 0x06 VialCmdUnlockPoll VialCommand = 0x07 VialCmdLock VialCommand = 0x08 VialCmdQmkSettingsQuery VialCommand = 0x09 VialCmdQmkSettingsGet VialCommand = 0x0A VialCmdQmkSettingsSet VialCommand = 0x0B VialCmdQmkSettingsReset VialCommand = 0x0C VialCmdDynamicEntryOp VialCommand = 0x0D )
func (VialCommand) String ¶
func (i VialCommand) String() string
type VialRGBGetCommand ¶
type VialRGBGetCommand uint8
const ( VialRGBCommandGetInfo VialRGBGetCommand = iota + 0x40 VialRGBCommandGetMode VialRGBCommandGetSupported VialRGBCommandGetNumberLEDs VialRGBCommandGetLEDInfo )
func (VialRGBGetCommand) String ¶
func (i VialRGBGetCommand) String() string
type VialRGBSetCommand ¶
type VialRGBSetCommand uint8
const ( VialRGBCommandSetMode VialRGBSetCommand = iota + 0x41 VialRGBCommandDirectFastset )
func (VialRGBSetCommand) String ¶
func (i VialRGBSetCommand) String() string
Source Files
¶
- debug_false.go
- lighting.go
- lighting_qmk_backlight.go
- lighting_qmk_rgblight.go
- lighting_vialrgb.go
- macros.go
- mapper.go
- unlockstatus_string.go
- viacommand_string.go
- viakeyboardvalueid_string.go
- vial.go
- vialcommand_string.go
- vialrgbgetcommand_string.go
- vialrgbsetcommand_string.go
- viaqmkledmatrixvalue_string.go
- viaqmkrgblightvalue_string.go
- viaqmkrgbmatrixvalue_string.go