![]() |
DynRPG
v0.20
RM2k3 Plugin SDK
|
Used for key input. More...
Public Member Functions | |
int * | key (RPG::Key keyId) |
Provides easy access to the key assignments. | |
bool | pressed (RPG::Key keyId) |
Checks whether a RPG::Key is pressed. | |
void | update () |
Updates the RPG Maker's internal key cache. | |
Public Attributes | |
int | keys [48] |
Array of key codes assigned to the different RPG::Key values (part 1) | |
int | keys2k3 [120] |
Array of key codes assigned to the different RPG::Key values (part 2) |
Used for key input.
int* RPG::Input::key | ( | RPG::Key | keyId | ) |
Provides easy access to the key assignments.
This function returns a pointer to the "block" of 8 key codes in the keys
or keys2k3
array which corresponds to the given RPG::Key value. The result should be used with the []
syntax with an index from 0
to 7
.
Example:
RPG::input->key(RPG::KEY_DECISION)[3] = VK_TAB;
This example would assign the TAB
key as a new decision key (the default decision keys are Enter
, Space
and Z
, indexes 3
to 7
are not assigned by default).
The values used for key assignments are virtual key codes, zero meaning "not assigned".
keyId | RPG::Key for which the key codes should be read or changed |
bool RPG::Input::pressed | ( | RPG::Key | keyId | ) |
void RPG::Input::update | ( | ) |
Updates the RPG Maker's internal key cache.
The RPG Maker uses an internal key cache which is normally updated every frame. This function updates the key cache.
int RPG::Input::keys[48] |