DynRPG v0.32 Unofficial
Plugin SDK
Public Member Functions | Public Attributes | List of all members
RPG::Input Class Reference

Used for key input. More...

#include <Input.h>

Public Member Functions

intkey (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 joystickId
 The ID of the first joystick.
 
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)
 
int resolutionTime
 In milliseconds.
 
int uTimerId
 0 if timerEvent for input not existing
 
KeyDown_T isPressed
 Are a combination of keys pressed & released (See RPG::KeyDown)
 
KeyDownAlt_T isShiftCtrlPressed
 Are the Shift or Ctrl keys & released (See RPG::KeyDownAlt)
 
KeyDown_T isHeld
 Are a combination of keys held (See RPG::KeyDown)
 
KeyDownAlt_T isShiftCtrlHeld
 Are the Shift or Ctrl keys held (See RPG::KeyDownAlt)
 
KeyDown_T isTapped
 Are a combination of keys tapped (See RPG::KeyDown)
 
KeyDownAlt_T isShiftCtrlTapped
 Are the Shift or Ctrl keys tapped (See RPG::KeyDownAlt)
 
int joyInfo [4]
 JOYINFO button state?
 
int keyHoldTimer
 Amount of time a key is held?
 
char leftRight
 
int directionNumpad
 down (2), left (4), right (6), up (8)
 
bool joyRepsonseFlag
 If 1, response for button status of joy device took too long & don't process JoyInput.
 

Detailed Description

Used for key input.

See also
RPG::input

Member Function Documentation

◆ key()

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:

int * key(RPG::Key keyId)
Provides easy access to the key assignments.
Map *& map
The current map environment (camera, events, etc.)
RPG::Input *& input
Object used for key assignments and key input checking.
@ KEY_DECISION
Keys which are used to confirm an action.
Definition Key.h:20

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

◆ pressed()

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

◆ update()

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.

Member Data Documentation

◆ keys

int RPG::Input::keys[48]

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.

Indexes:

    0-7: Down
    8-15: Left
16-23: Right
24-31: Up
32-39: Decision
40-47: Cancel
See also
keys2k3
RPG::Key
key

◆ keys2k3

int RPG::Input::keys2k3[120]

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. Specifically these are the key assignments for numpad keys or otherwise that are detected via the "Key Input Processing" event command

Indexes: 0-7: 0 (Detected via Key Input Processing normally) 8-15: 1 " 16-23: 2 " 24-31: 3 " 32-39: 4 " 40-47: 5 " 48-55: 6 " 56-63: 7 " 64-71: 8 " 72-79: 9 " 80-87: + " 88-95: - " 96-103: * " 104-111: / " 112-119: . "

See also
keys
RPG::Key
key

The documentation for this class was generated from the following file: