      program test

      character c*1
      logical ktest
      c=' '
      call open_inkey
      do while (c.ne.'a')
        call wait_key
        call inkey(c,ktest)
        print *,'"',c,'"',ktest
        call inkey(c,ktest)
        print *,'"',c,'"',ktest
        call inkey(c,ktest)
        print *,'"',c,'"',ktest
        call inkey(c,ktest)
        print *,'"',c,'"',ktest
      enddo
      call close_inkey

      end
