Changeset 2737 in orxonox.OLD for orxonox/trunk/gui
- Timestamp:
- Nov 6, 2004, 4:03:22 AM (20 years ago)
- Location:
- orxonox/trunk/gui
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/gui/orxonox_gui.cc
r2733 r2737 871 871 \param text The text to be inserted into the Label. 872 872 */ 873 void Label::setText (char 873 void Label::setText (char* text) 874 874 { 875 875 label = text; -
orxonox/trunk/gui/orxonox_gui.h
r2733 r2737 268 268 void init(void); 269 269 270 void setText (char 270 void setText (char* text); 271 271 char* getText (); 272 272 }; -
orxonox/trunk/gui/orxonox_gui_keys.cc
r2736 r2737 125 125 \returns Nothing 126 126 */ 127 gint key_cb(GtkWidget* w, GdkEventKey* event, void* Widget) 128 { 127 gint Player::key_cb(GtkWidget* w, GdkEventKey* event, void* widget) 128 { 129 Label* label = static_cast<Label*>(widget); 130 129 131 switch(event->keyval) { 130 131 132 case GDK_Up: 132 133 printf("Up arrow key!\n"); 133 static_cast<Label*>(Widget)->setText("up");134 label->setText("up"); 134 135 break; 135 136 case GDK_Down: 136 137 printf("Down arrow key!\n"); 138 label->setText("down"); 139 break; 140 case GDK_Left: 141 printf("Left arrow key!\n"); 142 label->setText("left"); 137 143 break; 138 144 case GDK_Right: 139 145 printf("Right arrow key!\n"); 140 break; 141 case GDK_Left: 142 printf("Left arrow key!\n"); 146 label->setText("right"); 143 147 break; 144 148 145 149 case GDK_space: 146 150 printf("Space Pressed.\n"); 151 label->setText("space"); 147 152 break; 148 153 149 154 case 65293: 150 155 printf("Enter Pressed\n"); 156 label->setText("enter"); 151 157 break; 152 158 … … 154 160 case GDK_Shift_L: 155 161 printf("Left Shift!\n"); 162 label->setText("l_shift"); 156 163 break; 157 164 case GDK_Shift_R: 158 165 printf("Right Shift!\n"); 166 label->setText("r_shift"); 159 167 break; 160 168 case GDK_Control_L: 161 169 printf("Left Control!\n"); 170 label->setText("l_ctrl"); 162 171 break; 163 172 case GDK_Control_R: 164 173 printf("Right Control!\n"); 174 label->setText("r_ctrl"); 165 175 break; 166 176 case GDK_Alt_L: 167 177 printf("Left Alt!\n"); 178 label->setText("l_alt"); 168 179 break; 169 180 case GDK_Alt_R: 170 181 printf("Rigth Alt!\n"); 182 label->setText("r_alt"); 171 183 break; 172 184 // FXX KEYS // 173 185 case GDK_F1: 174 186 printf("F1!\n"); 187 label->setText("f1"); 175 188 break; 176 189 case GDK_F2: 177 190 printf("F2!\n"); 191 label->setText("f2"); 178 192 break; 179 193 case GDK_F3: 180 194 printf("F3!\n"); 195 label->setText("f3"); 181 196 break; 182 197 case GDK_F4: 183 198 printf("F4!\n"); 199 label->setText("f4"); 184 200 break; 185 201 case GDK_F5: 186 202 printf("F5!\n"); 203 label->setText("f5"); 187 204 break; 188 205 case GDK_F6: 189 206 printf("F6!\n"); 207 label->setText("f6"); 190 208 break; 191 209 case GDK_F7: 192 210 printf("F7!\n"); 211 label->setText("f7"); 193 212 break; 194 213 case GDK_F8: 195 214 printf("F8!\n"); 215 label->setText("f8"); 196 216 break; 197 217 case GDK_F9: 198 218 printf("F9\n"); 219 label->setText("f9"); 199 220 break; 200 221 case GDK_F10: 201 222 printf("F10!\n"); 223 label->setText("f10"); 202 224 break; 203 225 case GDK_F11: 204 226 printf("F11!\n"); 227 label->setText("f11"); 205 228 break; 206 229 case GDK_F12: 207 230 printf("F12!\n"); 231 label->setText("f12"); 208 232 break; 209 233 210 234 211 235 default: 212 printf ("other key %c \n", event->keyval,event->keyval); 236 char* tmp; 237 sprintf(tmp, "%c", event->keyval); 238 printf ("other key %s \n", tmp); 239 label->setText(tmp); 213 240 break; 214 241 } -
orxonox/trunk/gui/orxonox_gui_keys.h
r2736 r2737 41 41 42 42 static gint openWindowEvent(GtkWidget* widget, GdkEvent* event, void* player); 43 static gint key_cb(GtkWidget* w, GdkEventKey* event, void* widget); 43 44 void setkey(KEYS key); 44 45 … … 64 65 65 66 66 gint key_cb(GtkWidget* w, GdkEventKey* event, void* Widget);67 67 68 68 #endif /* _ORXONOX_GUI_KEYS_H */
Note: See TracChangeset
for help on using the changeset viewer.