Changeset 07b7c48 in mainline for uspace/dist/src/c/demos/tetris/scores.c
- Timestamp:
- 2013-04-12T09:01:10Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 902f0906
- Parents:
- bc4bf97
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/dist/src/c/demos/tetris/scores.c
rbc4bf97 r07b7c48 125 125 int j; 126 126 size_t off; 127 kbd_event_t ev; 127 cons_event_t ev; 128 kbd_event_t *kev; 128 129 129 130 clear_screen(); … … 141 142 while (1) { 142 143 console_flush(console); 143 if (!console_get_ kbd_event(console, &ev))144 if (!console_get_event(console, &ev)) 144 145 exit(1); 145 146 146 if (ev.type == KEY_RELEASE)147 if (ev.type != CEV_KEY || ev.ev.key.type == KEY_RELEASE) 147 148 continue; 148 149 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) 150 153 break; 151 154 152 if ( ev.key == KC_BACKSPACE) {155 if (kev->key == KC_BACKSPACE) { 153 156 if (i > 0) { 154 157 wchar_t uc; … … 166 169 scores[NUMSPOTS - 1].hs_name[off] = '\0'; 167 170 } 168 } else if ( ev.c != '\0') {171 } else if (kev->c != '\0') { 169 172 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, 171 174 &off, STR_BOUNDS(MAXLOGNAME) + 1) == EOK) { 172 175 ++i;
Note:
See TracChangeset
for help on using the changeset viewer.