Aego Playground

aego/inputmodule

Axisfunction

func Axis(name string) float

Axis returns -1, 0 or 1 for a named axis. Axes are declared in project.aego → input → axes; horizontal and vertical exist by default.

Example

x := input.Axis("horizontal")

Downfunction

func Down(key enum:aego/input.Key) bool

Down reports whether the key is held this frame.

Example

if input.Down(input.KeyShift) {
	speed *= 2
}

MouseDownfunction

func MouseDown(button enum:aego/input.Button) bool

MouseDown reports whether the mouse button is held.

Example

if input.MouseDown(input.MouseLeft) {
	fire()
}

MousePosfunction

func MousePos() Vec2

MousePos returns the cursor position in window pixels, (0, 0) at the top-left corner.

Example

p := input.MousePos()

MousePressedfunction

func MousePressed(button enum:aego/input.Button) bool

MousePressed reports whether the mouse button went down this frame.

Example

if input.MousePressed(input.MouseRight) {
	aim()
}

Pressedfunction

func Pressed(key enum:aego/input.Key) bool

Pressed reports whether the key went down this frame. It is true for exactly one frame per press.

Example

if input.Pressed(input.KeySpace) {
	jump()
}

Releasedfunction

func Released(key enum:aego/input.Key) bool

Released reports whether the key went up this frame.

Example

if input.Released(input.KeySpace) {
	cutJump()
}

KeyAconst

const KeyA enum:aego/input.Key

The A key.

KeyBconst

const KeyB enum:aego/input.Key

The B key.

KeyBackspaceconst

const KeyBackspace enum:aego/input.Key

The Backspace key.

KeyCconst

const KeyC enum:aego/input.Key

The C key.

KeyCapsLockconst

const KeyCapsLock enum:aego/input.Key

The CapsLock key.

KeyDconst

const KeyD enum:aego/input.Key

The D key.

KeyDeleteconst

const KeyDelete enum:aego/input.Key

The Delete key.

KeyDigit0const

const KeyDigit0 enum:aego/input.Key

The Digit0 key.

KeyDigit1const

const KeyDigit1 enum:aego/input.Key

The Digit1 key.

KeyDigit2const

const KeyDigit2 enum:aego/input.Key

The Digit2 key.

KeyDigit3const

const KeyDigit3 enum:aego/input.Key

The Digit3 key.

KeyDigit4const

const KeyDigit4 enum:aego/input.Key

The Digit4 key.

KeyDigit5const

const KeyDigit5 enum:aego/input.Key

The Digit5 key.

KeyDigit6const

const KeyDigit6 enum:aego/input.Key

The Digit6 key.

KeyDigit7const

const KeyDigit7 enum:aego/input.Key

The Digit7 key.

KeyDigit8const

const KeyDigit8 enum:aego/input.Key

The Digit8 key.

KeyDigit9const

const KeyDigit9 enum:aego/input.Key

The Digit9 key.

KeyDownconst

const KeyDown enum:aego/input.Key

The Down key.

KeyEconst

const KeyE enum:aego/input.Key

The E key.

KeyEndconst

const KeyEnd enum:aego/input.Key

The End key.

KeyEnterconst

const KeyEnter enum:aego/input.Key

The Enter key.

KeyEscapeconst

const KeyEscape enum:aego/input.Key

The Escape key.

KeyFconst

const KeyF enum:aego/input.Key

The F key.

KeyF1const

const KeyF1 enum:aego/input.Key

The F1 key.

KeyF10const

const KeyF10 enum:aego/input.Key

The F10 key.

KeyF11const

const KeyF11 enum:aego/input.Key

The F11 key.

KeyF12const

const KeyF12 enum:aego/input.Key

The F12 key.

KeyF2const

const KeyF2 enum:aego/input.Key

The F2 key.

KeyF3const

const KeyF3 enum:aego/input.Key

The F3 key.

KeyF4const

const KeyF4 enum:aego/input.Key

The F4 key.

KeyF5const

const KeyF5 enum:aego/input.Key

The F5 key.

KeyF6const

const KeyF6 enum:aego/input.Key

The F6 key.

KeyF7const

const KeyF7 enum:aego/input.Key

The F7 key.

KeyF8const

const KeyF8 enum:aego/input.Key

The F8 key.

KeyF9const

const KeyF9 enum:aego/input.Key

The F9 key.

KeyGconst

const KeyG enum:aego/input.Key

The G key.

KeyHconst

const KeyH enum:aego/input.Key

The H key.

KeyHomeconst

const KeyHome enum:aego/input.Key

The Home key.

KeyIconst

const KeyI enum:aego/input.Key

The I key.

KeyInsertconst

