Public Member Functions | |
uKeyInput () | |
~uKeyInput () | |
Public Attributes | |
uInput * | sdl_keys [SDLK_LAST+1] |
Definition at line 175 of file uInput.cpp.
uKeyInput::uKeyInput | ( | ) | [inline] |
Definition at line 178 of file uInput.cpp.
References c, uInput::ID(), isblank(), su_NewInput(), and tASSERT.
00179 { 00180 for ( int i = 0; i <= SDLK_LAST; ++i ) 00181 { 00182 #ifndef DEDICATED 00183 char const * ID_Raw = SDL_GetKeyName(static_cast< SDLKey >( i ) ); 00184 #else 00185 char const * ID_Raw = "unknown key"; 00186 #endif 00187 std::ostringstream id; 00188 id << "KEY_"; 00189 if ( strcmp( ID_Raw, "unknown key" ) == 0 ) 00190 { 00191 id << "UNKNONW_" << i; 00192 } 00193 else 00194 { 00195 for ( char const * c = ID_Raw; *c; ++c ) 00196 { 00197 if ( isblank( *c ) ) 00198 { 00199 id << "_"; 00200 } 00201 else 00202 { 00203 id << char(toupper( *c )); 00204 } 00205 } 00206 } 00207 00208 // store new input key 00209 sdl_keys[i] = su_NewInput( id.str(), tString(ID_Raw) ); 00210 00211 tASSERT( sdl_keys[i]->ID() == i ); 00212 }
uKeyInput::~uKeyInput | ( | ) | [inline] |
uInput* uKeyInput::sdl_keys[SDLK_LAST+1] |
Definition at line 218 of file uInput.cpp.