Changeset 7203 in orxonox.OLD for branches/std/src/lib/event/key_names.h
- Timestamp:
- Mar 9, 2006, 5:28:10 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/std/src/lib/event/key_names.h
r5474 r7203 1 1 /*! 2 2 * @file keynames.h 3 4 5 6 */3 * Key/button naming functions 4 * 5 * Converts strings to SDLK/SDL_BUTTON values and vice versa 6 */ 7 7 #ifndef _KEY_NAMES_H 8 8 #define _KEY_NAMES_H 9 9 10 /** 11 * converts a button name string to a integer representing the corresponding SDL mouse button identifier 12 * @param name: the name of the mouse button 13 * @return an int containing the SDL identifier of the mouse button or -1 if the button name is not valid 14 */ 15 int buttonnameToSDLB(const char* name); 10 #include <string> 16 11 17 12 /** 18 * converst a SDL mouse button identifier to a name string 19 * @param button: an SDL mouse button identifier 20 * @return a pointer to a string containing the name of the mouse button 21 */ 13 * converts a button name string to a integer representing the corresponding SDL mouse button identifier 14 * @param name: the name of the mouse button 15 * @return an int containing the SDL identifier of the mouse button or -1 if the button name is not valid 16 */ 17 int buttonnameToSDLB(const std::string& name); 18 19 /** 20 * converst a SDL mouse button identifier to a name string 21 * @param button: an SDL mouse button identifier 22 * @return a pointer to a string containing the name of the mouse button 23 */ 22 24 const char* SDLBToButtonname( int button); 23 25 24 26 /** 25 26 27 28 */29 int keynameToSDLK(const char*name);27 * converts a key name string to a integer representing the corresponding SDLK sym 28 * @param name: the name of the key 29 * @return the SDLK sym of the named key or -1 if the key name is not valid 30 */ 31 int keynameToSDLK(const std::string& name); 30 32 31 33 /** 32 33 34 35 */34 * converts an SDLK sym to a name string 35 * @param key: the SDLK sym 36 * @return a pointer to a string containig the name of the key 37 */ 36 38 const char* SDLKToKeyname( int key); 37 39
Note: See TracChangeset
for help on using the changeset viewer.