DynRPG  v0.14a
RM2k3 Plugin SDK
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator
Public Member Functions | Public Attributes
RPG::Input Class Reference

Used for key input. More...

List of all members.

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)

Detailed Description

Used for key input.

See also:
RPG::input

Member Function Documentation

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:

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".

Parameters:
keyIdRPG::Key for which the key codes should be read or changed
Returns:
Pointer to the first key code used for this RPG::Key
See also:
RPG::Key
bool RPG::Input::pressed ( RPG::Key  keyId)

Checks whether a RPG::Key is pressed.

This function checks if one of the physical keys asiigned to a RPG::Key is currently held down. This function does not use the RPG Maker's internal key cache.

Parameters:
keyIdRPG::Key to check
Returns:
true if the key is pressed, false otherwise

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.


Member Data Documentation

Array of key codes assigned to the different RPG::Key values (part 1)

This array contains the key assignments for those key functions which exist both in RPG Maker 2000 and RPG Maker 2003. Use the key method for easy access.

See also:
keys2k3
RPG::Key
key

Array of key codes assigned to the different RPG::Key values (part 2)

This array contains the key assignments for those key functions which exist only in RPG Maker 2003. Use the key method for easy access.

See also:
keys
RPG::Key
key
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator