Every key except for HOME and END work for me. However...
Doing some tests, curses.h's KEY_HOME and KEY_END don't match up with the value that is being read. On Matrix, pressing the HOME key gives me a value of 362, and END gives me 385. However, outputting curses.h's KEY_HOME and KEY_END macros on Matrix gives me 262 and 360. This makes the getKey() function register the HOME/END keypresses as UNKNOWN. I don't know why there's a mismatch, but a messy hack you can try is to go to the LINUX/UNIX platform getKey() function and add the specific numbers to the switch statement, for example:
case 362: key = HOME; break; case 385: key = END; break;
If other keys don't work for you, check if the value of your key press matches up with what is defined in curses.h.
Now, if only the F1-F12 keys on Matrix didn't insert some garbage data...
Anyway, after I talk with some of my friends today, apparently, you need to download putty instead of SSH. Here is the link for the download page + instruction. https://cs.senecac.on.ca/~chris.szalwinski/resources/putty.html
I was using putty since the beginning but I didn't have the Terminal Type string set to "puttyxterm". Changing this line fixes both my Home/End keys and F1-F12 don't input garbage data.
Every key except for HOME and END work for me. However...
ReplyDeleteDoing some tests, curses.h's KEY_HOME and KEY_END don't match up with the value that is being read. On Matrix, pressing the HOME key gives me a value of 362, and END gives me 385. However, outputting curses.h's KEY_HOME and KEY_END macros on Matrix gives me 262 and 360. This makes the getKey() function register the HOME/END keypresses as UNKNOWN. I don't know why there's a mismatch, but a messy hack you can try is to go to the LINUX/UNIX platform getKey() function and add the specific numbers to the switch statement, for example:
case 362: key = HOME; break;
case 385: key = END; break;
If other keys don't work for you, check if the value of your key press matches up with what is defined in curses.h.
Now, if only the F1-F12 keys on Matrix didn't insert some garbage data...
I tried to modify the getkey() in LINUX/UNIX platform, it didnt help.
ReplyDeleteDid you get it to work?
I tried to use ::getch(); to see what the key value on matrix, all I get for F1-F12 and other keys are 27.
ReplyDeleteTo output values, I modified the default case within getKey() to output what the current key value is before it is assigned to UNKNOWN.
ReplyDeleteAnyway, after I talk with some of my friends today, apparently, you need to download putty instead of SSH. Here is the link for the download page + instruction.
ReplyDeletehttps://cs.senecac.on.ca/~chris.szalwinski/resources/putty.html
All the keys are working now with PUtty.
I was using putty since the beginning but I didn't have the Terminal Type string set to "puttyxterm". Changing this line fixes both my Home/End keys and F1-F12 don't input garbage data.
ReplyDeleteThanks!