Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Force 4.0 Reference - definecursor() define custom cursor shape http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 definecursor()      Define custom cursor shape
------------------------------------------------------------------------------
 Declaration
   io.hdr

 Syntax
   proc definecursor extern
   param value uint uCursorBlock, ;
         value uint uCursorLine

 Arguments
   uCursorBlock defines the block cursor's shape.
   uCursorLine defines the line cursor's shape.

 Return
   None.

 Description
   This procedure allows to define customized shapes for the cursor in
   overwrite and insert mode.

   Both parameters must be composed by using the following formula:

   uScanStart * 256 + uScanEnd

   Depending on the current video adapter card, allowed values for
   uCursorBlock and uCursorLine are:

   CGA, EGA, VGA: 0... 7
   MDA:           0...13

 Example
   #define EXAMPLE_IO
   #include example.hdr

   proc Test_definecursor
   vardef
      uint uKey
   enddef
   ? "Input text. The cursor shape is automatically set during input"
   ? "according to the current insert state. Press Escape to exit."
   ?
   // Define a full-block cursor for insert, and an underline cursor for
   // overwrite (best viewed in VGA 25 lines mode).
   definecursor( 0x0f01, 0x0f0e )
   do while .t.
      updatecursor()
      uKey := getkey()
      if uKey == K_ESC
         exit
      endif
      if uKey >= ' ' .and. uKey <= 'z'
         ?? chr( uKey )
      endif
   enddo
   endproc

   proc main
   Test_definecursor()
   endproc

See Also: cursor() cursortype() iscursor()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson