Input: Difference between revisions

From Crumbled World Wiki
(Created page with "{{:InputExampleCode}} ==Functions== {| class="wikitable" !|return !|function !|description |- |bool |getKeyDown(Key key) |return true if the key has been pressed down |- |bool |getKeyHeld(Key key) |return true if the key has been pressed down but not yet released. |- |bool |getKeyPressed(Key key) |return true if the key has been released. |- |bool |Input:getMouseDo...")
 
(No difference)

Latest revision as of 14:22, 5 July 2025

InputExampleCode

Functions

return function description
bool getKeyDown(Key key) return true if the key has been pressed down
bool getKeyHeld(Key key) return true if the key has been pressed down but not yet released.
bool getKeyPressed(Key key) return true if the key has been released.
bool getMouseDown(MouseKey key) return true if the mouse key has been pressed down
bool getMouseHeld(MouseKey key) return true if the mouse key has been pressed down but not yet released.
bool getMousePressed(MouseKey key) return true if the mouse key has been released.
bool getMouseDoubleClick(MouseKey key) return true if the mouse key has been double clicked.
Vec2 getMousePos() return the mouse last position.
Vec2 getMouseDelta() return the diff bettwen the current mouse pos and last frame mose pos
int getMouseWheelTicks() return mouse wheel ticks.
int getAnyKeyDownEvent() return -1 if no key was pressed down else return the keyCode from Key
int getAnyMouseDownEvent() return -1 if no mouse key was pressed down else return the mousekeycode from MouseKey