common

package
v0.0.0-...-59404b9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 14, 2022 License: BSD-3-Clause Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BACKSPACE    = 0x8
	ENTER        = 0xd
	SPACE        = 0x20
	TAB          = 0x9
	DELETE       = 0x2e
	END          = 0x23
	HOME         = 0x24
	INSERT       = 0x2d
	PAGEDOWN     = 0x22
	PAGEUP       = 0x21
	DOWN         = 0x28
	LEFT         = 0x25
	RIGHT        = 0x27
	UP           = 0x26
	ESC          = 0x1b
	PRINTSCREEN  = 0x2A
	ALT          = 0x12
	SHIFT        = 0x10
	CAPSLOCK     = 0x14
	CTRL         = 0x11
	OS           = 0x5b
	PAUSEBRAKE   = 0x13
	MINUS        = 0xAD
	PERIOD       = 0xbe
	SLASH        = 0xbf
	EQUAL        = 0x3D
	BACKSLASH    = 0xDC
	SEMICOLON    = 0x3B
	SINGLEQUOTE  = 0xDE
	BACKQUOTE    = 0xc0
	COMMA        = 0xbc
	BRACKETLEFT  = 0xdb
	BRACKETRIGHT = 0xdd
	SCROLLLOCK   = 0x91
)

js keyboard event key code definition

View Source
const (
	// alphabet key code base
	ALPHABETBASE = 0x41

	ALPHABETLENGTH = 26

	// number key code base
	NUMBERBASE = 0x30

	NUMBERBASELENGHT = 10

	// function key code base
	FUNCTIONBASE = 0x70

	FUNCTIONBASELENGTH = 12
)

js keyboard event key code definition - key code base of alphabet, number, function key

View Source
const (
	MouseLeftButton = iota
	MouseMiddleButton
	MouseRightButton
)

js mouse event key code

Variables

This section is empty.

Functions

func IsAltCtrlShiftOsKey

func IsAltCtrlShiftOsKey(keyCode byte) bool

Types

type BaseHid

type BaseHid struct{}

func (*BaseHid) CloseDevice

func (c *BaseHid) CloseDevice() error

func (*BaseHid) GetModelName

func (c *BaseHid) GetModelName() string

func (*BaseHid) KeyDown

func (c *BaseHid) KeyDown(eventKeyCode byte) error

func (*BaseHid) KeyUp

func (c *BaseHid) KeyUp(eventKeyCode byte) error

func (*BaseHid) MouseDown

func (c *BaseHid) MouseDown(button int) error

func (*BaseHid) MouseScroll

func (c *BaseHid) MouseScroll(scroll int) error

func (*BaseHid) MouseUp

func (c *BaseHid) MouseUp(button int) error

func (*BaseHid) MoveTo

func (c *BaseHid) MoveTo(Xpoint uint16, Ypoint uint16) error

func (*BaseHid) OpenDevice

func (c *BaseHid) OpenDevice(...string) error

type Hid

type Hid interface {
	OpenDevice(args ...string) error
	CloseDevice() error
	GetModelName() string
	Mouse
	KeyBoard
}

type KeyBoard

type KeyBoard interface {
	KeyDown(keyCode byte) error
	KeyUp(keyCode byte) error
}

type Mouse

type Mouse interface {
	MoveTo(Xpoint uint16, Ypoint uint16) error
	MouseDown(button int) error
	MouseUp(button int) error
	MouseScroll(scroll int) error
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL