home *** CD-ROM | disk | FTP | other *** search
/ Enigma Amiga Life 113 / EnigmaAmiga113CD.iso / software / sviluppo / easygui_os12 / examples / easyplugins / rawkey_os12_demo.e < prev    next >
Encoding:
Text File  |  2000-06-06  |  939 b   |  50 lines

  1. /*
  2.  
  3.   $VER: RawKey Demo V1.00 - By Fabio Rotondo
  4.  
  5.         Part of the EasyPLUGINs package
  6.  
  7.   V1.00 - Inital Release
  8.  
  9.  
  10. */
  11.  
  12. OPT PREPROCESS
  13.  
  14. -> RST: Added conditional EASY_OS12 support
  15. #define EASY_OS12
  16.  
  17. #ifdef EASY_OS12
  18.   MODULE 'tools/easygui_os12', 'easyplugins/rawkey_os12'
  19. #endif
  20. #ifndef EASY_OS12
  21.   OPT OSVERSION=37
  22.   MODULE 'tools/easygui', 'easyplugins/rawkey'
  23. #endif
  24.  
  25. MODULE 'tools/exceptions'
  26.  
  27. PROC main() HANDLE
  28.   DEF n=NIL:PTR TO rawkey
  29.  
  30.   NEW n.init()
  31.  
  32.   n.setattrs([PLA_KEY_UP, {up}, PLA_KEY_CONTROL, {control}, NIL, NIL])
  33.  
  34.   easyguiA('Test RawKey', [ROWS,
  35.                             [TEXT, 'Press Cursor Up OR CTRL keys', NIL, TRUE, 10],
  36.                             [SBUTTON,1, 'Quit!'],
  37.                             [PLUGIN, 0, n]
  38.                           ]
  39.           )
  40.  
  41. EXCEPT DO
  42.   report_exception()
  43.   END n
  44. ENDPROC
  45.  
  46. PROC up() IS WriteF('You pressed Cursor Up!\n')
  47.  
  48. PROC control() IS WriteF('You Pressed Control Key!!\n')
  49.  
  50.