input

package
v0.0.0-...-a54a77b Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2014 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeyUnknown = -1
	KeySpace   = 32
	KeySpecial = 256
)

Keyboard key definitions: 8-bit ISO-8859-1 (Latin 1) encoding is used for printable keys (such as A-Z, 0-9 etc), and values above 256 represent Special (non-printable) keys (e.g. F1, Page Up etc).

View Source
const (
	KeyEsc
	KeyF1
	KeyF2
	KeyF3
	KeyF4
	KeyF5
	KeyF6
	KeyF7
	KeyF8
	KeyF9
	KeyF10
	KeyF11
	KeyF12
	KeyF13
	KeyF14
	KeyF15
	KeyF16
	KeyF17
	KeyF18
	KeyF19
	KeyF20
	KeyF21
	KeyF22
	KeyF23
	KeyF24
	KeyF25
	Key_Up
	Key_Down
	Key_Left
	Key_Right
	KeyLshift
	KeyRshift
	KeyLctrl
	KeyRctrl
	KeyLalt
	KeyRalt
	KeyTab
	KeyEnter
	KeyBackspace
	KeyInsert
	KeyDel
	KeyPageup
	KeyPagedown
	KeyHome
	KeyEnd
	KeyKP0
	KeyKP1
	KeyKP2
	KeyKP3
	KeyKP4
	KeyKP5
	KeyKP6
	KeyKP7
	KeyKP8
	KeyKP9
	KeyKPDidivde
	KeyKPMultiply
	KeyKPSubtract
	KeyKPAdd
	KeyKPDecimal
	KeyKPEqual
	KeyKPEnter
	KeyKPNumlock
	KeyCapslock
	KeyScrolllock
	KeyPause
	KeyLsuper
	KeyRsuper
	KeyMenu
	KeyLast = KeyMenu
)
View Source
const (
	Mouse1 = iota
	Mouse2
	Mouse3
	Mouse4
	Mouse5
	Mouse6
	Mouse7
	Mouse8
	MouseLast   = Mouse8
	MouseLeft   = Mouse1
	MouseRight  = Mouse2
	MouseMiddle = Mouse3
)

Mouse button definitions

View Source
const (
	Joy1 = iota
	Joy2
	Joy3
	Joy4
	Joy5
	Joy6
	Joy7
	Joy8
	Joy9
	Joy10
	Joy11
	Joy12
	Joy13
	Joy14
	Joy15
	Joy16
	JoyLast = Joy16
)

Joystick identifiers

Variables

View Source
var (
	MousePosition      func() (int, int) = nil
	MouseWheelPosition func() int        = nil
	MouseWheelDelta    int
)

Functions

func ButtonPress

func ButtonPress(btn, state int)

func ClearInput

func ClearInput()

func KeyDown

func KeyDown(key int) bool

func KeyPress

func KeyPress(key int) bool

func KeyUp

func KeyUp(key int) bool

func MouseDown

func MouseDown(key int) bool

func MousePress

func MousePress(key int) bool

func MouseUp

func MouseUp(key int) bool

func MouseWheelCallback

func MouseWheelCallback(position int)

func OnChar

func OnChar(key, state int)

func OnKey

func OnKey(key, state int)

func RemoveCharCallback

func RemoveCharCallback(key ChatCallbackKey) (deleted bool)

func UpdateInput

func UpdateInput()

Types

type CharCallback

type CharCallback func(char rune)

type ChatCallbackKey

type ChatCallbackKey *CharCallback

func AddCharCallback

func AddCharCallback(callback CharCallback) (key ChatCallbackKey)

Jump to

Keyboard shortcuts

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