keyboard

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: May 20, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

README

keyboard

cross-platform keypress simulation module for golang

https://github.com/micmonay/keybd_event

Documentation

Overview

Package keyboard is used for a key press simulated in Windows, Linux and Mac https://github.com/micmonay/keybd_event

Index

Constants

This section is empty.

Variables

View Source
var VirtualKey = map[string]int{}/* 254 elements not displayed */

VirtualKey - Used to pass integer value of key keyboard.VirtualKey["VK_P"]

View Source
var X11 = true

Functions

func ExampleNewKeyBonding

func ExampleNewKeyBonding()

Types

type KeyBonding

type KeyBonding struct {
	// contains filtered or unexported fields
}

KeyBonding type for keyboard

func NewKeyBonding

func NewKeyBonding() (KeyBonding, error)

NewKeyBonding Use for create struct KeyBounding

func (*KeyBonding) AddKey

func (k *KeyBonding) AddKey(key int)

AddKey add one key pressed

func (*KeyBonding) Clear

func (k *KeyBonding) Clear()

Clear clean instance

func (*KeyBonding) HasALT

func (k *KeyBonding) HasALT(b bool)

HasALT If key ALT pressed

func (*KeyBonding) HasALTGR

func (k *KeyBonding) HasALTGR(b bool)

HasALTGR If key ALTGR pressed

func (*KeyBonding) HasCTRL

func (k *KeyBonding) HasCTRL(b bool)

HasCTRL If key CTRL pressed

func (*KeyBonding) HasCTRLR

func (k *KeyBonding) HasCTRLR(b bool)

HasCTRLR If key CTRLR pressed

This is currently not supported on macOS

func (*KeyBonding) HasSHIFT

func (k *KeyBonding) HasSHIFT(b bool)

HasSHIFT If key SHIFT pressed

func (*KeyBonding) HasSHIFTR

func (k *KeyBonding) HasSHIFTR(b bool)

HasSHIFTR If key SHIFTR pressed

This is currently not supported on macOS

func (*KeyBonding) HasSuper

func (k *KeyBonding) HasSuper(b bool)

HasSuper If key Super pressed

func (*KeyBonding) Launching

func (k *KeyBonding) Launching() error

Launching will Press() the keys and then Release() it automatically

func (*KeyBonding) Press

func (k *KeyBonding) Press() error

Press with press the keys, Release() should be used after it.

func (*KeyBonding) Release

func (k *KeyBonding) Release() error

Release will release the keys, This should be used after Press()

func (*KeyBonding) SetKeys

func (k *KeyBonding) SetKeys(keys ...int)

SetKeys set keys

Jump to

Keyboard shortcuts

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