MCPcopy Index your code
hub / github.com/EngoEngine/engo / State

Method State

keys.go:81–92  ·  view source on GitHub ↗

State returns the raw state of a key.

()

Source from the content-addressed store, hash-verified

79
80// State returns the raw state of a key.
81func (key *KeyState) State() int {
82 if key.lastState {
83 if key.currentState {
84 return KeyStateDown
85 }
86 return KeyStateJustUp
87 }
88 if key.currentState {
89 return KeyStateJustDown
90 }
91 return KeyStateUp
92}
93
94// JustPressed returns whether a key was just pressed
95func (key KeyState) JustPressed() bool {

Callers 1

runKeyChecksFunction · 0.45

Calls

no outgoing calls

Tested by 1

runKeyChecksFunction · 0.36