Please note that joystick will work too if you use theses primitives because telemon traps joystick too.

Waiting a key

#include "../orix/src/include/telemon.h"
#include "../orix/src/include/macro.h"
; set the header
loop
  BRK_TELEMON(XRD0)
  bcc key_pressed
  jmp loop
key_pressed
  ; At this step A contains ASCII Key pressed

Trying to find key pressed

#include "../orix/src/include/telemon.h"
#include "../orix/src/include/macro.h"
; set the header
loop
  BRK_TELEMON(XRD0) ; Reads keyboard
  bcc key_pressed   ; waiting for a key pressed
  jmp loop          ; no key pressed, loop
key_pressed
  ; At this step A contains ASCII Key pressed
  cmp #$27          ; is it ESC
  bne not_esc       ; it's not key pressed