Implemented key_is_down() function.
This commit is contained in:
parent
ea4f4a97b6
commit
d871bcec41
@ -132,3 +132,10 @@ void handle_event() {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int key_is_down(int code) {
|
||||||
|
if(code < 0 || code >= KEY_MAX)
|
||||||
|
return -1;
|
||||||
|
else
|
||||||
|
return keys[code];
|
||||||
|
}
|
||||||
|
@ -53,6 +53,7 @@ void handle_event();
|
|||||||
*
|
*
|
||||||
* @param code The key code.
|
* @param code The key code.
|
||||||
*
|
*
|
||||||
* @return If down 1 will be returned, else 0.
|
* @return If down 1 will be returned, if the keycode is
|
||||||
|
* invalid then -1 is returned, else 0.
|
||||||
*/
|
*/
|
||||||
int key_is_down(int code);
|
int key_is_down(int code);
|
||||||
|
Loading…
Reference in New Issue
Block a user