mirror of
https://github.com/zoriya/Bomberman.git
synced 2025-12-20 21:35:12 +00:00
sources and include in the same folder
This commit is contained in:
46
lib/Ray/sources/Controllers/Keyboard.hpp
Normal file
46
lib/Ray/sources/Controllers/Keyboard.hpp
Normal file
@@ -0,0 +1,46 @@
|
||||
|
||||
/*
|
||||
** EPITECH PROJECT, 2021
|
||||
** Bomberman
|
||||
** File description:
|
||||
** Keyboard
|
||||
*/
|
||||
|
||||
#ifndef KEYBOARD_HPP_
|
||||
#define KEYBOARD_HPP_
|
||||
|
||||
#include <raylib.h>
|
||||
#include <vector>
|
||||
|
||||
namespace RAY::Controller {
|
||||
class Keyboard {
|
||||
public:
|
||||
typedef ::KeyboardKey Key;
|
||||
|
||||
//! @return true if Key is pressed on the keyboard
|
||||
//! @param Key The keycode of the key
|
||||
static bool isPressed(Key);
|
||||
|
||||
//! @return true if Key is down on the keyboard
|
||||
//! @param Key The keycode of the key
|
||||
static bool isDown(Key);
|
||||
|
||||
//! @return true if Key is released on the keyboard
|
||||
//! @param Key The keycode of the key
|
||||
static bool isReleased(Key);
|
||||
|
||||
//! @return true if Key is up on the keyboard
|
||||
//! @param Key The keycode of the key
|
||||
static bool isUp(Key);
|
||||
|
||||
//! @brief Fetch currently pressed keys
|
||||
//! @return a vector containing keycode of currently pressed keys
|
||||
static std::vector<Keyboard::Key> getPressedKeys(void);
|
||||
|
||||
//! @brief Fetch currently pressed keys
|
||||
//! @return a vector containing char of currently pressed keys
|
||||
static std::vector<char> getPressedChars(void);
|
||||
};
|
||||
}
|
||||
|
||||
#endif /* !KEYBOARD_HPP_ */
|
||||
Reference in New Issue
Block a user