ZeroZero Game Engine  v0.0
A 3D game engine using Vulkan & Jolt
Static Public Member Functions | List of all members
Input Class Reference

Detailed Description

A singleton for handling inputs

Static Public Member Functions

static bool isKeyPressed (Key key)
 
static bool isKeyJustPressed (Key key)
 
static bool isKeyJustReleased (Key key)
 
static vec2 getKeyboardVector (Key negX, Key posX, Key negY, Key posY)
 
static bool isMouseButtonPressed (MouseButton mouseButton)
 
static bool isMouseButtonJustPressed (MouseButton mouseButton)
 
static bool isMouseButtonJustReleased (MouseButton mouseButton)
 
static void setMouseMode (MouseMode mode)
 
static void setMouseCursor (MouseCursor cursor)
 
static void resetMousePosition ()
 
static vec2 getMousePosition ()
 
static void setMousePosition (const vec2 &position)
 
static uint32_t getConnectedJoypads ()
 
static bool isGamepad (uint32_t index)
 
static string getJoypadName (uint32_t index)
 
static vec2 getGamepadVector (uint32_t index, GamepadAxisJoystick axisJoystick)
 
static bool isGamepadButtonPressed (uint32_t index, GamepadButton gamepadButton)
 

Member Function Documentation

static uint32_t getConnectedJoypads ( )
nodiscardstatic

Returns the number of connected joypads, including gamepads

static vec2 getGamepadVector ( uint32_t  index,
GamepadAxisJoystick  axisJoystick 
)
nodiscardstatic

Gets an input vector for a gamepad joystick

Parameters
indexindex of the joypad in [0..getConnectedJoypads()]
axisJoystickaxis
static string getJoypadName ( uint32_t  index)
nodiscardstatic

Returns the joypad name

Parameters
indexindex of the joypad in [0..getConnectedJoypads()]
static vec2 getKeyboardVector ( Key  negX,
Key  posX,
Key  negY,
Key  posY 
)
nodiscardstatic

Gets an input vector by specifying four keys for the positive and negative X and Y axes.

static vec2 getMousePosition ( )
static

Returns the mouse position

static bool isGamepad ( uint32_t  index)
nodiscardstatic

Returns true if the joypad is a gamepad

Parameters
indexindex of the joypad in [0..getConnectedJoypads()]
static bool isGamepadButtonPressed ( uint32_t  index,
GamepadButton  gamepadButton 
)
nodiscardstatic

Returns true if you are pressing the gamepad button

Parameters
indexindex of the joypad in [0..getConnectedJoypads()]
gamepadButtongamepad button
static bool isKeyJustPressed ( Key  key)
nodiscardstatic

Returns true when the user has started pressing the key

static bool isKeyJustReleased ( Key  key)
nodiscardstatic

Returns true when the user stops pressing the key

static bool isKeyPressed ( Key  key)
nodiscardstatic

Returns true if you are pressing the key

static bool isMouseButtonJustPressed ( MouseButton  mouseButton)
nodiscardstatic

Returns true when the user has started pressing the mouse button

static bool isMouseButtonJustReleased ( MouseButton  mouseButton)
nodiscardstatic

Returns true when the user stops pressing the mouse button

static bool isMouseButtonPressed ( MouseButton  mouseButton)
nodiscardstatic

Returns true if you are pressing the mouse button

static void resetMousePosition ( )
static

Sets the mouse position to the center of the window

static void setMouseCursor ( MouseCursor  cursor)
static

Sets the mouse cursor

static void setMouseMode ( MouseMode  mode)
static

Sets the mouse visibility and capture mode

static void setMousePosition ( const vec2 &  position)
static

Returns the mouse position