bx_keymap_c Class Reference

#include <keymap.h>

Collaboration diagram for bx_keymap_c:

Collaboration graph
[legend]

Detailed Description

Keymap, used to map host keys to scancodes.

Definition at line 75 of file keymap.h.


Public Member Functions

 bx_keymap_c (CConfigurator *cfg)
 ~bx_keymap_c (void)
void loadKeymap (u32 stringToSymbol(const char *))
 Loads the configuration specified keymap file if keymapping is enabled using convertStringToSymbol to convert strings to client constants.
void loadKeymap (u32 stringToSymbol(const char *), const char *filename)
 Loads the specified keymap file using convertStringToSymbol to convert strings to client constants.
bool isKeymapLoaded ()
 Returns true if the keymap contains any valid key entries.
BXKeyEntryfindHostKey (u32 hostkeynum)
 Finds an entry whose hostKey value matches the target value, and returns a pointer to the corresponging BXKeyEntry structure.
BXKeyEntryfindAsciiChar (u8 ascii)
 Finds an entry whose ASCII character matches the target value, and returns a pointer to the corresponging BXKeyEntry structure.
const char * getBXKeyName (u32 key)

Private Member Functions

u32 convertStringToBXKey (const char *)
 Convert a null-terminate string to a BX_KEY code.

Private Attributes

CConfiguratormyCfg
BXKeyEntrykeymapTable
u16 keymapCount

Constructor & Destructor Documentation

bx_keymap_c::bx_keymap_c ( CConfigurator cfg  ) 

Definition at line 108 of file keymap.cpp.

References keymapCount, keymapTable, and myCfg.

bx_keymap_c::~bx_keymap_c ( void   ) 

Definition at line 115 of file keymap.cpp.

References keymapCount, and keymapTable.


Member Function Documentation

void bx_keymap_c::loadKeymap ( u32   stringToSymbolconst char *  ) 

Loads the configuration specified keymap file if keymapping is enabled using convertStringToSymbol to convert strings to client constants.

Definition at line 130 of file keymap.cpp.

References CConfigurator::get_bool_value(), CConfigurator::get_text_value(), and myCfg.

Referenced by bx_sdl_gui_c::specific_init(), bx_x11_gui_c::specific_init(), and bx_win32_gui_c::specific_init().

void bx_keymap_c::loadKeymap ( u32   stringToSymbolconst char *,
const char *  filename 
)

Loads the specified keymap file using convertStringToSymbol to convert strings to client constants.

Definition at line 271 of file keymap.cpp.

References BXKeyEntry::ascii, BXKeyEntry::baseKey, BX_DEBUG, BX_INFO, BX_KEYMAP_UNKNOWN, BX_PANIC, CHECK_REALLOCATION, convertStringToBXKey(), get_next_keymap_line(), BXKeyEntry::hostKey, init_parse(), keymapCount, keymapTable, and BXKeyEntry::modKey.

bool bx_keymap_c::isKeymapLoaded (  ) 

Returns true if the keymap contains any valid key entries.

Definition at line 139 of file keymap.cpp.

References keymapCount.

BXKeyEntry * bx_keymap_c::findHostKey ( u32  hostkeynum  ) 

Finds an entry whose hostKey value matches the target value, and returns a pointer to the corresponging BXKeyEntry structure.

Definition at line 369 of file keymap.cpp.

References BX_DEBUG, keymapCount, and keymapTable.

Referenced by bx_sdl_gui_c::handle_events(), and xkeypress().

BXKeyEntry * bx_keymap_c::findAsciiChar ( u8  ascii  ) 

Finds an entry whose ASCII character matches the target value, and returns a pointer to the corresponging BXKeyEntry structure.

Definition at line 392 of file keymap.cpp.

References BX_DEBUG, keymapCount, and keymapTable.

const char * bx_keymap_c::getBXKeyName ( u32  key  ) 

Definition at line 412 of file keymap.cpp.

References bx_key_symbol.

Referenced by CKeyboard::gen_scancode().

u32 bx_keymap_c::convertStringToBXKey ( const char *  string  )  [private]

Convert a null-terminate string to a BX_KEY code.

Definition at line 349 of file keymap.cpp.

References BX_KEY_NBKEYS, bx_key_symbol, and BX_KEYMAP_UNKNOWN.

Referenced by loadKeymap().


Field Documentation

Definition at line 91 of file keymap.h.

Referenced by bx_keymap_c(), and loadKeymap().

Definition at line 93 of file keymap.h.

Referenced by bx_keymap_c(), findAsciiChar(), findHostKey(), loadKeymap(), and ~bx_keymap_c().


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

SourceForge.net Logo
Project space on SourceForge.net