Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Function used to retrieve user keyboard input.
- * @return -1 if we don't use that specific key, so we can ignore it.
- * ASCII value if simple key is pressed or 255+ASCII value if
- * extended key captured.
- */
- int get_keypress() {
- int x, y;
- x = getch();
- switch(x) {
- // check if we've captured an extended key
- case 224: {
- y = getch();
- return 255+y;
- } break;
- default: return x;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement