added control and alt checking
This commit is contained in:
parent
46cd07d2c7
commit
a12bc488f4
|
|
@ -1177,6 +1177,8 @@ RLAPI void PlayAutomationEvent(AutomationEvent event); // Play a reco
|
|||
RLAPI bool IsKeyPressed(int key); // Check if a key has been pressed once
|
||||
RLAPI bool IsKeyPressedRepeat(int key); // Check if a key has been pressed again
|
||||
RLAPI bool IsKeyDown(int key); // Check if a key is being pressed
|
||||
RLAPI bool IsControlKeyDown(); // Check if any control key is being pressed
|
||||
RLAPI bool IsAltKeyDown(); // Check if any alt key is being pressed
|
||||
RLAPI bool IsKeyReleased(int key); // Check if a key has been released once
|
||||
RLAPI bool IsKeyUp(int key); // Check if a key is NOT being pressed
|
||||
RLAPI int GetKeyPressed(void); // Get key pressed (keycode), call it multiple times for keys queued, returns 0 when the queue is empty
|
||||
|
|
|
|||
10
src/rcore.c
10
src/rcore.c
|
|
@ -3184,6 +3184,16 @@ bool IsKeyDown(int key)
|
|||
return down;
|
||||
}
|
||||
|
||||
bool IsControlKeyDown()
|
||||
{
|
||||
return IsKeyDown(KEY_LEFT_CONTROL) || IsKeyDown(KEY_RIGHT_CONTROL);
|
||||
}
|
||||
|
||||
bool IsAltKeyDown()
|
||||
{
|
||||
return IsKeyDown(KEY_LEFT_ALT) || IsKeyDown(KEY_RIGHT_ALT);
|
||||
}
|
||||
|
||||
// Check if a key has been released once
|
||||
bool IsKeyReleased(int key)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user