KeyboardConfig Class Reference

#include <keyboardconfig.h>

List of all members.


Detailed Description

Definition at line 41 of file keyboardconfig.h.


Public Types

enum  KeyAction {
  KEY_NO_VALUE = -1, KEY_MOVE_UP, KEY_MOVE_DOWN, KEY_MOVE_LEFT,
  KEY_MOVE_RIGHT, KEY_ATTACK, KEY_EMOTE, KEY_TALK,
  KEY_TARGET, KEY_TARGET_CLOSEST, KEY_TARGET_NPC, KEY_TARGET_PLAYER,
  KEY_PICKUP, KEY_HIDE_WINDOWS, KEY_SIT, KEY_SCREENSHOT,
  KEY_TRADE, KEY_PATHFIND, KEY_SHORTCUT_1, KEY_SHORTCUT_2,
  KEY_SHORTCUT_3, KEY_SHORTCUT_4, KEY_SHORTCUT_5, KEY_SHORTCUT_6,
  KEY_SHORTCUT_7, KEY_SHORTCUT_8, KEY_SHORTCUT_9, KEY_SHORTCUT_10,
  KEY_SHORTCUT_11, KEY_SHORTCUT_12, KEY_WINDOW_HELP, KEY_WINDOW_STATUS,
  KEY_WINDOW_INVENTORY, KEY_WINDOW_EQUIPMENT, KEY_WINDOW_SKILL, KEY_WINDOW_MINIMAP,
  KEY_WINDOW_CHAT, KEY_WINDOW_SHORTCUT, KEY_WINDOW_SETUP, KEY_WINDOW_DEBUG,
  KEY_WINDOW_EMOTE, KEY_WINDOW_EMOTE_SHORTCUT, KEY_EMOTE_1, KEY_EMOTE_2,
  KEY_EMOTE_3, KEY_EMOTE_4, KEY_EMOTE_5, KEY_EMOTE_6,
  KEY_EMOTE_7, KEY_EMOTE_8, KEY_EMOTE_9, KEY_EMOTE_10,
  KEY_EMOTE_11, KEY_EMOTE_12, KEY_TOGGLE_CHAT, KEY_SCROLL_CHAT_UP,
  KEY_SCROLL_CHAT_DOWN, KEY_PREV_CHAT_TAB, KEY_NEXT_CHAT_TAB, KEY_OK,
  KEY_QUIT, KEY_IGNORE_INPUT_1, KEY_IGNORE_INPUT_2, KEY_TOTAL
}
 All the key functions. More...

Public Member Functions

void init ()
 Initializes the keyboard config explicitly.
void retrieve ()
 Retrieve the key values from config file.
void store ()
 Store the key values to config file.
void makeDefault ()
 Make the keys their default values.
bool hasConflicts ()
 Determines if any key assignments are the same as each other.
void callbackNewKey ()
 Calls a function back so the key re-assignment(s) can be seen.
int getKeyValue (int index) const
 Obtain the value stored in memory.
int getNewKeyIndex () const
 Get the index of the new key to be assigned.
bool isEnabled () const
 Get the enable flag, which will stop the user from doing actions.
const std::string & getKeyCaption (int index) const
 Get the key caption, providing more meaning to the user.
int getKeyIndex (int keyValue) const
 Get the key function index by providing the keys value.
int getKeyEmoteOffset (int keyValue) const
 Get the key function index for an emote by providing the offset value.
void setEnabled (bool flag)
 Set the enable flag, which will stop the user from doing actions.
void setNewKeyIndex (int value)
 Set the index of the new key to be assigned.
void setNewKey (int value)
 Set the value of the new key.
void setSetupKeyboard (Setup_Keyboard *setupKey)
 Set a reference to the key setup window.
bool isKeyActive (int index)
 Checks if the key is active, by providing the key function index.
void refreshActiveKeys ()
 Takes a snapshot of all the active keys.

Private Attributes

int mNewKeyIndex
 Index of new key to be assigned.
bool mEnabled
 Flag to respond to key input.
Setup_KeyboardmSetupKey
 Reference to setup window.
KeyFunction mKey [KEY_TOTAL]
 Pointer to all the key data.
Uint8 * mActiveKeys
 Stores a list of all the keys.

Member Enumeration Documentation

All the key functions.

KEY_NO_VALUE is used in initialization, and should be unchanged. KEY_TOTAL should always be last (used as a conditional in loops). The key assignment view gets arranged according to the order of these values.

