Re: Capturing arrow keys and function keys during user input

  • From: "QuentinC" <webmaster@xxxxxxxxxxxx>
  • To: <programmingblind@xxxxxxxxxxxxx>
  • Date: Mon, 30 Aug 2010 11:23:28 +0200

for capturing arrow and function keys, as I remember, you have to use
getch() twice; I mean when you press a function key, the first getch()
returns a 0 and the second returns a code.

It actually depends on the key. For regular keys, it just returns the ascii code. for special keys such as F1, F2, arrows, home, end, etc. getch returns sometimes 0, sometimes 224, sometimes 255, and you get a really useful key code at second call.

__________
View the list's information and change your settings at //www.freelists.org/list/programmingblind

Other related posts: