home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 October: Mac OS SDK / Dev.CD Oct 00 SDK1.toast / Development Kits / Mac OS / GameSprocket SDKs / InputSprocket SDK / Interfaces&Libraries / InputSprocket.r < prev    next >
Encoding:
Text File  |  1999-12-07  |  6.4 KB  |  180 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        InputSprocket.r
  3.  
  4.      Contains:    Games Sprockets: InputSprocket interfaaces
  5.  
  6.      Version:    Technology:    InputSprocket 1.7
  7.                  Release:    InputSprocket SDK, Use 3.2 Universal Headers
  8.  
  9.      Copyright:    © 1996-1999 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17.  
  18. #ifndef __INPUTSPROCKET_R__
  19. #define __INPUTSPROCKET_R__
  20.  
  21. #ifndef __CONDITIONALMACROS_R__
  22. #include "ConditionalMacros.r"
  23. #endif
  24.  
  25. #define kISpDeviceClass_SpeechRecognition  'talk'
  26. #define kISpDeviceClass_Mouse             'mous'
  27. #define kISpDeviceClass_Keyboard         'keyd'
  28. #define kISpDeviceClass_Joystick         'joys'
  29. #define kISpDeviceClass_Gamepad         'gmpd'
  30. #define kISpDeviceClass_Wheel             'whel'
  31. #define kISpDeviceClass_Pedals             'pedl'
  32. #define kISpDeviceClass_Levers             'levr'
  33. #define kISpDeviceClass_Tickle             'tckl'                /*  a device of this class requires ISpTickle */
  34. #define kISpDeviceClass_Unknown         '????'
  35.  
  36. #define kISpKeyboardID_Apple             'appl'                /*  currently this applies to _all_ keyboards */
  37. #if CALL_NOT_IN_CARBON
  38.  
  39. /*    Rez interfaces for InputSprocket.
  40.  *
  41.  *    Specifically, this file is intended to make the development process 
  42.  *    easier. Now the default keyboard settings can be specified in a rez
  43.  *    file which should be easy to modify when new needs are added and/or
  44.  *    the order of needs are changed.
  45.  *    
  46.  *    Note: When the ISp keyboard driver undergoes a major revision, it will
  47.  *    almost certainly use a newer format to store it's settings. It will,
  48.  *    however, continue to be able to read this format, but it will no longer
  49.  *    write it.
  50.  *    
  51.  *    Currently, only a template is provided for keyboard settings, since
  52.  *    keyboard is the one that is the most difficult to recreate, and since
  53.  *    each driver uses a private format for its settings. For all other 
  54.  *    devices, you should continue to include the 'tset' resources copied
  55.  *    from your prefs file. Make sure you include references to them in
  56.  *     the set list resource ('setl').
  57.  *
  58.  *    The 'setl' resource contains a length value of the 'tset' is refers to.
  59.  *    This obviously won't do for use in Rez, so ISp 1.3 and later has been
  60.  *    modified to allow a zero value (in which case, it cannot check to
  61.  *    verify that it is the correct length.) Because of this change:
  62.  *    applications that use this template will _require_ InputSprocket 1.3
  63.  *    or later... you have been warned.
  64.  *
  65.  */
  66.  
  67.  
  68. /*----------------------------isap • InputSprocket application resource ----------------*/
  69. type 'isap'
  70. {
  71.         flags:
  72.             fill bit[24];
  73.             fill bit[6];
  74.             boolean        doesNotCallISpInit, callsISpInit;                
  75.             boolean        notUseInputSprocket, usesInputSprocket;
  76.  
  77.         fill long[3];
  78. };
  79.  
  80.  
  81. /*----------------------------setl • a set list resource -------------------------------*/
  82. type 'setl'
  83. {
  84.     unsigned longint    currentVersion = 2;
  85.     
  86.     unsigned longint = $$Countof(Needs);
  87.     array Needs
  88.     {
  89.         pstring[63];                                        /* the name of the set */
  90.         unsigned longint length;                            /* the length of the set */
  91.         literal longint    deviceClass;                        /* the device class for the set */
  92.         literal longint    deviceIdentifier;                    /* the device identifier for the set */
  93.     
  94.         flags:
  95.             fill bit[24];
  96.             fill bit[3];
  97.             fill bit;                                        /* set from custom (not supported) */
  98.             fill bit;                                        /* set from driver (not supported) */
  99.             boolean        notApplSet, isApplSet;                /* true if the set is from application and not a default */
  100.             boolean        notDefaultSet, isDefaultSet;        /* true if this is the default for its device */
  101.             fill bit;
  102.         
  103.         fill long[3];
  104.         integer    resourceID;                                    /* the resource ID of the set */
  105.         fill word;
  106.     };
  107. };
  108.  
  109.  
  110.  
  111. /*----------------------------tset • a saved set ---------------------------------------*/
  112. /*----------------------------only valid for keyboard tsets ----------------------------*/
  113. type 'tset'
  114. {
  115.     unsigned longint    supportedVersion = 1;
  116.     
  117.     unsigned longint = $$Countof(ExpandedNeeds);
  118.     wide array ExpandedNeeds
  119.     {
  120. keyCode:
  121.         unsigned hex integer noKey = 0x8000,                /* virtual key code        */
  122.             /* NOTE: names of keys refer to the Apple Extended English Keyboard         */
  123.             /* Non-english keyboards have slightly different keycodes                */
  124.             /* In all cases, the actual virtual key code is stored for that device    */
  125.             tildeKey = 0x0032, n1Key = 0x0012, n2Key = 0x0013, n3Key = 0x0014, n4Key = 0x0015,
  126.             n5Key = 0x0017, n6Key = 0x0016, n7Key = 0x001A, n8Key = 0x001C, n9Key = 0x0019,
  127.             n0Key = 0x001D, minusKey = 0x001B, plusKey = 0x0018, deleteKey = 0x0033,
  128.             
  129.             tabKey = 0x0030, qKey = 0x000c, wKey = 0x000D, eKey = 0x000E, rKey = 0x000F, 
  130.             tKey = 0x0011, yKey = 0x0010, uKey = 0x0020, iKey = 0x0022, oKey = 0x001F,
  131.             pKey = 0x0023, lBraceKey = 0x0021, rBraceKey = 0x001E, backslashKey = 0x002A,
  132.             
  133.             capsKey = 0x0039, aKey = 0x0000, sKey = 0x0001, dKey = 0x0002, fKey = 0x0003, 
  134.             gKey = 0x0005, hKey = 0x0004, jKey = 0x0026, kKey = 0x0028, lKey = 0x0025, 
  135.             colonKey = 0x0029, quoteKey = 0x0027, returnKey = 0x0024,
  136.             
  137.             shiftKey = 0x0038, zKey = 0x0006, xKey = 0x0007, cKey = 0x0008, vKey = 0x0009,
  138.             bKey = 0x0001,  nKey = 0x002D, mKey = 0x002E, lessThanKey = 0x002B, 
  139.             greaterThanKey = 0x002F, slashKey = 0x002C,
  140.             
  141.             controlKey = 0x003B, optionKey = 0x003A, commandKey = 0x0037, spaceKey = 0x0031,
  142.             rShiftKey = 0x003C, rOptionKey = 0x003D, rControlKey = 0x003E, 
  143.  
  144.         
  145.             escKey = 0x0035, f1Key = 0x007a, f2Key = 0x0078, f3Key = 0x0063, f4Key = 0x0076,
  146.             f5Key = 0x0060, f6Key = 0x0061, f7Key = 0x0062, f8Key = 0x0064,
  147.             f9Key = 0x0065, f10Key = 0x006D, f11Key = 0x0067, f12Key = 0x006F, 
  148.             f13Key = 0x0069, f14Key = 0x006B, f15Key = 0x0071,
  149.             
  150.             helpKey = 0x0072, homeKey = 0x0073, pageUpKey = 0x0074,
  151.             delKey = 0x0075, endKey = 0x0077, pageDownKey = 0x0079
  152.             
  153.             upKey = 0x007E, leftKey = 0x007B, downKey = 0x007D, rightKey = 0x007C,
  154.             
  155.             kdpClearKey = 0x0047, kpdEqualKey = 0x0051, kpdSlashKey = 0x004B, kpdStarKey = 0x0043,
  156.             kpd7Key = 0x0059, kpd8Key = 0x005B, kpd9Key = 0x005C, kpdMinusKey = 0x004E,
  157.             kpd4Key = 0x0056, kpd5Key = 0x0057, kpd6Key = 0x0058, kpdPlusKey = 0x0045,
  158.             kpd1Key = 0x0053, kpd2Key = 0x0054, kpd3Key = 0x0055, kpdEnterKey = 0x004C,
  159.             kpd0Key = 0x0052, kpdDecimalKey = 0x0041;
  160.         
  161.         /* Modifiers required to be down */
  162.         boolean        rControlOff, rControlOn;
  163.         boolean        rOptionOff, rOptionOn;
  164.         boolean        rShiftOff, rShiftOn;
  165.         boolean        controlOff, controlOn;
  166.         boolean        optionOff, optionOn;
  167.         fill bit;                                            /* capsLockOff, capsLockOn*/
  168.         boolean        shiftOff, shiftOn;
  169.         boolean        commandOff, commandOn;
  170.  
  171.         fill byte;                                            
  172.     };
  173. };
  174.  
  175. #endif  /* CALL_NOT_IN_CARBON */
  176.  
  177.  
  178. #endif /* __INPUTSPROCKET_R__ */
  179.  
  180.