Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2021 03:59 AM
getch () function returns two keycodes for arrow keys. Arrow put to getch '\033'
and '[' and letter from A to D (up, down, right, left) so code will be something like:
if (getch() == '\033') {
getch(); // [ value
switch(getch())
{
case 'A':
// your code
case 'B':
// your code
case 'C':
//your code
case 'D':
//your code
}
}
My blog: https://databrickster.medium.com/