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 "./raylib.hpp"
5
6namespace raylib {
10namespace Keyboard {
14 [[maybe_unused]] RLCPPAPI inline bool IsKeyPressed(int key) {
15 return ::IsKeyPressed(key);
16 }
17
21 [[maybe_unused]] RLCPPAPI inline bool IsKeyPressedRepeat(int key) {
22 return ::IsKeyPressedRepeat(key);
23 }
24
28 [[maybe_unused]] RLCPPAPI inline bool IsKeyDown(int key) {
29 return ::IsKeyDown(key);
30 }
31
35 [[maybe_unused]] RLCPPAPI inline bool IsKeyReleased(int key) {
36 return ::IsKeyReleased(key);
37 }
38
42 [[maybe_unused]] RLCPPAPI inline bool IsKeyUp(int key) {
43 return ::IsKeyUp(key);
44 }
45
49 [[maybe_unused]] RLCPPAPI inline bool GetKeyPressed() {
50 return ::GetKeyPressed();
51 }
52
56 [[maybe_unused]] RLCPPAPI inline bool GetCharPressed() {
57 return ::GetCharPressed();
58 }
59} // namespace Keyboard
60} // namespace raylib
61
62namespace RKeyboard = raylib::Keyboard;
63
64#endif // RAYLIB_CPP_INCLUDE_KEYBOARD_HPP_
Input-related functions: keyboard.
Definition: Keyboard.hpp:10
RLCPPAPI bool IsKeyPressedRepeat(int key)
Detect if a key has been pressed again (Only PLATFORM_DESKTOP)
Definition: Keyboard.hpp:21
RLCPPAPI bool IsKeyDown(int key)
Detect if a key is being pressed.
Definition: Keyboard.hpp:28
RLCPPAPI bool IsKeyUp(int key)
Detect if a key is NOT being pressed.
Definition: Keyboard.hpp:42
RLCPPAPI bool GetCharPressed()
Get char pressed (unicode), call it multiple times for chars queued, returns 0 when the queue is empt...
Definition: Keyboard.hpp:56
RLCPPAPI bool IsKeyReleased(int key)
Detect if a key has been released once.
Definition: Keyboard.hpp:35
RLCPPAPI bool IsKeyPressed(int key)
Detect if a key has been pressed once.
Definition: Keyboard.hpp:14
RLCPPAPI bool GetKeyPressed()
Get key pressed (keycode), call it multiple times for keys queued, returns 0 when the queue is empty.
Definition: Keyboard.hpp:49