2 Copyright (C) 2004 Parallel Realities
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 See the GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
28 void Keyboard::setDefaultKeys()
30 control[CONTROL::LEFT] = SDLK_LEFT;
31 control[CONTROL::RIGHT] = SDLK_RIGHT;
32 control[CONTROL::DOWN] = SDLK_DOWN;
33 control[CONTROL::JUMP] = SDLK_UP;
34 control[CONTROL::UP] = 0;
35 control[CONTROL::FIRE] = SDLK_LCTRL;
36 control[CONTROL::JETPACK] = SDLK_SPACE;
37 control[CONTROL::PAUSE] = SDLK_p;
38 control[CONTROL::MAP] = SDLK_TAB;
41 const char *Keyboard::translateKey(int key)
43 static char keyName[50];
52 strncpy(keyName, _(SDL_GetKeyName((SDLKey)key)), sizeof keyName);
55 This is not really neccessary, but it just makes
56 everything look neater. It runs through the string
57 and uppercase the first letter and any letter after
61 bool uppercase = true;
66 if ((*c >= SDLK_a) && (*c <= SDLK_z))
74 else if (*c == SDLK_SPACE)