[UP]


Manual Reference Pages  - getkey (3)

NAME

getkey(3f) - [M_draw:INTERACTIVE] Return ASCII ordinal of next key typed (LICENSE:PD)

CONTENTS

Synopsis
Description
Example

SYNOPSIS

integer function getkey()

DESCRIPTION

Return the ASCII ordinal of the next key typed at the keyboard. If the device has no keyboard getkey(3) returns -1.

EXAMPLE

Sample program:

     program demo_getkey
     use :: M_draw
     !! set up drawing environment
     call prefsize(600,600)
     call voutput(’+’)
     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=getkey()
       if(ichar.lt.0)then
          write(*,*)’this device does not support getkey’
          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
       if(char(ichar).eq.’q’)then
          write(*,*)’press any key to exit’
          ichar=getkey()
          exit
       endif
     enddo
     call vexit()
     end program demo_getkey


getkey (3) March 11, 2021
Generated by manServer 1.08 from 3cfd88e8-e989-41f8-a1d6-5a8d4b3e82d6 using man macros.