In PTC, you could use TCHST.
IF TCHST==1 THEN (Whatever you want here)But since SmileBASIC removed everything I know, including TCHST, I don't know what to do. And by the way, I already know how to hide the keyboard. You just put
XSCREEN 2.