const KeyInsert enum:aego/input.Key

The Insert key.

KeyJconst

const KeyJ enum:aego/input.Key

The J key.

KeyKconst

const KeyK enum:aego/input.Key

The K key.

KeyKP0const

const KeyKP0 enum:aego/input.Key

The KP0 key.

KeyKP1const

const KeyKP1 enum:aego/input.Key

The KP1 key.

KeyKP2const

const KeyKP2 enum:aego/input.Key

The KP2 key.

KeyKP3const

const KeyKP3 enum:aego/input.Key

The KP3 key.

KeyKP4const

const KeyKP4 enum:aego/input.Key

The KP4 key.

KeyKP5const

const KeyKP5 enum:aego/input.Key

The KP5 key.

KeyKP6const

const KeyKP6 enum:aego/input.Key

The KP6 key.

KeyKP7const

const KeyKP7 enum:aego/input.Key

The KP7 key.

KeyKP8const

const KeyKP8 enum:aego/input.Key

The KP8 key.

KeyKP9const

const KeyKP9 enum:aego/input.Key

The KP9 key.

KeyKPEnterconst

const KeyKPEnter enum:aego/input.Key

The KPEnter key.

KeyLconst

const KeyL enum:aego/input.Key

The L key.

KeyLAltconst

const KeyLAlt enum:aego/input.Key

The LAlt key.

KeyLCtrlconst

const KeyLCtrl enum:aego/input.Key

The LCtrl key.

KeyLGUIconst

const KeyLGUI enum:aego/input.Key

The LGUI key.

KeyLShiftconst

const KeyLShift enum:aego/input.Key

The LShift key.

KeyLeftconst

const KeyLeft enum:aego/input.Key

The Left key.

KeyMconst

const KeyM enum:aego/input.Key

The M key.

KeyNconst

const KeyN enum:aego/input.Key

The N key.

KeyNumLockconst

const KeyNumLock enum:aego/input.Key

The NumLock key.

KeyOconst

const KeyO enum:aego/input.Key

The O key.

KeyPconst

const KeyP enum:aego/input.Key

The P key.

KeyPageDownconst

const KeyPageDown enum:aego/input.Key

The PageDown key.

KeyPageUpconst

const KeyPageUp enum:aego/input.Key

The PageUp key.

KeyPauseconst

const KeyPause enum:aego/input.Key

The Pause key.

KeyPrintScreenconst

const KeyPrintScreen enum:aego/input.Key

The PrintScreen key.

KeyQconst

const KeyQ enum:aego/input.Key

The Q key.

KeyRconst

const KeyR enum:aego/input.Key

The R key.

KeyRAltconst

const KeyRAlt enum:aego/input.Key

The RAlt key.

KeyRCtrlconst

const KeyRCtrl enum:aego/input.Key

The RCtrl key.

KeyRGUIconst

const KeyRGUI enum:aego/input.Key

The RGUI key.

KeyRShiftconst

const KeyRShift enum:aego/input.Key

The RShift key.

KeyRightconst

const KeyRight enum:aego/input.Key

The Right key.

KeySconst

const KeyS enum:aego/input.Key

The S key.

KeyScrollLockconst

const KeyScrollLock enum:aego/input.Key

The ScrollLock key.

KeySpaceconst

const KeySpace enum:aego/input.Key

The Space key.

KeyTconst

const KeyT enum:aego/input.Key

The T key.

KeyTabconst

const KeyTab enum:aego/input.Key

The Tab key.

KeyUconst

const KeyU enum:aego/input.Key

The U key.

KeyUpconst

const KeyUp enum:aego/input.Key

The Up key.

KeyVconst

const KeyV enum:aego/input.Key

The V key.

KeyWconst

const KeyW enum:aego/input.Key

The W key.

KeyXconst

const KeyX enum:aego/input.Key

The X key.

KeyYconst

const KeyY enum:aego/input.Key

The Y key.

KeyZconst

const KeyZ enum:aego/input.Key

The Z key.

MouseLeftconst

const MouseLeft enum:aego/input.Button

The Left mouse button.

MouseMiddleconst

const MouseMiddle enum:aego/input.Button

The Middle mouse button.

MouseRightconst

const MouseRight enum:aego/input.Button

The Right mouse button.

MouseX1const

const MouseX1 enum:aego/input.Button

The X1 mouse button.

MouseX2const

const MouseX2 enum:aego/input.Button

The X2 mouse button.

Buttonenum

enum Button

Button is a mouse button. Use input.Button.Left or the constant input.MouseLeft.

Keyenum

enum Key

Key is a physical key, independent of the keyboard layout. Use input.Key.Space or the constant input.KeySpace.