input

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StringKeyMap = map[string]Key{}/* 122 elements not displayed */

StringKeyMap maps string key names to ebiten.Key values.

View Source
var StringMouseButtonMap = map[string]MouseButton{
	"MouseButtonLeft":   MouseButtonLeft,
	"MouseButtonMiddle": MouseButtonMiddle,
	"MouseButtonRight":  MouseButtonRight,
	"MouseButton0":      MouseButton0,
	"MouseButton1":      MouseButton1,
	"MouseButton2":      MouseButton2,
	"MouseButton3":      MouseButton3,
	"MouseButton4":      MouseButton4,
}

Functions

This section is empty.

Types

type InputTime

type InputTime int64

func NewInputTimeFromTick

func NewInputTimeFromTick(tick int64, subtick int64) InputTime

func (InputTime) Subtick

func (i InputTime) Subtick() int64

func (InputTime) Tick

func (i InputTime) Tick() int64

type Key

type Key int

Key represents a keyboard key.

const (
	KeyA Key = iota
	KeyB
	KeyC
	KeyD
	KeyE
	KeyF
	KeyG
	KeyH
	KeyI
	KeyJ
	KeyK
	KeyL
	KeyM
	KeyN
	KeyO
	KeyP
	KeyQ
	KeyR
	KeyS
	KeyT
	KeyU
	KeyV
	KeyW
	KeyX
	KeyY
	KeyZ
	KeyAltLeft
	KeyAltRight
	KeyArrowDown
	KeyArrowLeft
	KeyArrowRight
	KeyArrowUp
	KeyBackquote
	KeyBackslash
	KeyBackspace
	KeyBracketLeft
	KeyBracketRight
	KeyCapsLock
	KeyComma
	KeyContextMenu
	KeyControlLeft
	KeyControlRight
	KeyDelete
	KeyDigit0
	KeyDigit1
	KeyDigit2
	KeyDigit3
	KeyDigit4
	KeyDigit5
	KeyDigit6
	KeyDigit7
	KeyDigit8
	KeyDigit9
	KeyEnd
	KeyEnter
	KeyEqual
	KeyEscape
	KeyF1
	KeyF2
	KeyF3
	KeyF4
	KeyF5
	KeyF6
	KeyF7
	KeyF8
	KeyF9
	KeyF10
	KeyF11
	KeyF12
	KeyF13
	KeyF14
	KeyF15
	KeyF16
	KeyF17
	KeyF18
	KeyF19
	KeyF20
	KeyF21
	KeyF22
	KeyF23
	KeyF24
	KeyHome
	KeyInsert
	KeyIntlBackslash
	KeyMetaLeft
	KeyMetaRight
	KeyMinus
	KeyNumLock
	KeyNumpad0
	KeyNumpad1
	KeyNumpad2
	KeyNumpad3
	KeyNumpad4
	KeyNumpad5
	KeyNumpad6
	KeyNumpad7
	KeyNumpad8
	KeyNumpad9
	KeyNumpadAdd
	KeyNumpadDecimal
	KeyNumpadDivide
	KeyNumpadEnter
	KeyNumpadEqual
	KeyNumpadMultiply
	KeyNumpadSubtract
	KeyPageDown
	KeyPageUp
	KeyPause
	KeyPeriod
	KeyPrintScreen
	KeyQuote
	KeyScrollLock
	KeySemicolon
	KeyShiftLeft
	KeyShiftRight
	KeySlash
	KeySpace
	KeyTab
	KeyAlt
	KeyControl
	KeyShift
	KeyMeta
	KeyMax = KeyMeta
)

Key constants matching ebiten.Key.

func LookupKey

func LookupKey(name string) (Key, bool)

LookupKey looks up a key by its string name.

type MouseButton

type MouseButton int
const (
	MouseButtonLeft   MouseButton = MouseButton0
	MouseButtonMiddle MouseButton = MouseButton1
	MouseButtonRight  MouseButton = MouseButton2
)

MouseButton constants matching ebiten.MouseButton.

const (
	MouseButton0   MouseButton = iota // The 'left' button
	MouseButton1                      // The 'right' button
	MouseButton2                      // The 'middle' button
	MouseButton3                      // The additional button (usually browser-back)
	MouseButton4                      // The additional button (usually browser-forward)
	MouseButtonMax = MouseButton4
)

func LookupMouseButton

func LookupMouseButton(name string) (MouseButton, bool)

type VirtualInput

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

VirtualInput manages virtual keyboard input state.

func Get

func Get() *VirtualInput

Get returns the global VirtualInput instance.

func NewVirtualInput

func NewVirtualInput() *VirtualInput

func (*VirtualInput) CursorPosition

func (v *VirtualInput) CursorPosition() (x, y int)

func (*VirtualInput) InjectCursorMove

func (v *VirtualInput) InjectCursorMove(x, y int)

func (*VirtualInput) InjectKeyHold

func (v *VirtualInput) InjectKeyHold(key Key, inputTime InputTime, durationTicks int64)

func (*VirtualInput) InjectKeyPress

func (v *VirtualInput) InjectKeyPress(key Key, inputTime InputTime)

func (*VirtualInput) InjectKeyRelease

func (v *VirtualInput) InjectKeyRelease(key Key, inputTime InputTime)

func (*VirtualInput) InjectMouseButtonHold

func (v *VirtualInput) InjectMouseButtonHold(button MouseButton, inputTime InputTime, durationTicks int64)

func (*VirtualInput) InjectMouseButtonPress

func (v *VirtualInput) InjectMouseButtonPress(button MouseButton, inputTime InputTime)

func (*VirtualInput) InjectMouseButtonRelease

func (v *VirtualInput) InjectMouseButtonRelease(button MouseButton, inputTime InputTime)

func (*VirtualInput) InjectWheelMove

func (v *VirtualInput) InjectWheelMove(x, y float64)

func (*VirtualInput) IsKeyJustPressed

func (v *VirtualInput) IsKeyJustPressed(key Key, tick int64) bool

func (*VirtualInput) IsKeyJustReleased

func (v *VirtualInput) IsKeyJustReleased(key Key, tick int64) bool

func (*VirtualInput) IsKeyPressed

func (v *VirtualInput) IsKeyPressed(key Key, tick int64) bool

func (*VirtualInput) IsMouseButtonJustPressed

func (v *VirtualInput) IsMouseButtonJustPressed(button MouseButton, tick int64) bool

func (*VirtualInput) IsMouseButtonJustReleased

func (v *VirtualInput) IsMouseButtonJustReleased(button MouseButton, tick int64) bool

func (*VirtualInput) IsMouseButtonPressed

func (v *VirtualInput) IsMouseButtonPressed(button MouseButton, tick int64) bool

func (*VirtualInput) KeyPressDuration

func (v *VirtualInput) KeyPressDuration(key Key, tick int64) int64

func (*VirtualInput) MouseButtonPressDuration

func (v *VirtualInput) MouseButtonPressDuration(button MouseButton, tick int64) int64

func (*VirtualInput) Wheel

func (v *VirtualInput) Wheel() (x, y float64)

Jump to

Keyboard shortcuts

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