8

I'm writing an application and I need to detect arrow keys inside it. C++ has the getch() function. We want to take the input and then add a check on ASCII values.

How can we detect input arrow keys? Thanks

simont
  • 68,704
  • 18
  • 117
  • 136
Zeeshan Chaudhry
  • 842
  • 2
  • 15
  • 31

1 Answers1

3

I have written a Java class RawConsoleInput that uses JNA to call operating system functions of Windows and Unix. It can be used to read the arrow keys, but the character codes are different on Windows and Unix.

Christian d'Heureuse
  • 5,090
  • 1
  • 32
  • 28