| 
                Last change
                  on this file since 3318 was
                  3230,
                  checked in by patrick, 21 years ago
           | 
        
        
          | 
               
orxonox/trunk: unstable - list_template, keyname 
 
           | 
        
        | 
            File size:
            1.2 KB
           | 
      
      
        
  | Rev | Line |   | 
|---|
| [2066] | 1 | /*! | 
|---|
 | 2 |     \file keynames.h | 
|---|
 | 3 |     \brief Key/button naming functions | 
|---|
 | 4 |      | 
|---|
| [2551] | 5 |                 Converts strings to SDLK/SDL_BUTTON values and vice versa | 
|---|
| [2141] | 6 | */ | 
|---|
| [3224] | 7 | #ifndef _KEYNAMES_H | 
|---|
 | 8 | #define _KEYNAMES_H | 
|---|
| [2551] | 9 |  | 
|---|
| [3224] | 10 |  | 
|---|
| [2551] | 11 | #ifdef __WIN32__ | 
|---|
 | 12 | #include <windows.h> | 
|---|
 | 13 | #endif | 
|---|
 | 14 |  | 
|---|
| [2995] | 15 | #ifndef __APPLE__ | 
|---|
| [2551] | 16 | #include <SDL/SDL.h> | 
|---|
| [2995] | 17 | #else | 
|---|
 | 18 | #include <SDL.h> | 
|---|
 | 19 | #endif | 
|---|
| [2551] | 20 |  | 
|---|
| [2141] | 21 | /** | 
|---|
| [2551] | 22 |         \brief converts a button name string to a integer representing the corresponding SDL mouse button identifier | 
|---|
 | 23 |         \param name: the name of the mouse button | 
|---|
 | 24 |         \return an int containing the SDL identifier of the mouse button or -1 if the button name is not valid | 
|---|
| [2141] | 25 | */ | 
|---|
| [3230] | 26 | int buttonnameToSDLB( char* name); | 
|---|
| [2551] | 27 |  | 
|---|
| [2141] | 28 | /** | 
|---|
| [2551] | 29 |         \brief converst a SDL mouse button identifier to a name string | 
|---|
 | 30 |         \param button: an SDL mouse button identifier | 
|---|
 | 31 |         \return a pointer to a string containing the name of the mouse button | 
|---|
| [2141] | 32 | */ | 
|---|
| [3230] | 33 | char* SDLBToButtonname( int button); | 
|---|
| [2551] | 34 |  | 
|---|
 | 35 | /** | 
|---|
 | 36 |         \brief converts a key name string to a integer representing the corresponding SDLK sym | 
|---|
 | 37 |         \param name: the name of the key | 
|---|
 | 38 |         \return the SDLK sym of the named key or -1 if the key name is not valid | 
|---|
 | 39 | */ | 
|---|
| [3230] | 40 | int keynameToSDLK( char* name); | 
|---|
| [2551] | 41 |  | 
|---|
 | 42 | /** | 
|---|
 | 43 |         \brief converts an SDLK sym to a name string | 
|---|
 | 44 |         \param key: the SDLK sym | 
|---|
 | 45 |         \return a pointer to a string containig the name of the key | 
|---|
 | 46 | */ | 
|---|
| [3230] | 47 | char* SDLKToKeyname( int key); | 
|---|
| [2551] | 48 |  | 
|---|
| [3224] | 49 |  | 
|---|
 | 50 | #endif /* _KEYNAMES_H */ | 
|---|
       
      
      Note: See 
TracBrowser
        for help on using the repository browser.