sdlinput

package
v0.0.0-...-b91a18f Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddListener

func AddListener(eventType int, fn func(*sdl.Event))

Adds a listener to a specific sdl event type

input.AddListener(sdl.MOUSEBUTTONDOWN, func(arg *sdl.Event) {
	event := (*arg).(*sdl.MouseButtonEvent)
	fmt.Println(event.Button)
})

func DeltaTime

func DeltaTime() time.Duration

Returns deltatime

func GetMousePosition

func GetMousePosition() (int32, int32)

Returns the current mouse position

func GetMouseState

func GetMouseState() uint32

Returns the current state of the mouse (which buttons are pressed)

func Init

func Init()

func IsKeyHeld

func IsKeyHeld(scancode sdl.Scancode) bool

func LockCursor

func LockCursor()

func UnlockCursor

func UnlockCursor()

func Update

func Update() bool

Returns false if the application should end

Types

This section is empty.

Jump to

Keyboard shortcuts

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