Retired Document
Important: This sample code may not represent best practices for current development. The project may use deprecated symbols and illustrate technologies and techniques that are no longer recommended.
Resources/ISp_Sample.r
/* |
File: ISp_Sample.r |
Contains: xxx put contents here xxx |
Version: xxx put version here xxx |
Copyright: © 1999 by Apple Computer, Inc., all rights reserved. |
File Ownership: |
DRI: xxx put dri here xxx |
Other Contact: xxx put other contact here xxx |
Technology: xxx put technology here xxx |
Writers: |
(BWS) Brent Schorsch |
Change History (most recent first): |
<SP2> 7/1/99 BWS Fix typo |
<SP1> 7/1/99 BWS first checked in |
*/ |
#include "MacTypes.r" |
#include "InputSprocket.r" |
#Include "::Source:ISp_SampleResources.h" |
//#Include "AppShell.r" |
#define rNoModifiers rControlOff, rOptionOff, rShiftOff, \ |
controlOff, optionOff, shiftOff, commandOff |
resource 'STR#' (kSTRn_NeedNames, "Need Names") |
{ |
{ |
"Fire Weapon"; |
"Next Weapon"; |
"Previous Weapon"; |
"Roll"; |
"Pitch"; |
"Yaw"; |
"Throttle"; |
"Start/Pause Game"; |
"Quit"; |
"Use Machine Gun"; |
"Use Cannon"; |
"Use Laser"; |
"Use Missile"; |
"Use Precision Bomb"; |
"Use Cluster Bomb"; |
"Roll (Mouse)"; |
"Pitch (Mouse)"; |
"Yaw (Mouse)"; |
"Yaw Left"; |
"Center Yaw"; |
"Yaw Right"; |
"Min Throttle"; |
"Decrease Throttle"; |
"Increase Throttle"; |
"Max Throttle"; |
} |
}; |
resource 'STR#' (kSTRn_WeaponNames, "Weapon Names") |
{ |
{ |
"Machine Gun"; |
"Cannon"; |
"Laser"; |
"Missile"; |
"Precision Bomb"; |
"Cluster Bomb"; |
} |
}; |
/* the InputSprocket application resource tells utility programs how the */ |
/* application uses InputSprocket */ |
resource 'isap' (kisap_ISpSample) |
{ |
callsISpInit, |
usesInputSprocket |
}; |
/* the set list resource contains the list of all the saved sets for devices */ |
/* that are provided in the application's resource fork */ |
resource 'setl' (ksetl_ISpSample, "ISp_Sample sets") |
{ |
currentVersion, |
{ |
"Default (Keyboard)", 0, kISpDeviceClass_Keyboard, |
kISpKeyboardID_Apple, notApplSet, isDefaultSet, |
ktset_DefaultKeyboard, |
"All Left Hand", 0, kISpDeviceClass_Keyboard, |
kISpKeyboardID_Apple, isApplSet, notDefaultSet, |
ktset_LeftyKeyboard, |
"Default (mouse)", 0, kISpDeviceClass_Mouse, 'appl', |
notApplSet, isDefaultSet, ktset_DefaultMouse, |
"Yaw Mouse", 0, kISpDeviceClass_Mouse, 'appl', |
isApplSet, notDefaultSet, ktset_YawMouse, |
}; |
}; |
/* Default keyboard set */ |
resource 'tset' (ktset_DefaultKeyboard, "Default (Keyboard)") |
{ |
supportedVersion, |
{ |
/* kNeed_FireWeapon */ |
kpd0Key, |
rNoModifiers, |
/* kNeed_NextWeapon */ |
kpd9Key, |
rNoModifiers, |
/* kNeed_PreviousWeapon */ |
kpd7Key, |
rNoModifiers, |
/* kNeed_Roll */ |
kpd4Key, /* min (left/down/back) */ |
rNoModifiers, |
kpd6Key, /* max (right/up/forward) */ |
rNoModifiers, |
/* kNeed_Pitch */ |
kpd5Key, /* min (left/down/back) */ |
rNoModifiers, |
kpd8Key, /* max (right/up/forward) */ |
rNoModifiers, |
/* kNeed_Yaw */ |
/* this need does not generate any items, because it has later button equivalents */ |
/* kNeed_Throttle */ |
/* this need does not generate any items, because it has later button equivalents */ |
/* kNeed_StartPause */ |
tildeKey, |
rNoModifiers, |
/* kNeed_Quit */ |
qKey, |
rControlOff, rOptionOff, rShiftOff, controlOff, optionOff, shiftOff, commandOn, |
/* kNeed_Weapon_MachineGun */ |
n1Key, |
rNoModifiers, |
/* kNeed_Weapon_Cannon */ |
n2Key, |
rNoModifiers, |
/* kNeed_Weapon_Laser */ |
n3Key, |
rNoModifiers, |
/* kNeed_Weapon_Missle */ |
n4Key, |
rNoModifiers, |
/* kNeed_Weapon_PrecisionBomb */ |
n5Key, |
rNoModifiers, |
/* kNeed_Weapon_ClusterBomb */ |
n6Key, |
rNoModifiers, |
/* kNeed_Roll_AsDelta */ |
/* this need does not generate any items Ð the keyboard does not do deltas */ |
/* kNeed_Pitch_AsDelta */ |
/* this need does not generate any items Ð the keyboard does not do deltas */ |
/* kNeed_Yaw_AsDelta */ |
/* this need does not generate any items Ð the keyboard does not do deltas */ |
/* kNeed_Yaw_Left */ |
aKey, |
rNoModifiers, |
/* kNeed_Yaw_Center */ |
sKey, |
rNoModifiers, |
/* kNeed_Yaw_Right */ |
dKey, |
rNoModifiers, |
/* kNeed_Throttle_Min */ |
kpdEqualKey, |
rNoModifiers, |
/* kNeed_Throttle_Decrease */ |
kpdMinusKey, |
rNoModifiers, |
/* kNeed_Throttle_Increase */ |
kpdPlusKey, |
rNoModifiers, |
/* kNeed_Throttle_Max */ |
kpdSlashKey, |
rNoModifiers, |
}; |
}; |
resource 'tset' (ktset_LeftyKeyboard, "All Left Hand") |
{ |
supportedVersion, |
{ |
/* kNeed_FireWeapon */ |
spaceKey, |
rNoModifiers, |
/* kNeed_NextWeapon */ |
eKey, |
rNoModifiers, |
/* kNeed_PreviousWeapon */ |
qKey, |
rNoModifiers, |
/* kNeed_Roll */ |
noKey, /* min (left/down/back) */ |
rNoModifiers, |
noKey, /* max (right/up/forward) */ |
rNoModifiers, |
/* kNeed_Pitch */ |
noKey, /* min (left/down/back) */ |
rNoModifiers, |
noKey, /* max (right/up/forward) */ |
rNoModifiers, |
/* kNeed_Yaw */ |
/* this need does not generate any items, because it has later button equivalents */ |
/* kNeed_Throttle */ |
/* this need does not generate any items, because it has later button equivalents */ |
/* kNeed_StartPause */ |
tildeKey, |
rNoModifiers, |
/* kNeed_Quit */ |
qKey, |
rControlOff, rOptionOff, rShiftOff, controlOff, optionOff, shiftOff, commandOn, |
/* kNeed_Weapon_MachineGun */ |
n1Key, |
rNoModifiers, |
/* kNeed_Weapon_Cannon */ |
n2Key, |
rNoModifiers, |
/* kNeed_Weapon_Laser */ |
n3Key, |
rNoModifiers, |
/* kNeed_Weapon_Missle */ |
n4Key, |
rNoModifiers, |
/* kNeed_Weapon_PrecisionBomb */ |
n5Key, |
rNoModifiers, |
/* kNeed_Weapon_ClusterBomb */ |
n6Key, |
rNoModifiers, |
/* kNeed_Roll_AsDelta */ |
/* this need does not generate any items Ð the keyboard does not do deltas */ |
/* kNeed_Pitch_AsDelta */ |
/* this need does not generate any items Ð the keyboard does not do deltas */ |
/* kNeed_Yaw_AsDelta */ |
/* this need does not generate any items Ð the keyboard does not do deltas */ |
/* kNeed_Yaw_Left */ |
aKey, |
rNoModifiers, |
/* kNeed_Yaw_Center */ |
sKey, |
rNoModifiers, |
/* kNeed_Yaw_Right */ |
dKey, |
rNoModifiers, |
/* kNeed_Throttle_Min */ |
zKey, |
rNoModifiers, |
/* kNeed_Throttle_Decrease */ |
xKey, |
rNoModifiers, |
/* kNeed_Throttle_Increase */ |
cKey, |
rNoModifiers, |
/* kNeed_Throttle_Max */ |
vKey, |
rNoModifiers, |
}; |
}; |
data 'tset' (ktset_DefaultMouse, "Default (mouse)") |
{ |
$"000000043F8000003F8000003F800000" |
$"FFFF0001FFFF000100000000FFFF0001" |
$"FFFF0001FFFF0001FFFF0001FFFF0001" |
$"FFFF0001FFFF0001000000100000000F" |
$"000000100000000FFFFF0001FFFF0001" |
$"FFFF00010000000000000000FFFF0001" |
$"FFFF0001FFFF00010000001000000011" |
$"0000001000000011FFFF0001FFFF0001" |
$"FFFF0001000000000000000000000000" |
$"0000000000000000" |
}; |
data 'tset' (ktset_YawMouse, "Yaw Mouse") |
{ |
$"000000043F8000003F8000003F800000" |
$"FFFF0001FFFF000100000000FFFF0001" |
$"FFFF0001FFFF0001FFFF0001FFFF0001" |
$"FFFF0001FFFF00010000001000000011" |
$"0000001000000011FFFF0001FFFF0001" |
$"FFFF0001000000000000000000000000" |
$"00000000000000000000000027E03C00" |
$"02E53AA0000000000000010002E54F40" |
$"04D2286080600000FFFF017C00000000" |
$"0000000000000048" |
}; |
Copyright © 2003 Apple Computer, Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2003-10-14