arrow keys?

Does anyone know the ASCII value for the arrow keys, and how one could go
about determining if they have been depressed because I believe the arrow
keys are denoted by two bytes so would do a strcmp on both bytes or would
just just check each byte indvidually by using straight up ==?

Thank you,
Kevin Weisser


You can use either the ncurses library or get the codes manually by
putting terminal in raw mode and using getchar() to poll for keys. The
latter being less portable and more tricky. You can get lot of ncurses
docs on internet.

Keep Smiling

  • mritunjai