I think this is what you want:
code:
"Hit 'P' to pause: "
$=sendkeys(" ")
get $key
while $key <> "P" AND $count < 5 ; ca. 5 seconds
sleep 1
$count = $count + 1
$=sendkeys(" ")
get $key
loop
IF $key="p"
Chr(13) "PAUSED - Press any key to continue: "
get $ ; Swallow Sent space
get $
ENDIF
Chr(13) " "

Note though, this is a real kludge - you should use "SetFocus()" before the "SendKeys", to ensure that the keys get sent to the right place.

Sendkeys is not required for the KiXtart 4.x versions, as we use KBHit() which allows us to "peek" at the keyboard buffer and see if there is something there.