- when 'h': x--;
- when 'j': y++;
- when 'k': y--;
- when 'l': x++;
- when 'H': x--; running = RUNLEN; ch = tolower(ch);
- when 'J': y++; running = RUNLEN/2; ch = tolower(ch);
- when 'K': y--; running = RUNLEN/2; ch = tolower(ch);
- when 'L': x++; running = RUNLEN; ch = tolower(ch);
- when '\f': setup(); return;
- when CNTRL('Z'): suspend(); return;
- when CNTRL('C'): crash(); return;
- when CNTRL('D'): crash(); return;
- otherwise: if (! running) alarm(1);
+#ifdef KEY_LEFT
+ case KEY_LEFT:
+#endif
+ case 'h':
+ x--; break;
+
+#ifdef KEY_DOWN
+ case KEY_DOWN:
+#endif
+ case 'j':
+ y++; break;
+
+#ifdef KEY_UP
+ case KEY_UP:
+#endif
+ case 'k':
+ y--; break;
+
+#ifdef KEY_RIGHT
+ case KEY_RIGHT:
+#endif
+ case 'l':
+ x++; break;
+
+ case 'H': x--; running = RUNLEN; ch = tolower(ch); break;
+ case 'J': y++; running = RUNLEN/2; ch = tolower(ch); break;
+ case 'K': y--; running = RUNLEN/2; ch = tolower(ch); break;
+ case 'L': x++; running = RUNLEN; ch = tolower(ch); break;
+ case '\f': setup(); return;
+
+ case ERR:
+ case CNTRL('C'):
+ case CNTRL('D'):
+ crash();
+ return;
+
+ default: if (! running) alarm(1);