interception

package
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MouseStateLeftDown   = 0x001
	MouseStateLeftUp     = 0x002
	MouseStateRightDown  = 0x004
	MouseStateRightUp    = 0x008
	MouseStateMiddleDown = 0x010
	MouseStateMiddleUp   = 0x020
	MouseStateWheel      = 0x400

	MouseFlagMoveRelative = 0x000
	MouseFlagMoveAbsolute = 0x001
)

Constants for Mouse

View Source
const (
	KeyStateDown = 0x00
	KeyStateUp   = 0x01
	KeyStateE0   = 0x02
	KeyStateE1   = 0x04
)

Constants for Keyboard

Variables

View Source
var (
	ErrLibraryNotFound = fmt.Errorf("interception library not found")
	ErrSendFailed      = fmt.Errorf("interception_send failed")
)

Functions

func DestroyContext

func DestroyContext(ctx Context)

func IsKeyboard

func IsKeyboard(dev Device) bool

func IsMouse

func IsMouse(dev Device) bool

func Load

func Load() error

Load loads the interception.dll and resolves function addresses.

func SendKey

func SendKey(ctx Context, dev Device, s *KeyStroke) error

func SendMouse

func SendMouse(ctx Context, dev Device, s *MouseStroke) error

func SetLibraryPath

func SetLibraryPath(path string)

SetLibraryPath sets the path for LoadLibrary.

func Unload

func Unload()

Unload frees the loaded DLL.

Types

type Context

type Context uintptr

func CreateContext

func CreateContext() Context

type Device

type Device int

type KeyStroke

type KeyStroke struct {
	Code        uint16
	State       uint16
	Information uint32
}

type MouseStroke

type MouseStroke struct {
	State       uint16
	Flags       uint16
	Rolling     int16
	X           int32
	Y           int32
	Information uint32
}

Go-friendly structs

Jump to

Keyboard shortcuts

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