[UP]


Manual Reference Pages  - checkkey (3)

NAME

checkkey(3f) - [M_draw:INTERACTIVE] Returns zero if no key is pressed or ASCII ordinal (LICENSE:PD)

CONTENTS

Synopsis
Description
Example

SYNOPSIS

integer function checkkey()

DESCRIPTION

Returns zero if no key is pressed or the ASCII ordinal of the key that was pressed.

EXAMPLE

Sample program:

   program demo_checkkey
   use :: M_draw
   use :: M_time, only : system_sleep
   !! set up drawing environment
   call prefsize(600,600)
   call vinit(’ ’) ! start graphics using device $M_DRAW_DEVICE
   call ortho2(-300.0,300.0,-300.0,300.0)
   call textsize(500.0,500.0)
   call linewidth(130)
   call centertext(.true.)
   call color(D_BLACK)
   call clear()
   write(*,*)’press any character to see it displayed in the default font’
   write(*,*)’Enter "q" to quit’
   do
     ichar=checkkey()
     if(ichar.lt.0)then
        write(*,*)’this device does not support checkkey’
        exit
     elseif(ichar.ne.0)then
        call color(D_BLACK)
        call clear()
        call color(D_BLUE)
        call move2(0.0,0.0)
        call drawstr(char(ichar))
     endif
     call system_sleep(0.5)
     if(char(ichar).eq.’q’)then
        write(*,*)’press any key to exit’
        ichar=getkey()
        exit
     endif
   enddo
   call vexit()
   end program demo_checkkey


checkkey (3) March 11, 2021
Generated by manServer 1.08 from 62cc1ed8-04a0-46ce-a8e2-92e9f4a6eeda using man macros.