33@interface PlayerEntity (StickMapperInternal)
36- (void) checkCustomEquipButtons:(NSDictionary *)stickFn ignore:(
int)idx;
37- (void) removeFunction:(
int)selFunctionIdx;
40 skip:(NSUInteger) skip;
41- (NSString *)describeStickDict:(NSDictionary *)stickDict;
42- (NSString *)hwToString:(
int)hwFlags;
47@implementation PlayerEntity (StickMapper)
49- (void) resetStickFunctions
51 [stickFunctions release];
56- (void) setGuiToStickMapperScreen:(
unsigned)skip
58 [
self setGuiToStickMapperScreen: skip resetCurrentRow: NO];
61- (void) setGuiToStickMapperScreen:(
unsigned)skip resetCurrentRow: (BOOL) resetCurrentRow
65 NSArray *stickList = [stickHandler
listSticks];
66 unsigned stickCount = [stickList count];
75 gui_screen = GUI_SCREEN_STICKMAPPER;
77 [gui
setTitle:[NSString stringWithFormat:@"Configure Joysticks"]];
79 for(i=0; i < stickCount; i++)
81 NSString *stickNameForThisRow = [NSString stringWithFormat: @"Stick %d %@", i+1, [stickList objectAtIndex: i]];
83 NSString *stickNameAdditional =
nil;
88 stickNameForThisRow = [[stickNameForThisRow substringToIndex:[stickNameForThisRow length] - 5]
89 stringByAppendingString:@"..."];
95 stickNameAdditional = [NSString stringWithFormat: @"Stick %d %@", j+1, [stickList objectAtIndex: j]];
100 stickNameAdditional = [[stickNameAdditional substringToIndex:[stickNameAdditional length] - 5]
101 stringByAppendingString:@"..."];
105 [gui
setArray:[NSArray arrayWithObjects:
110 forRow:i + GUI_ROW_STICKNAME];
113 [gui
setArray: [NSArray arrayWithObjects: DESC(@"stickmapper-profile"), nil]
forRow: GUI_ROW_STICKPROFILE];
115 [
self displayFunctionList:gui skip:skip];
117 [gui
setArray:[NSArray arrayWithObject:@"Select a function and press Enter to modify or 'u' to unset."]
120 [gui
setText:@"Space to return to previous screen."
forRow:GUI_ROW_INSTRUCT+1
align:GUI_ALIGN_CENTER];
126 [[UNIVERSE gameView] suppressKeysUntilKeyUp];
139 if(waitingForStickCallback)
141 if([gameView isDown: 27])
144 [gui
setArray: [NSArray arrayWithObjects:
145 @"Function setting aborted.", nil]
146 forRow: GUI_ROW_INSTRUCT];
147 waitingForStickCallback=NO;
154 [
self handleGUIUpDownArrowKeys];
158 [
self setGuiToStickProfileScreen: gui];
163 if ([key hasPrefix:
@"Index:"])
164 selFunctionIdx=[[[key componentsSeparatedByString:
@":"] objectAtIndex: 1] intValue];
168 if([gameView isDown: 13])
170 if ([key hasPrefix:
@"More:"])
172 int from_function = [[[key componentsSeparatedByString:@":"] objectAtIndex: 1] intValue];
173 if (from_function < 0) from_function = 0;
175 [
self setGuiToStickMapperScreen:from_function];
176 if ([[
UNIVERSE gui] selectedRow] < 0)
177 [[UNIVERSE gui] setSelectedRow: GUI_ROW_FUNCSTART];
178 if (from_function == 0)
179 [[UNIVERSE gui] setSelectedRow: GUI_ROW_FUNCSTART + MAX_ROWS_FUNCTIONS - 1];
183 NSDictionary *entry=[stickFunctions objectAtIndex: selFunctionIdx];
184 int hw=[(NSNumber *)[entry objectForKey: KEY_ALLOWABLE] intValue];
190 NSString *instructions;
194 instructions =
@"Fully deflect the axis you want to use for this function. Esc aborts.";
197 instructions =
@"Press the button you want to use for this function. Esc aborts.";
200 instructions =
@"Press the button or deflect the axis you want to use for this function.";
202 [gui
setArray: [NSArray arrayWithObjects: instructions, nil]
forRow: GUI_ROW_INSTRUCT];
203 waitingForStickCallback=YES;
206 if([gameView isDown:
'u'])
208 if (selFunctionIdx >= 0) [
self removeFunction: selFunctionIdx];
215- (void) updateFunction: (NSDictionary *)hwDict
218 waitingForStickCallback = NO;
221 if(gui_screen != GUI_SCREEN_STICKMAPPER)
223 OOLog(
@"joystick.configure.error",
@"%s called when not on stick mapper screen.", __PRETTY_FUNCTION__);
229 NSDictionary *entry = [stickFunctions objectAtIndex:selFunctionIdx];
232 function=[entry oo_intForKey: KEY_AXISFN];
238#if OO_FOV_INFLIGHT_CONTROL_ENABLED
239 if (
function == AXIS_FIELD_OF_VIEW)
258 function = [entry oo_intForKey:KEY_BUTTONFN];
263#if OO_FOV_INFLIGHT_CONTROL_ENABLED
264 if (
function == BUTTON_INC_FIELD_OF_VIEW ||
function == BUTTON_DEC_FIELD_OF_VIEW)
279 if (
function >= 10000)
283 if (
function >= 10000)
288 [[customEquipActivation objectAtIndex:function] setObject:hwDict forKey:key];
289 [
self checkCustomEquipButtons:hwDict ignore:function];
291 NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
292 [defaults setObject:customEquipActivation forKey:KEYCONFIG_CUSTOMEQUIP];
297 [
self checkCustomEquipButtons:hwDict ignore:-1];
312 [
self setGuiToStickMapperScreen:skip];
316- (void) checkCustomEquipButtons:(NSDictionary *)stickFn ignore:(
int)idx
319 for (i = 0; i < [customEquipActivation count]; i++)
322 NSDictionary *bf = [[customEquipActivation objectAtIndex:i] objectForKey:CUSTOMEQUIP_BUTTONACTIVATE];
326 [[customEquipActivation objectAtIndex:i] removeObjectForKey:CUSTOMEQUIP_BUTTONACTIVATE];
328 bf = [[customEquipActivation objectAtIndex:i] objectForKey:CUSTOMEQUIP_BUTTONMODE];
332 [[customEquipActivation objectAtIndex:i] removeObjectForKey:CUSTOMEQUIP_BUTTONMODE];
339- (void) removeFunction:(
int)idx
342 NSDictionary *entry = [stickFunctions objectAtIndex:idx];
343 NSNumber *butfunc = [entry objectForKey:KEY_BUTTONFN];
344 NSNumber *axfunc = [entry objectForKey:KEY_AXISFN];
346 selFunctionIdx = idx;
353 if ([butfunc intValue] >= 10000)
355 int bf = [butfunc intValue];
364 [[customEquipActivation objectAtIndex:bf] removeObjectForKey:key];
381 NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
382 [defaults setObject:customEquipActivation forKey:KEYCONFIG_CUSTOMEQUIP];
390 [
self setGuiToStickMapperScreen: skip];
395 skip:(NSUInteger)skip
400 [gui
setArray:[NSArray arrayWithObjects:
401 @"Function", @"Assigned to", @"Type", nil]
406 stickFunctions = [[
self stickFunctionList] retain];
411 NSUInteger i, n_functions = [stickFunctions count];
412 NSInteger n_rows, start_row, previous = 0;
414 if (skip >= n_functions)
415 skip = n_functions - 1;
444 [gui
setArray:[NSArray arrayWithObjects:DESC(@"gui-back"), @" <-- ", nil]
forRow:GUI_ROW_FUNCSTART];
445 [gui
setKey:[NSString stringWithFormat:@"More:%ld", previous]
forRow:GUI_ROW_FUNCSTART];
448 for(i=0; i < (n_functions - skip) && (
int)i < n_rows; i++)
450 NSDictionary *entry = [stickFunctions objectAtIndex: i + skip];
452 NSString *header = [entry objectForKey:KEY_HEADER];
453 [gui
setArray:[NSArray arrayWithObjects:header, @"", @"", nil]
forRow:i + start_row];
458 NSString *allowedThings;
459 NSString *assignment;
460 NSString *axFuncKey = [entry oo_stringForKey:KEY_AXISFN];
461 NSString *butFuncKey = [entry oo_stringForKey:KEY_BUTTONFN];
462 int allowable = [entry oo_intForKey:KEY_ALLOWABLE];
466 allowedThings=
@"Axis";
467 assignment=[
self describeStickDict:
468 [assignedAxes objectForKey: axFuncKey]];
471 allowedThings=
@"Button";
472 int bf = [butFuncKey integerValue];
475 assignment=[
self describeStickDict:
476 [assignedButs objectForKey: butFuncKey]];
487 assignment=[
self describeStickDict:
488 [[customEquipActivation objectAtIndex:bf] objectForKey:key]];
492 allowedThings=
@"Axis/Button";
495 assignment=[
self describeStickDict:
496 [assignedAxes objectForKey: axFuncKey]];
498 assignment=[
self describeStickDict:
499 [assignedButs objectForKey: butFuncKey]];
503 if (assignment ==
nil)
508 [gui
setArray: [NSArray arrayWithObjects:
509 [entry objectForKey: KEY_GUIDESC], assignment, allowedThings, nil]
512 [gui
setKey: [NSString stringWithFormat: @"Index:%ld", i + skip]
forRow: i + start_row];
515 if (i < n_functions - skip)
518 [gui
setArray: [NSArray arrayWithObjects: DESC(@"gui-more"), @" --> ", nil]
forRow: start_row + i];
519 [gui
setKey: [NSString stringWithFormat: @"More:%ld", n_rows + skip]
forRow: start_row + i];
523 [gui
setSelectableRange: NSMakeRange(GUI_ROW_STICKPROFILE, i + start_row - GUI_ROW_STICKPROFILE)];
529- (NSString *) describeStickDict: (NSDictionary *)stickDict
534 int thingNumber=[(NSNumber *)[stickDict objectForKey: STICK_AXBUT]
536 int stickNumber=[(NSNumber *)[stickDict objectForKey: STICK_NUMBER]
539 if([(NSNumber *)[stickDict objectForKey:
STICK_ISAXIS] boolValue])
541 desc=[NSString stringWithFormat: @"Stick %d axis %d",
542 stickNumber+1, thingNumber+1];
546 static const char dir[][6] = {
"up",
"right",
"down",
"left" };
547 desc=[NSString stringWithFormat: @"Stick %d hat %d %s",
548 stickNumber+1, (thingNumber - MAX_REAL_BUTTONS) / 4 + 1,
549 dir[thingNumber & 3]];
553 desc=[NSString stringWithFormat: @"Stick %d button %d",
554 stickNumber+1, thingNumber+1];
561- (NSString *)hwToString: (
int)hwFlags
570 hwString =
@"button";
573 hwString =
@"axis/button";
581- (NSArray *)stickFunctionList
583 NSMutableArray *funcList = [NSMutableArray array];
586 [funcList addObject:[
self makeStickGuiDictHeader:DESC(@"stickmapper-header-propulsion")]];
588 [
self makeStickGuiDict:DESC(@"stickmapper-roll")
591 butfn:STICK_NOFUNCTION]];
593 [
self makeStickGuiDict:DESC(@"stickmapper-pitch")
596 butfn:STICK_NOFUNCTION]];
598 [
self makeStickGuiDict:DESC(@"stickmapper-yaw")
601 butfn:STICK_NOFUNCTION]];
603 [
self makeStickGuiDict:DESC(@"stickmapper-increase-thrust")
604 allowable:HW_AXIS|HW_BUTTON
606 butfn:BUTTON_INCTHRUST]];
608 [
self makeStickGuiDict:DESC(@"stickmapper-decrease-thrust")
609 allowable:HW_AXIS|HW_BUTTON
611 butfn:BUTTON_DECTHRUST]];
613 [
self makeStickGuiDict:DESC(@"stickmapper-fuel-injection")
615 axisfn:STICK_NOFUNCTION
616 butfn:BUTTON_FUELINJECT]];
618 [
self makeStickGuiDict:DESC(@"stickmapper-hyperspeed")
620 axisfn:STICK_NOFUNCTION
621 butfn:BUTTON_HYPERSPEED]];
623 [
self makeStickGuiDict:DESC(@"stickmapper-hyperdrive")
625 axisfn:STICK_NOFUNCTION
626 butfn:BUTTON_HYPERDRIVE]];
628 [
self makeStickGuiDict:DESC(@"stickmapper-gal-hyperdrive")
630 axisfn:STICK_NOFUNCTION
631 butfn:BUTTON_GALACTICDRIVE]];
634 [
self makeStickGuiDict:DESC(@"stickmapper-roll/pitch-precision-toggle")
636 axisfn:STICK_NOFUNCTION
637 butfn:BUTTON_PRECISION]];
640 [funcList addObject:[
self makeStickGuiDictHeader:DESC(@"stickmapper-header-navigation")]];
642 [
self makeStickGuiDict:DESC(@"stickmapper-compass-mode-next")
644 axisfn:STICK_NOFUNCTION
645 butfn:BUTTON_COMPASSMODE]];
647 [
self makeStickGuiDict:DESC(@"stickmapper-compass-mode-prev")
649 axisfn:STICK_NOFUNCTION
650 butfn:BUTTON_COMPASSMODE_PREV]];
652 [
self makeStickGuiDict:DESC(@"stickmapper-scanner-zoom")
654 axisfn:STICK_NOFUNCTION
655 butfn:BUTTON_SCANNERZOOM]];
657 [
self makeStickGuiDict:DESC(@"stickmapper-scanner-unzoom")
659 axisfn:STICK_NOFUNCTION
660 butfn:BUTTON_SCANNERUNZOOM]];
662 [
self makeStickGuiDict:DESC(@"stickmapper-view-forward")
663 allowable:HW_AXIS|HW_BUTTON
665 butfn:BUTTON_VIEWFORWARD]];
667 [
self makeStickGuiDict:DESC(@"stickmapper-view-aft")
668 allowable:HW_AXIS|HW_BUTTON
670 butfn:BUTTON_VIEWAFT]];
672 [
self makeStickGuiDict:DESC(@"stickmapper-view-port")
673 allowable:HW_AXIS|HW_BUTTON
675 butfn:BUTTON_VIEWPORT]];
677 [
self makeStickGuiDict:DESC(@"stickmapper-view-starboard")
678 allowable:HW_AXIS|HW_BUTTON
680 butfn:BUTTON_VIEWSTARBOARD]];
682 [
self makeStickGuiDict:DESC(@"stickmapper-ext-view-cycle")
684 axisfn:STICK_NOFUNCTION
685 butfn:BUTTON_EXTVIEWCYCLE]];
687 [
self makeStickGuiDict:DESC(@"stickmapper-toggle-ID")
689 axisfn:STICK_NOFUNCTION
692 [
self makeStickGuiDict:DESC(@"stickmapper-docking-clearance")
694 axisfn:STICK_NOFUNCTION
695 butfn:BUTTON_DOCKINGCLEARANCE]];
697 [
self makeStickGuiDict:DESC(@"stickmapper-dockcpu")
699 axisfn:STICK_NOFUNCTION
700 butfn:BUTTON_DOCKCPU]];
702 [
self makeStickGuiDict:DESC(@"stickmapper-dockcpufast")
704 axisfn:STICK_NOFUNCTION
705 butfn:BUTTON_DOCKCPUFAST]];
707 [
self makeStickGuiDict:DESC(@"stickmapper-docking-music")
709 axisfn:STICK_NOFUNCTION
710 butfn:BUTTON_DOCKINGMUSIC]];
713 [funcList addObject:[
self makeStickGuiDictHeader:DESC(@"stickmapper-header-offensive")]];
715 [
self makeStickGuiDict:DESC(@"stickmapper-weapons-online-toggle")
717 axisfn:STICK_NOFUNCTION
718 butfn:BUTTON_WEAPONSONLINETOGGLE]];
720 [
self makeStickGuiDict:DESC(@"stickmapper-primary-weapon")
722 axisfn:STICK_NOFUNCTION
725 [
self makeStickGuiDict:DESC(@"stickmapper-secondary-weapon")
727 axisfn:STICK_NOFUNCTION
728 butfn:BUTTON_LAUNCHMISSILE]];
730 [
self makeStickGuiDict:DESC(@"stickmapper-arm-secondary")
732 axisfn:STICK_NOFUNCTION
733 butfn:BUTTON_ARMMISSILE]];
735 [
self makeStickGuiDict:DESC(@"stickmapper-disarm-secondary")
737 axisfn:STICK_NOFUNCTION
738 butfn:BUTTON_UNARM]];
740 [
self makeStickGuiDict:DESC(@"stickmapper-target-nearest-incoming-missile")
742 axisfn:STICK_NOFUNCTION
743 butfn:BUTTON_TARGETINCOMINGMISSILE]];
745 [
self makeStickGuiDict:DESC(@"stickmapper-cycle-secondary")
747 axisfn:STICK_NOFUNCTION
748 butfn:BUTTON_CYCLEMISSILE]];
750 [
self makeStickGuiDict:DESC(@"stickmapper-next-target")
752 axisfn:STICK_NOFUNCTION
753 butfn:BUTTON_NEXTTARGET]];
755 [
self makeStickGuiDict:DESC(@"stickmapper-previous-target")
757 axisfn:STICK_NOFUNCTION
758 butfn:BUTTON_PREVTARGET]];
761 [funcList addObject:[
self makeStickGuiDictHeader:DESC(@"stickmapper-header-defensive")]];
763 [
self makeStickGuiDict:DESC(@"stickmapper-ECM")
765 axisfn:STICK_NOFUNCTION
768 [
self makeStickGuiDict:DESC(@"stickmapper-jettison")
770 axisfn:STICK_NOFUNCTION
771 butfn:BUTTON_JETTISON]];
773 [
self makeStickGuiDict:DESC(@"stickmapper-rotate-cargo")
775 axisfn:STICK_NOFUNCTION
776 butfn:BUTTON_ROTATECARGO]];
778 [
self makeStickGuiDict:DESC(@"stickmapper-escape-pod")
780 axisfn:STICK_NOFUNCTION
781 butfn:BUTTON_ESCAPE]];
784 [funcList addObject:[
self makeStickGuiDictHeader:DESC(@"stickmapper-header-special-equip")]];
786 [
self makeStickGuiDict:DESC(@"stickmapper-mfd-select-next")
788 axisfn:STICK_NOFUNCTION
789 butfn:BUTTON_MFDSELECTNEXT]];
791 [
self makeStickGuiDict:DESC(@"stickmapper-mfd-select-prev")
793 axisfn:STICK_NOFUNCTION
794 butfn:BUTTON_MFDSELECTPREV]];
796 [
self makeStickGuiDict:DESC(@"stickmapper-mfd-cycle-next")
798 axisfn:STICK_NOFUNCTION
799 butfn:BUTTON_MFDCYCLENEXT]];
801 [
self makeStickGuiDict:DESC(@"stickmapper-mfd-cycle-prev")
803 axisfn:STICK_NOFUNCTION
804 butfn:BUTTON_MFDCYCLEPREV]];
806 [
self makeStickGuiDict:DESC(@"stickmapper-prime-equipment")
808 axisfn:STICK_NOFUNCTION
809 butfn:BUTTON_PRIMEEQUIPMENT]];
811 [
self makeStickGuiDict:DESC(@"stickmapper-prime-prev-equipment")
813 axisfn:STICK_NOFUNCTION
814 butfn:BUTTON_PRIMEEQUIPMENT]];
816 [
self makeStickGuiDict:DESC(@"stickmapper-activate-equipment")
818 axisfn:STICK_NOFUNCTION
819 butfn:BUTTON_ACTIVATEEQUIPMENT]];
821 [
self makeStickGuiDict:DESC(@"stickmapper-mode-equipment")
823 axisfn:STICK_NOFUNCTION
824 butfn:BUTTON_MODEEQUIPMENT]];
826 [
self makeStickGuiDict:DESC(@"stickmapper-fastactivate-a")
828 axisfn:STICK_NOFUNCTION
829 butfn:BUTTON_CLOAK]];
831 [
self makeStickGuiDict:DESC(@"stickmapper-fastactivate-b")
833 axisfn:STICK_NOFUNCTION
834 butfn:BUTTON_ENERGYBOMB]];
837 [funcList addObject:[
self makeStickGuiDictHeader:DESC(@"stickmapper-header-misc")]];
839 [
self makeStickGuiDict:DESC(@"stickmapper-snapshot")
841 axisfn:STICK_NOFUNCTION
842 butfn:BUTTON_SNAPSHOT]];
844 [
self makeStickGuiDict:DESC(@"stickmapper-pause")
846 axisfn:STICK_NOFUNCTION
847 butfn:BUTTON_PAUSE]];
849 [
self makeStickGuiDict:DESC(@"stickmapper-toggle-hud")
851 axisfn:STICK_NOFUNCTION
852 butfn:BUTTON_TOGGLEHUD]];
854 [
self makeStickGuiDict:DESC(@"stickmapper-comms-log")
856 axisfn:STICK_NOFUNCTION
857 butfn:BUTTON_COMMSLOG]];
858#if OO_FOV_INFLIGHT_CONTROL_ENABLED
860 [
self makeStickGuiDict:DESC(@"stickmapper-increase-field-of-view")
861 allowable:HW_AXIS|HW_BUTTON
862 axisfn:AXIS_FIELD_OF_VIEW
863 butfn:BUTTON_INC_FIELD_OF_VIEW]];
865 [
self makeStickGuiDict:DESC(@"stickmapper-decrease-field-of-view")
866 allowable:HW_AXIS|HW_BUTTON
867 axisfn:AXIS_FIELD_OF_VIEW
868 butfn:BUTTON_DEC_FIELD_OF_VIEW]];
870 if ([customEquipActivation
count] > 0) {
871 [funcList addObject:[
self makeStickGuiDictHeader:DESC(@"stickmapper-header-oxp-equip")]];
873 for (i = 0; i < [customEquipActivation count]; i++)
876 [
self makeStickGuiDict:[NSString stringWithFormat: @"Activate '%@'", [[customEquipActivation objectAtIndex:i] oo_stringForKey:CUSTOMEQUIP_EQUIPNAME]]
878 axisfn:STICK_NOFUNCTION
881 [
self makeStickGuiDict:[NSString stringWithFormat: @"Mode '%@'", [[customEquipActivation objectAtIndex:i] oo_stringForKey:CUSTOMEQUIP_EQUIPNAME]]
883 axisfn:STICK_NOFUNCTION
893- (NSDictionary *)makeStickGuiDict:(NSString *)what
894 allowable:(
int)allowable
898 NSMutableDictionary *guiDict = [NSMutableDictionary dictionary];
900 if ([what length] > 50) what = [[what substringToIndex:28] stringByAppendingString:
@"..."];
901 [guiDict setObject: what forKey: KEY_GUIDESC];
902 [guiDict setObject: [NSNumber numberWithInt: allowable]
903 forKey: KEY_ALLOWABLE];
905 [guiDict setObject: [NSNumber numberWithInt: axisfn]
908 [guiDict setObject: [NSNumber numberWithInt: butfn]
913- (NSDictionary *)makeStickGuiDictHeader:(NSString *)header
915 NSMutableDictionary *guiDict = [NSMutableDictionary dictionary];
916 [guiDict setObject:header forKey:KEY_HEADER];
917 [guiDict setObject:@"" forKey:KEY_ALLOWABLE];
918 [guiDict setObject:@"" forKey:KEY_AXISFN];
919 [guiDict setObject:@"" forKey:KEY_BUTTONFN];
CGFloat OOStringWidthInEm(NSString *text)
#define OOLog(class, format,...)
#define GUI_ROW_STICKPROFILE
#define MAX_ROWS_FUNCTIONS
#define GUI_ROW_FUNCSTART
#define CUSTOMEQUIP_BUTTONACTIVATE
#define CUSTOMEQUIP_BUTTONMODE
void resetStickFunctions()
NSArray * stickFunctionList()
BOOL setBackgroundTextureKey:(NSString *key)
BOOL setSelectedRow:(OOGUIRow row)
BOOL setForegroundTextureKey:(NSString *key)
void setText:forRow:align:(NSString *str,[forRow] OOGUIRow row,[align] OOGUIAlignment alignment)
void setSelectableRange:(NSRange range)
void setColor:forRow:(OOColor *color,[forRow] OOGUIRow row)
void setTitle:(NSString *str)
void setTabStops:(OOGUITabSettings stops)
NSString * keyForRow:(OOGUIRow row)
void setArray:forRow:(NSArray *arr,[forRow] OOGUIRow row)
void setKey:forRow:(NSString *str,[forRow] OOGUIRow row)
NSDictionary * buttonFunctions()
void unsetButtonFunction:(int function)
void setFunction:withDict:(int function,[withDict] NSDictionary *stickFn)
NSDictionary * axisFunctions()
void unsetAxisFunction:(int function)
void setCallback:object:hardware:(SEL selector,[object] id obj,[hardware] char hwflags)
typedef int(ZCALLBACK *close_file_func) OF((voidpf opaque