See visualSelect menu system for a full implementation of "getch" capturing function keys, arrow keys, and other cursor movement keys.
getch()
{
IFS='' read -r -- TMP_GETCH
STATUS="${?}"
# ${CMD_ECHO} "${TMP_GETCH}"
eval \${CMD_ECHO} ${OPT_ECHO} \"\${TMP_GETCH}\"
return ${STATUS}
}