The Table Engine
input.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "component.h"
4 
20 class Input : public Component {
21 public:
22  bool spacePressed = false;
23 
24  bool leftPressed = false;
25  bool rightPressed = false;
26  bool upPressed = false;
27  bool downPressed = false;
28 
30 
31  bool mouseLeftPressed = false;
32  bool mouseRightPressed = false;
33  bool mouseMiddlePressed = false;
34 
38  Input();
39 
43  ~Input();
44 
50  void update() override;
51 };
Base class for all game components, providing basic component functionalities.
Definition: component.h:25
Component for handling and storing the state of input devices.
Definition: input.h:20
bool mouseLeftPressed
True if the left mouse button is pressed, false otherwise.
Definition: input.h:31
int m_mouseY
Current position of the mouse cursor.
Definition: input.h:29
bool upPressed
True if the up arrow key is pressed, false otherwise.
Definition: input.h:26
bool mouseRightPressed
True if the right mouse button is pressed, false otherwise.
Definition: input.h:32
void update() override
Updates the state of the input based on the latest user interactions.
Definition: input.cpp:17
bool spacePressed
True if the space bar is pressed, false otherwise.
Definition: input.h:22
bool mouseMiddlePressed
True if the middle mouse button is pressed, false otherwise.
Definition: input.h:33
bool rightPressed
True if the right arrow key is pressed, false otherwise.
Definition: input.h:25
bool leftPressed
True if the left arrow key is pressed, false otherwise.
Definition: input.h:24
bool downPressed
True if the down arrow key is pressed, false otherwise.
Definition: input.h:27
Input()
Constructor for the Input component.
Definition: input.cpp:6
~Input()
Destructor for the Input component.
Definition: input.cpp:13
int m_mouseX
Definition: input.h:29
Defines the Component base class for all components in the game engine.