Documentation ¶
Index ¶
- type Config
- type Control
- func (c *Control) Apply() error
- func (c *Control) BrightnessDown() error
- func (c *Control) BrightnessUp() error
- func (c *Control) Close() error
- func (c *Control) CurrentBrightness() Level
- func (c *Control) EmulateKeyPress(keyCode uint16) error
- func (c *Control) GetWSInfo() gin.H
- func (c *Control) HandleWSMessage(ws *websocket.Conn, action int, value string)
- func (c *Control) Initialize() error
- func (c *Control) Load(v []byte) error
- func (c *Control) Name() string
- func (c *Control) Notify(t plugin.Notification)
- func (c *Control) Run(haltCtx context.Context, cb chan<- plugin.Callback) <-chan error
- func (c *Control) SetBrightness(v Level) error
- func (c *Control) ToggleTouchPad() error
- func (c *Control) Value() []byte
- type Level
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { DryRun bool Remap map[uint32]uint16 RogKey []string `json:"rogKey"` BrightnessLevel byte `json:"brightnessLevel"` }
Config defines the behavior of Keyboard Control. If DryRun is set to true, no actual IOs will be performed. Remap defines the key remapping behavior or Fn+ArrowLeft/ArrowRight (see system/keyboard) to standard key scancode.
type Control ¶
type Control struct { Config // contains filtered or unexported fields }
Control allows you to set the hid related functionalities directly. The controller is safe for multiple goroutines.
func NewControl ¶
NewControl checks if the computer has the hid control interface, and returns a control interface if it does
func (*Control) BrightnessDown ¶
BrightnessDown decreases the keyboard backlight by one level
func (*Control) BrightnessUp ¶
BrightnessUp increases the keyboard backlight by one level
func (*Control) CurrentBrightness ¶
CurrentBrightness returns current brightness Level
func (*Control) EmulateKeyPress ¶
EmulateKeyPress will emulate a keypress via SendInput() scancode. Note: some applications using DirectInput may not register this.
func (*Control) HandleWSMessage ¶
func (*Control) Initialize ¶
Initialize will send initialization buffer to the keyboard control device. Note: This should be called prior to calling any control methods, and after ACPI resume.
func (*Control) Notify ¶
func (c *Control) Notify(t plugin.Notification)
Notify satifies system/plugin.Plugin
func (*Control) SetBrightness ¶
SetBrightness change the keyboard backlight directly
func (*Control) ToggleTouchPad ¶
ToggleTouchPad will toggle enabling/disabling the touchpad