Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/trunk/src/lib/event/key_names.h @ 7415

Last change on this file since 7415 was 7221, checked in by bensch, 19 years ago

orxonox/trunk: merged the std-branche back, it runs on windows and Linux

svn merge https://svn.orxonox.net/orxonox/branches/std . -r7202:HEAD

File size: 1.2 KB
Line 
1/*!
2 * @file keynames.h
3 *  Key/button naming functions
4 *
5 * Converts strings to SDLK/SDL_BUTTON values and vice versa
6 */
7#ifndef _KEY_NAMES_H
8#define _KEY_NAMES_H
9
10#include <string>
11
12/**
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 */
17int 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 */
24const char* SDLBToButtonname( int button);
25
26/**
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 */
31int keynameToSDLK(const std::string& name);
32
33/**
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 */
38const char* SDLKToKeyname( int key);
39
40
41#endif /* _KEY_NAMES_H */
Note: See TracBrowser for help on using the repository browser.