Changeset 5020 in orxonox.OLD for orxonox/trunk/src/lib/gui
- Timestamp:
- Aug 14, 2005, 11:44:49 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/gui/gui_keys.cc
r4836 r5020 1 /* 1 /* 2 2 orxonox - the future of 3D-vertical-scrollers 3 3 … … 16 16 You should have received a copy of the GNU General Public License 17 17 along with this program; if not, write to the Free Software Foundation, 18 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 19 19 20 20 … … 38 38 { 39 39 Box* keysBox0; //!< The Frame that holds the keyOptions. 40 40 41 41 // keysFrame->setGroupName("Keyboard"); 42 42 keysBox0 = new Box('v'); … … 47 47 keysBox1 = new Box('h'); 48 48 { 49 50 51 52 53 54 55 56 49 PlayerKeys* player1; //!< The first Player's keys. 50 PlayerKeys* player2; //!< The seconds Player's keys. 51 52 player1 = new PlayerKeys(CONFIG_SECTION_PLAYER "1"); 53 player2 = new PlayerKeys(CONFIG_SECTION_PLAYER "2"); 54 55 keysBox1->fill(player1->getOpenButton()); 56 keysBox1->fill(player2->getOpenButton()); 57 57 } 58 58 keysBox0->fill(keysBox1); … … 63 63 keysFrame->fill(keysBox0); 64 64 } 65 65 66 66 // setting up the Input Windows that receives keystrokes. 67 67 this->inputWindow = new Window("inputWindow"); … … 72 72 #endif /* HAVE_GTK2 */ 73 73 this->inputWindow->fill(inputButton); 74 74 75 75 this->setMainWidget(keysFrame); 76 76 } … … 112 112 pKeysBox = new Box('v'); 113 113 { 114 115 116 117 118 119 120 121 122 123 124 125 #ifdef HAVE_GTK2 126 127 #endif /* HAVE_GTK2 */ 128 129 114 Button* closeButton; //!< The CloseButton for this key-settings. 115 116 pKeysBox->setGroupName(player); 117 pKeysBox->fill(addKey(CONFIG_NAME_PLAYER_UP, "UP")); 118 pKeysBox->fill(addKey(CONFIG_NAME_PLAYER_DOWN, "DOWN")); 119 pKeysBox->fill(addKey(CONFIG_NAME_PLAYER_LEFT, "LEFT")); 120 pKeysBox->fill(addKey(CONFIG_NAME_PLAYER_RIGHT, "RIGHT")); 121 pKeysBox->fill(addKey(CONFIG_NAME_PLAYER_FIRE, "SPACE")); 122 pKeysBox->fill(addKey(CONFIG_NAME_PLAYER_NEXT_WEAPON, "m")); 123 pKeysBox->fill(addKey(CONFIG_NAME_PLAYER_PREV_WEAPON, "n")); 124 closeButton = new Button("close"); 125 #ifdef HAVE_GTK2 126 closeButton->connectSignal("button_press_event", pKeyWindow, Window::windowClose); 127 #endif /* HAVE_GTK2 */ 128 129 pKeysBox->fill(closeButton); 130 130 } 131 131 pKeyFrame->fill(pKeysBox); … … 139 139 pKeyWindow->connectSignal("delete_event", pKeyWindow, Window::windowClose); 140 140 #endif /* HAVE_GTK2 */ 141 141 142 142 this->openButton = new Button(player); 143 143 #ifdef HAVE_GTK2 … … 174 174 keysBox = new Box('v'); 175 175 { 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 #ifdef HAVE_GTK2 192 193 #endif /* HAVE_GTK2 */ 194 195 176 Button* closeButton; //!< The CloseButton for this key-settings. 177 178 keysBox->setGroupName(CONFIG_SECTION_MISC_KEYS); 179 keysBox->fill(addKey(CONFIG_NAME_QUIT , "ESCAPE")); 180 keysBox->fill(addKey(CONFIG_NAME_PAUSE, "PAUSE")); 181 keysBox->fill(addKey(CONFIG_NAME_NEXT_WORLD, "x")); 182 keysBox->fill(addKey(CONFIG_NAME_PREV_WORLD, "z")); 183 keysBox->fill(addKey(CONFIG_NAME_VIEW0, "1")); 184 keysBox->fill(addKey(CONFIG_NAME_VIEW1, "2")); 185 keysBox->fill(addKey(CONFIG_NAME_VIEW2, "3")); 186 keysBox->fill(addKey(CONFIG_NAME_VIEW3, "4")); 187 keysBox->fill(addKey(CONFIG_NAME_VIEW4, "5")); 188 keysBox->fill(addKey(CONFIG_NAME_VIEW5, "6")); 189 190 closeButton = new Button("close"); 191 #ifdef HAVE_GTK2 192 closeButton->connectSignal("button_press_event", keyWindow, Window::windowClose); 193 #endif /* HAVE_GTK2 */ 194 195 keysBox->fill(closeButton); 196 196 } 197 197 keyFrame->fill(keysBox); … … 204 204 keyWindow->connectSignal("delete_event", keyWindow, Window::windowClose); 205 205 #endif /* HAVE_GTK2 */ 206 206 207 207 this->openButton = new Button("misc"); 208 208 #ifdef HAVE_GTK2 … … 254 254 GuiKeys::inputWindow->open(); 255 255 } 256 256 257 257 /** 258 258 * Function which gets keystrokes … … 281 281 strcpy(title, "RIGHT"); 282 282 break; 283 283 284 284 case GDK_space: 285 285 strcpy(title, "SPACE"); 286 286 break; 287 287 288 288 case GDK_Return: 289 289 strcpy(title, "RETURN"); 290 290 break; 291 291 292 292 // Special Keys // 293 293 case GDK_BackSpace: … … 361 361 strcpy(title, "INSERT"); 362 362 break; 363 363 364 364 case GDK_Escape: 365 365 strcpy(title, "ESCAPE"); … … 423 423 strcpy(title, "F12"); 424 424 break; 425 426 425 426 427 427 default: 428 428 char* tmp;
Note: See TracChangeset
for help on using the changeset viewer.