Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2738 in orxonox.OLD for orxonox/trunk/gui


Ignore:
Timestamp:
Nov 6, 2004, 4:34:25 AM (20 years ago)
Author:
bensch
Message:

orxonox/trunk/gui: better order of key-options

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/gui/orxonox_gui_keys.cc

    r2737 r2738  
    7676{
    7777  keyBox[key] = new Box();
     78  keyLabel[key] = new Label (name);
    7879  keyButton[key] = new Button(name);
    79   keyLabel[key] = new Label ("test");
    8080 
    81   keyButton[key]->connectSignal("key_press_event", keyLabel[key], key_cb);
     81  keyButton[key]->connectSignal("key_press_event", keyButton[key], key_cb);
    8282 
     83  keyBox[key]->fill(keyLabel[key]);
    8384  keyBox[key]->fill(keyButton[key]);
    84   keyBox[key]->fill(keyLabel[key]);
    8585  return keyBox[key];
    8686}
     
    127127gint Player::key_cb(GtkWidget* w, GdkEventKey* event, void* widget)
    128128{
    129   Label* label = static_cast<Label*>(widget);
     129  Button* button = static_cast<Button*>(widget);
    130130
    131131  switch(event->keyval) {
    132132  case GDK_Up:
    133133    printf("Up arrow key!\n");
    134     label->setText("up");
     134    button->setTitle("up");
    135135    break;
    136136  case GDK_Down:
    137137    printf("Down arrow key!\n");
    138     label->setText("down");
     138    button->setTitle("down");
    139139    break;
    140140  case GDK_Left:
    141141    printf("Left arrow key!\n");
    142     label->setText("left");
     142    button->setTitle("left");
    143143    break;
    144144  case GDK_Right:
    145145    printf("Right arrow key!\n");
    146     label->setText("right");
     146    button->setTitle("right");
    147147    break;
    148148
    149149  case GDK_space:
    150150    printf("Space Pressed.\n");
    151     label->setText("space");
     151    button->setTitle("space");
    152152    break;
    153153
    154154  case 65293:
    155155    printf("Enter Pressed\n");
    156     label->setText("enter");
     156    button->setTitle("enter");
    157157    break;
    158158
     
    160160  case GDK_Shift_L:
    161161    printf("Left Shift!\n");
    162     label->setText("l_shift");
     162    button->setTitle("l_shift");
    163163    break;
    164164  case GDK_Shift_R:
    165165    printf("Right Shift!\n");
    166     label->setText("r_shift");
     166    button->setTitle("r_shift");
    167167    break;
    168168  case GDK_Control_L:
    169169    printf("Left Control!\n");
    170     label->setText("l_ctrl");
     170    button->setTitle("l_ctrl");
    171171    break;
    172172  case GDK_Control_R:
    173173    printf("Right Control!\n");
    174     label->setText("r_ctrl");
     174    button->setTitle("r_ctrl");
    175175    break;
    176176  case GDK_Alt_L:
    177177    printf("Left Alt!\n");
    178     label->setText("l_alt");
     178    button->setTitle("l_alt");
    179179    break;
    180180  case GDK_Alt_R:
    181181    printf("Rigth Alt!\n");
    182     label->setText("r_alt");
     182    button->setTitle("r_alt");
    183183    break;
    184184    // FXX KEYS //
    185185  case GDK_F1:
    186186    printf("F1!\n");
    187     label->setText("f1");
     187    button->setTitle("f1");
    188188    break;
    189189  case GDK_F2:
    190190    printf("F2!\n");
    191     label->setText("f2");
     191    button->setTitle("f2");
    192192    break;
    193193  case GDK_F3:
    194194    printf("F3!\n");
    195     label->setText("f3");
     195    button->setTitle("f3");
    196196    break;
    197197  case GDK_F4:
    198198    printf("F4!\n");
    199     label->setText("f4");
     199    button->setTitle("f4");
    200200    break;
    201201  case GDK_F5:
    202202    printf("F5!\n");
    203     label->setText("f5");
     203    button->setTitle("f5");
    204204    break;
    205205  case GDK_F6:
    206206    printf("F6!\n");
    207     label->setText("f6");
     207    button->setTitle("f6");
    208208    break;
    209209  case GDK_F7:
    210210    printf("F7!\n");
    211     label->setText("f7");
     211    button->setTitle("f7");
    212212    break;
    213213  case GDK_F8:
    214214    printf("F8!\n");
    215     label->setText("f8");
     215    button->setTitle("f8");
    216216    break;
    217217  case GDK_F9:
    218218    printf("F9\n");
    219     label->setText("f9");
     219    button->setTitle("f9");
    220220    break;
    221221  case GDK_F10:
    222222    printf("F10!\n");
    223     label->setText("f10");
     223    button->setTitle("f10");
    224224    break;
    225225  case GDK_F11:
    226226    printf("F11!\n");
    227     label->setText("f11");
     227    button->setTitle("f11");
    228228    break;
    229229  case GDK_F12:
    230230    printf("F12!\n");
    231     label->setText("f12");
     231    button->setTitle("f12");
    232232    break;
    233233
     
    237237    sprintf(tmp, "%c", event->keyval);
    238238    printf ("other key %s \n", tmp);
    239     label->setText(tmp);
     239    button->setTitle(tmp);
    240240    break;
    241241  }
Note: See TracChangeset for help on using the changeset viewer.