Ignore:
Timestamp:
2013-04-15T06:30:48Z (11 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
077bc931
Parents:
166a1f57 (diff), c80be58 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge console mouse event support.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/dist/src/c/demos/tetris/scores.c

    r166a1f57 red267bc  
    125125        int j;
    126126        size_t off;
    127         kbd_event_t ev;
     127        cons_event_t ev;
     128        kbd_event_t *kev;
    128129       
    129130        clear_screen();
     
    141142        while (1) {
    142143                console_flush(console);
    143                 if (!console_get_kbd_event(console, &ev))
     144                if (!console_get_event(console, &ev))
    144145                        exit(1);
    145146               
    146                 if (ev.type == KEY_RELEASE)
     147                if (ev.type != CEV_KEY || ev.ev.key.type == KEY_RELEASE)
    147148                        continue;
    148149               
    149                 if (ev.key == KC_ENTER || ev.key == KC_NENTER)
     150                kev = &ev.ev.key;
     151               
     152                if (kev->key == KC_ENTER || kev->key == KC_NENTER)
    150153                        break;
    151154               
    152                 if (ev.key == KC_BACKSPACE) {
     155                if (kev->key == KC_BACKSPACE) {
    153156                        if (i > 0) {
    154157                                wchar_t uc;
     
    166169                                scores[NUMSPOTS - 1].hs_name[off] = '\0';
    167170                        }
    168                 } else if (ev.c != '\0') {
     171                } else if (kev->c != '\0') {
    169172                        if (i < (MAXLOGNAME - 1)) {
    170                                 if (chr_encode(ev.c, scores[NUMSPOTS - 1].hs_name,
     173                                if (chr_encode(kev->c, scores[NUMSPOTS - 1].hs_name,
    171174                                    &off, STR_BOUNDS(MAXLOGNAME) + 1) == EOK) {
    172175                                        ++i;
Note: See TracChangeset for help on using the changeset viewer.