The code below doesn't support all keys, but it should print something if e.g. F12 is pressed and successfully processed by a keyboard driver, without an app having to be aware of F12 or F20. F12 should produce something; F20 may not:
/* Untested.CMD*/
CALL RxFuncAdd 'SysGetKey','RexxUtil','SysGetKey'
SAY 'Press 10 (recognized) keys now:'
SAY
DO i=1 TO 10
key=SysGetKey()
CALL CharOut '','Key' Format (i,2,0)||':'
DO j=1 TO Length(key)
CALL CharOut '',' '||C2X(SubStr(key,j,1))
END j
SAY
END i
EXIT