Changeset 2738 in orxonox.OLD for orxonox/trunk/gui
- Timestamp:
- Nov 6, 2004, 4:34:25 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/gui/orxonox_gui_keys.cc
r2737 r2738 76 76 { 77 77 keyBox[key] = new Box(); 78 keyLabel[key] = new Label (name); 78 79 keyButton[key] = new Button(name); 79 keyLabel[key] = new Label ("test");80 80 81 keyButton[key]->connectSignal("key_press_event", key Label[key], key_cb);81 keyButton[key]->connectSignal("key_press_event", keyButton[key], key_cb); 82 82 83 keyBox[key]->fill(keyLabel[key]); 83 84 keyBox[key]->fill(keyButton[key]); 84 keyBox[key]->fill(keyLabel[key]);85 85 return keyBox[key]; 86 86 } … … 127 127 gint Player::key_cb(GtkWidget* w, GdkEventKey* event, void* widget) 128 128 { 129 Label* label = static_cast<Label*>(widget);129 Button* button = static_cast<Button*>(widget); 130 130 131 131 switch(event->keyval) { 132 132 case GDK_Up: 133 133 printf("Up arrow key!\n"); 134 label->setText("up");134 button->setTitle("up"); 135 135 break; 136 136 case GDK_Down: 137 137 printf("Down arrow key!\n"); 138 label->setText("down");138 button->setTitle("down"); 139 139 break; 140 140 case GDK_Left: 141 141 printf("Left arrow key!\n"); 142 label->setText("left");142 button->setTitle("left"); 143 143 break; 144 144 case GDK_Right: 145 145 printf("Right arrow key!\n"); 146 label->setText("right");146 button->setTitle("right"); 147 147 break; 148 148 149 149 case GDK_space: 150 150 printf("Space Pressed.\n"); 151 label->setText("space");151 button->setTitle("space"); 152 152 break; 153 153 154 154 case 65293: 155 155 printf("Enter Pressed\n"); 156 label->setText("enter");156 button->setTitle("enter"); 157 157 break; 158 158 … … 160 160 case GDK_Shift_L: 161 161 printf("Left Shift!\n"); 162 label->setText("l_shift");162 button->setTitle("l_shift"); 163 163 break; 164 164 case GDK_Shift_R: 165 165 printf("Right Shift!\n"); 166 label->setText("r_shift");166 button->setTitle("r_shift"); 167 167 break; 168 168 case GDK_Control_L: 169 169 printf("Left Control!\n"); 170 label->setText("l_ctrl");170 button->setTitle("l_ctrl"); 171 171 break; 172 172 case GDK_Control_R: 173 173 printf("Right Control!\n"); 174 label->setText("r_ctrl");174 button->setTitle("r_ctrl"); 175 175 break; 176 176 case GDK_Alt_L: 177 177 printf("Left Alt!\n"); 178 label->setText("l_alt");178 button->setTitle("l_alt"); 179 179 break; 180 180 case GDK_Alt_R: 181 181 printf("Rigth Alt!\n"); 182 label->setText("r_alt");182 button->setTitle("r_alt"); 183 183 break; 184 184 // FXX KEYS // 185 185 case GDK_F1: 186 186 printf("F1!\n"); 187 label->setText("f1");187 button->setTitle("f1"); 188 188 break; 189 189 case GDK_F2: 190 190 printf("F2!\n"); 191 label->setText("f2");191 button->setTitle("f2"); 192 192 break; 193 193 case GDK_F3: 194 194 printf("F3!\n"); 195 label->setText("f3");195 button->setTitle("f3"); 196 196 break; 197 197 case GDK_F4: 198 198 printf("F4!\n"); 199 label->setText("f4");199 button->setTitle("f4"); 200 200 break; 201 201 case GDK_F5: 202 202 printf("F5!\n"); 203 label->setText("f5");203 button->setTitle("f5"); 204 204 break; 205 205 case GDK_F6: 206 206 printf("F6!\n"); 207 label->setText("f6");207 button->setTitle("f6"); 208 208 break; 209 209 case GDK_F7: 210 210 printf("F7!\n"); 211 label->setText("f7");211 button->setTitle("f7"); 212 212 break; 213 213 case GDK_F8: 214 214 printf("F8!\n"); 215 label->setText("f8");215 button->setTitle("f8"); 216 216 break; 217 217 case GDK_F9: 218 218 printf("F9\n"); 219 label->setText("f9");219 button->setTitle("f9"); 220 220 break; 221 221 case GDK_F10: 222 222 printf("F10!\n"); 223 label->setText("f10");223 button->setTitle("f10"); 224 224 break; 225 225 case GDK_F11: 226 226 printf("F11!\n"); 227 label->setText("f11");227 button->setTitle("f11"); 228 228 break; 229 229 case GDK_F12: 230 230 printf("F12!\n"); 231 label->setText("f12");231 button->setTitle("f12"); 232 232 break; 233 233 … … 237 237 sprintf(tmp, "%c", event->keyval); 238 238 printf ("other key %s \n", tmp); 239 label->setText(tmp);239 button->setTitle(tmp); 240 240 break; 241 241 }
Note: See TracChangeset
for help on using the changeset viewer.