Back to index

extremetuxracer  0.5beta
keyboardconfig.h
Go to the documentation of this file.
00001 /*  
00002  * ETRacer
00003  * Copyright (C) 2007-2008 The ETRacer Team <www.extremetuxracer.com>
00004  *
00005  * PPRacer 
00006  * Copyright (C) 2004-2005 Volker Stroebel <volker@planetpenguin.de>
00007  *
00008  * This program is free software; you can redistribute it and/or
00009  * modify it under the terms of the GNU General Public License
00010  * as published by the Free Software Foundation; either version 2
00011  * of the License, or (at your option) any later version.
00012  * 
00013  * This program is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  * GNU General Public License for more details.
00017  * 
00018  * You should have received a copy of the GNU General Public License
00019  * along with this program; if not, write to the Free Software
00020  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00021  */
00022  
00023 #ifndef _KEYBOARD_CONFIG_H
00024 #define _KEYBOARD_CONFIG_H
00025 
00026 #include "configmode.h"
00027 
00028 #include "ppgltk/entry.h"
00029 
00030 // KeyEntry declaration
00031 
00032 class KeyEntry : public pp::Entry
00033 {
00034        SDLKey keysym;
00035 public:
00036        KeyEntry(pp::Vec2d pos, pp::Vec2d size, const char *binding, const char *content="");
00037        ~KeyEntry();
00038        void setKeySym(SDLKey keysym);     
00039        SDLKey getKeySym();
00040 };
00041 
00042 // KeyboardConfig declaration
00043 
00044 class KeyboardConfig : public ConfigMode
00045 {
00046        KeyEntry* mp_left;
00047        KeyEntry* mp_right;
00048        KeyEntry* mp_paddle;
00049        KeyEntry* mp_brake;
00050        KeyEntry* mp_jump;
00051        KeyEntry* mp_trick;
00052        KeyEntry* mp_reset;
00053        
00054 public:
00055        KeyboardConfig();
00056        ~KeyboardConfig();
00057 
00058        void setWidgetPositions();
00059        void apply();
00060 
00061        void setKey(KeyEntry* widget, SDLKey key);
00062 };
00063 
00064 #endif // KEYBOARD_CONFIG_H