raylib-cpp
C++ object-oriented wrapper library for raylib.
Loading...
Searching...
No Matches
Keyboard.hpp
1#ifndef RAYLIB_CPP_INCLUDE_KEYBOARD_HPP_
2#define RAYLIB_CPP_INCLUDE_KEYBOARD_HPP_
3
4#include "./Functions.hpp"
5#include "./raylib.hpp"
6
7namespace raylib {
11namespace Keyboard {
15[[maybe_unused]] RLCPPAPI inline bool IsKeyPressed(int key) {
16 return ::IsKeyPressed(key);
17}
18
22[[maybe_unused]] RLCPPAPI inline bool IsKeyPressedRepeat(int key) {
23 return ::IsKeyPressedRepeat(key);
24}
25
29[[maybe_unused]] RLCPPAPI inline bool IsKeyDown(int key) {
30 return ::IsKeyDown(key);
31}
32
36[[maybe_unused]] RLCPPAPI inline bool IsKeyReleased(int key) {
37 return ::IsKeyReleased(key);
38}
39
43[[maybe_unused]] RLCPPAPI inline bool IsKeyUp(int key) {
44 return ::IsKeyUp(key);
45}
46
51[[maybe_unused]] RLCPPAPI inline int GetKeyPressed() {
52 return ::GetKeyPressed();
53}
54
58[[maybe_unused]] RLCPPAPI inline int GetCharPressed() {
59 return ::GetCharPressed();
60}
61} // namespace Keyboard
62} // namespace raylib
63
64namespace RKeyboard = raylib::Keyboard;
65
66#endif // RAYLIB_CPP_INCLUDE_KEYBOARD_HPP_
Input-related functions: keyboard.
Definition: Keyboard.hpp:11
static bool IsKeyReleased(int key)
Detect if a key has been released once.
Definition: Keyboard.hpp:36
static int GetCharPressed()
Get char pressed (unicode), call it multiple times for chars queued, returns 0 when the queue is empt...
Definition: Keyboard.hpp:58
static bool IsKeyPressed(int key)
Detect if a key has been pressed once.
Definition: Keyboard.hpp:15
static bool IsKeyPressedRepeat(int key)
Detect if a key has been pressed again (Only PLATFORM_DESKTOP)
Definition: Keyboard.hpp:22
static int GetKeyPressed()
Get key pressed (keycode), call it multiple times for keys queued, returns 0 when the queue is empty.
Definition: Keyboard.hpp:51
static bool IsKeyDown(int key)
Detect if a key is being pressed.
Definition: Keyboard.hpp:29
static bool IsKeyUp(int key)
Detect if a key is NOT being pressed.
Definition: Keyboard.hpp:43
All raylib-cpp classes and functions appear in the raylib namespace.
Definition: AudioDevice.hpp:8