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 - getsetkey() return address of routine associated with a key http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 getsetkey()         Return address of routine associated with a key
------------------------------------------------------------------------------
 Declaration
   io.hdr

 Syntax
   func ulong getsetkey extern
   param value uint uSearchCode

 Arguments
   uSearchCode is the key whose associated function is to be
   retrieved.

 Return
   The address of the key press function.

 Description
   This function returns the address of the routine associated with the
   specified key, or 0 if there is no matching entry in the internal table.

 Example
   #define EXAMPLE_IO
   #include example.hdr

   proc HelpFunc static
   ? "help"
   endproc
   
   proc StatusHelp static
   if getsetkey( K_F1 )               // test if procedure is installed for F1
      ? "Press F1 for help"
   else
      ? "No help available"
   endif
   endproc
   
   proc Test_getsetkey
   initsetkey()                       // initialize set key system
   StatusHelp()
   definesetkey( K_F1, &HelpFunc )    // install HelpFunc()
   StatusHelp()
   dispatchkey()                      // start key processing
   wait                               // get key press
   endproc

   proc main
   Test_getsetkey()
   endproc

See Also: definesetkey() dispatchkey() initsetkey()

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