Enumerator:
KEY_NO_VALUE 
KEY_MOVE_UP 
KEY_MOVE_DOWN 
KEY_MOVE_LEFT 
KEY_MOVE_RIGHT 
KEY_ATTACK 
KEY_EMOTE 
KEY_TALK 
KEY_TARGET 
KEY_TARGET_CLOSEST 
KEY_TARGET_NPC 
KEY_TARGET_PLAYER 
KEY_PICKUP 
KEY_HIDE_WINDOWS 
KEY_SIT 
KEY_SCREENSHOT 
KEY_TRADE 
KEY_PATHFIND 
KEY_SHORTCUT_1 
KEY_SHORTCUT_2 
KEY_SHORTCUT_3 
KEY_SHORTCUT_4 
KEY_SHORTCUT_5 
KEY_SHORTCUT_6 
KEY_SHORTCUT_7 
KEY_SHORTCUT_8 
KEY_SHORTCUT_9 
KEY_SHORTCUT_10 
KEY_SHORTCUT_11 
KEY_SHORTCUT_12 
KEY_WINDOW_HELP 
KEY_WINDOW_STATUS 
KEY_WINDOW_INVENTORY 
KEY_WINDOW_EQUIPMENT 
KEY_WINDOW_SKILL 
KEY_WINDOW_MINIMAP 
KEY_WINDOW_CHAT 
KEY_WINDOW_SHORTCUT 
KEY_WINDOW_SETUP 
KEY_WINDOW_DEBUG 
KEY_WINDOW_EMOTE 
KEY_WINDOW_EMOTE_SHORTCUT 
KEY_EMOTE_1 
KEY_EMOTE_2 
KEY_EMOTE_3 
KEY_EMOTE_4 
KEY_EMOTE_5 
KEY_EMOTE_6 
KEY_EMOTE_7 
KEY_EMOTE_8 
KEY_EMOTE_9 
KEY_EMOTE_10 
KEY_EMOTE_11 
KEY_EMOTE_12 
KEY_TOGGLE_CHAT 
KEY_SCROLL_CHAT_UP 
KEY_SCROLL_CHAT_DOWN 
KEY_PREV_CHAT_TAB 
KEY_NEXT_CHAT_TAB 
KEY_OK 
KEY_QUIT 
KEY_IGNORE_INPUT_1 
KEY_IGNORE_INPUT_2 
KEY_TOTAL 

Definition at line 149 of file keyboardconfig.h.


Member Function Documentation

void KeyboardConfig::init (  ) 

Initializes the keyboard config explicitly.

Definition at line 105 of file keyboardconfig.cpp.

void KeyboardConfig::retrieve (  ) 

Retrieve the key values from config file.

Definition at line 120 of file keyboardconfig.cpp.

void KeyboardConfig::store (  ) 

Store the key values to config file.

Definition at line 129 of file keyboardconfig.cpp.

void KeyboardConfig::makeDefault (  ) 

Make the keys their default values.

Definition at line 137 of file keyboardconfig.cpp.

bool KeyboardConfig::hasConflicts (  ) 

Determines if any key assignments are the same as each other.

No need to parse the square matrix: only check one triangle that's enough to detect conflicts

Definition at line 145 of file keyboardconfig.cpp.

void KeyboardConfig::callbackNewKey (  ) 

Calls a function back so the key re-assignment(s) can be seen.

Definition at line 170 of file keyboardconfig.cpp.

int KeyboardConfig::getKeyValue ( int  index  )  const [inline]

Obtain the value stored in memory.

Definition at line 77 of file keyboardconfig.h.

int KeyboardConfig::getNewKeyIndex (  )  const [inline]

Get the index of the new key to be assigned.

Definition at line 83 of file keyboardconfig.h.

bool KeyboardConfig::isEnabled (  )  const [inline]

Get the enable flag, which will stop the user from doing actions.

Definition at line 89 of file keyboardconfig.h.

const std::string& KeyboardConfig::getKeyCaption ( int  index  )  const [inline]

Get the key caption, providing more meaning to the user.

Definition at line 95 of file keyboardconfig.h.

int KeyboardConfig::getKeyIndex ( int  keyValue  )  const

Get the key function index by providing the keys value.

Definition at line 175 of file keyboardconfig.cpp.

int KeyboardConfig::getKeyEmoteOffset ( int  keyValue  )  const

Get the key function index for an emote by providing the offset value.

Definition at line 188 of file keyboardconfig.cpp.

void KeyboardConfig::setEnabled ( bool  flag  )  [inline]

Set the enable flag, which will stop the user from doing actions.

Definition at line 111 of file keyboardconfig.h.

void KeyboardConfig::setNewKeyIndex ( int  value  )  [inline]

Set the index of the new key to be assigned.

Definition at line 117 of file keyboardconfig.h.

void KeyboardConfig::setNewKey ( int  value  )  [inline]

Set the value of the new key.

Definition at line 123 of file keyboardconfig.h.

void KeyboardConfig::setSetupKeyboard ( Setup_Keyboard setupKey  )  [inline]

Set a reference to the key setup window.

Definition at line 129 of file keyboardconfig.h.

bool KeyboardConfig::isKeyActive ( int  index  ) 

Checks if the key is active, by providing the key function index.

Definition at line 200 of file keyboardconfig.cpp.

void KeyboardConfig::refreshActiveKeys (  ) 

Takes a snapshot of all the active keys.

Definition at line 206 of file keyboardconfig.cpp.


Member Data Documentation

Index of new key to be assigned.

Definition at line 218 of file keyboardconfig.h.

bool KeyboardConfig::mEnabled [private]

Flag to respond to key input.

Definition at line 219 of file keyboardconfig.h.

Reference to setup window.

Definition at line 221 of file keyboardconfig.h.

KeyFunction KeyboardConfig::mKey[KEY_TOTAL] [private]

Pointer to all the key data.

Definition at line 223 of file keyboardconfig.h.

Uint8* KeyboardConfig::mActiveKeys [private]

Stores a list of all the keys.

Definition at line 225 of file keyboardconfig.h.


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

Generated on Sun Apr 26 17:30:43 2009 for The Mana World by  doxygen 1.5.5