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 - initsetkey() initialize associating functions with key presses http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 initsetkey()        Initialize associating functions with key presses
------------------------------------------------------------------------------
 Declaration
   io.hdr

 Syntax
   proc initsetkey extern

 Arguments
   None.

 Return
   None.

 Description
   The initsetkey() function initializes the internal table for associating
   functions to key presses. All existing key definitions are cleared
   when this function is called. The initsetkey() function must be
   called prior to defining any set keys.

 Example
   #define EXAMPLE_IO
   #include example.hdr

   proc QuitFunc static
   quit
   endproc
   
   proc PrintFunc static
   ? "hello"
   endproc
   
   proc Test_initsetkey
   ? "Press F1 to test, Esc to finish"
   initsetkey()                       // initialize set key system
   definesetkey( K_F1, &PrintFunc )   // install PrintFunc()
   definesetkey( K_ESC, &QuitFunc )   // install QuitFunc()
   dispatchkey()                      // start key processing
   do while .t.                       // get key presses
      inkey()
   enddo
   endproc

   proc main
   Test_initsetkey()
   endproc

See Also: definesetkey() dispatchkey()

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