13 #define ListObject MUIOBJMACRO_START("NList.mcc")
16 #define ListviewObject MUIOBJMACRO_START("NListview.mcc")
19 extern const STRPTR
GM_UNIQUENAME(libname
);
22 static char *MainGUIPages
[] = { "General", "Keyboard", "Action", NULL
};
23 static char *MainGUIPagesDefault
[] = { "General", "Keyboard", NULL
};
25 static char *LLPortStrings
[] = { "Don't touch", "Overwrite with USB", "Merge with USB", "Disable", "Analogue Hack", NULL
};
26 static char *LLRumbleStrings
[] = { "Off", "Port 0", "Port 1", "Port 2", "Port 3", NULL
};
28 static char *TurboMouseStrings
[] = { "Off", "1000 Hz", "500 Hz", "250 Hz", "125 Hz", NULL
};
30 static char *ActionTypeStrings
[] = { "No action", "Qualifiers", "Keymapping", "Raw key",
31 "Vanilla key", "Keystring", "Mouse position", "Mouse buttons",
32 "Tablet data", "Digital joystick", "Analogue joystick",
33 "Scrollwheel", "Sound", "Shell", "Arexx", "HID output",
34 "HID feature", "Miscellaneous", "Variables", "Ext. Raw key", NULL
};
36 static char *ActionTriggerStrings
[] = { "Down", "Up", "Any", "Always", "NaN", NULL
};
37 static UWORD ActionTriggerVals
[] = { HUA_DOWNEVENT
, HUA_UPEVENT
, HUA_ANY
, HUA_ALWAYS
, HUA_NAN
, 0 };
39 static char *A_CCVariableStrings
[] = { "Eval. item val", "Orig. item value", "Constant", "Click count", "Click time",
40 "USB qualifiers", "All qualifiers", "Random bit", "Random value", "Timer",
41 "Local var 1", "Local var 2", "Local var 3", "Local var 4",
42 "Local var 5", "Local var 6", "Local var 7", "Local var 8",
43 "Global var A", "Global var B", "Global var C", "Global var D",
44 "Global var E", "Global var F", "Global var G", "Global var H",
46 static UWORD A_CCVariableVals
[] = { HUAT_EITEMVALUE
, HUAT_OITEMVALUE
, HUAT_CONST
, HUAT_CLICKCOUNT
, HUAT_CLICKTIME
,
47 HUAT_QUALIFIERS
, HUAT_ALLQUAL
, HUAT_RANDOMBIT
, HUAT_RANDOMVAL
, HUAT_TIMER
,
48 HUAT_LOCALVAR1
, HUAT_LOCALVAR2
, HUAT_LOCALVAR3
, HUAT_LOCALVAR4
,
49 HUAT_LOCALVAR5
, HUAT_LOCALVAR6
, HUAT_LOCALVAR7
, HUAT_LOCALVAR8
,
50 HUAT_GLOBVARA
, HUAT_GLOBVARB
, HUAT_GLOBVARC
, HUAT_GLOBVARD
,
51 HUAT_GLOBVARE
, HUAT_GLOBVARF
, HUAT_GLOBVARG
, HUAT_GLOBVARH
,
54 static char *A_CCCondStrings
[] = { "==", "!=", "<", "<=", ">", ">=", "and", "nand", "or", "xor", "and not",
55 "bw and", "bw nand", "bw or", "bw xor", "bw and not", NULL
};
56 static UWORD A_CCCondVals
[] = { HUAT_EQ
, HUAT_NE
, HUAT_LT
, HUAT_LE
, HUAT_GT
, HUAT_GE
, HUAT_AND
, HUAT_NAND
, HUAT_OR
, HUAT_XOR
, HUAT_ANDNOT
,
57 HUAT_BWAND
, HUAT_BWNAND
, HUAT_BWOR
, HUAT_BWXOR
, HUAT_BWANDNOT
, 0 };
59 static char *A_QualOpStrings
[] = { "Set", "Clear", "Toggle", "Assign", NULL
};
60 static UWORD A_QualOpVals
[] = { HUAT_SET
, HUAT_CLEAR
, HUAT_TOGGLE
, HUAT_ASSIGN
, 0 };
61 static char *A_QualifierStrings
[] = { "Left shift", "Right shift", "Caps lock", "Control",
62 "Left alt", "Right alt", "Left amiga", "Right amiga",
63 "Numeric pad", NULL
};
65 static char *A_MousePosOpStrings
[] = { "relative horizontal", "relative vertical", "to absolute X", "to absolute Y", NULL
};
66 static UWORD A_MousePosOpVals
[] = { HUAT_DELTAX
, HUAT_DELTAY
, HUAT_ABSX
, HUAT_ABSY
, 0 };
68 static char *A_MouseButOpStrings
[] = { "Press", "Release", "Flip", "Assign", NULL
};
69 static UWORD A_MouseButOpVals
[] = { HUAT_SET
, HUAT_CLEAR
, HUAT_TOGGLE
, HUAT_ASSIGN
, 0 };
70 static char *A_MouseButStrings
[] = { "left", "right", "middle", "fourth", "fifth", NULL
};
72 static char *A_TabletAxisStrings
[] = { "pressure", "X rotation", "Y rotation", "Z rotation", "proximity", "Z position", NULL
};
73 static UWORD A_TabletAxisVals
[] = { HUAT_PRESSURE
, HUAT_XROT
, HUAT_YROT
, HUAT_ZROT
, HUAT_PROX
, HUAT_ABSZ
, 0 };
75 static char *A_WheelOpStrings
[] = { "horizontal movement", "vertical movement", "left (by distance)", "right (by distance)",
76 "up (by distance)", "down (by distance)", NULL
};
77 static UWORD A_WheelOpVals
[] = { HUAT_DELTAX
, HUAT_DELTAY
, HUAT_LEFT
, HUAT_RIGHT
, HUAT_UP
, HUAT_DOWN
, 0 };
79 static char *A_JoypadOpStrings
[] = { "Push", "Release", "Toggle", "Assign", NULL
};
80 static UWORD A_JoypadOpVals
[] = { HUAT_SET
, HUAT_CLEAR
, HUAT_TOGGLE
, HUAT_ASSIGN
, 0 };
82 static char *A_JoypadFeatStrings
[] = { "left", "right", "up", "down", "hatswitch",
83 "red (fire)", "blue (2nd)", "green (shuffle)", "yellow (repeat)",
84 "forward", "reverse", "play/pause", NULL
};
85 static UWORD A_JoypadFeatVals
[] = { HUAT_LEFT
, HUAT_RIGHT
, HUAT_UP
, HUAT_DOWN
, HUAT_HATSWITCH
,
86 HUAT_RED
, HUAT_BLUE
, HUAT_GREEN
, HUAT_YELLOW
,
87 HUAT_FORWARD
, HUAT_REVERSE
, HUAT_PLAY
, 0 };
89 static char *A_APadFeatStrings
[] = { "X axis", "Y axis", NULL
};
90 static UWORD A_APadFeatVals
[] = { HUAT_ABSX
, HUAT_ABSY
, 0 };
92 static char *A_TarVariableStrings
[] = { "Local var 1", "Local var 2", "Local var 3", "Local var 4",
93 "Local var 5", "Local var 6", "Local var 7", "Local var 8",
94 "Global var A", "Global var B", "Global var C", "Global var D",
95 "Global var E", "Global var F", "Global var G", "Global var H",
97 static UWORD A_TarVariableVals
[] = { HUAT_LOCALVAR1
, HUAT_LOCALVAR2
, HUAT_LOCALVAR3
, HUAT_LOCALVAR4
,
98 HUAT_LOCALVAR5
, HUAT_LOCALVAR6
, HUAT_LOCALVAR7
, HUAT_LOCALVAR8
,
99 HUAT_GLOBVARA
, HUAT_GLOBVARB
, HUAT_GLOBVARC
, HUAT_GLOBVARD
,
100 HUAT_GLOBVARE
, HUAT_GLOBVARF
, HUAT_GLOBVARG
, HUAT_GLOBVARH
,
103 static char *A_TarVarOpStrings
[] = { "assign :=", "not := !", "add +=", "sub -=", "mult *=", "div /=", "mod %=",
104 "and (x && y)", "nand !(x && y)", "or (x || y)", "xor (x ^^ y)", "and not (x && !y)",
105 "bw and (x & y)", "bw nand ~(x & y)", "bw or (x | y)", "bw xor (x ^ y)", "bw and not (x & ~y)",
106 "shift <- (x << y)", "shift -> (x >> y)",
108 static UWORD A_TarVarOpVals
[] = { HUAT_ASSIGN
, HUAT_ASSNOT
, HUAT_ADD
, HUAT_SUB
, HUAT_MULTIPLY
, HUAT_DIVIDE
, HUAT_MODULO
,
109 HUAT_AND
, HUAT_NAND
, HUAT_OR
, HUAT_XOR
, HUAT_ANDNOT
,
110 HUAT_BWAND
, HUAT_BWNAND
, HUAT_BWOR
, HUAT_BWXOR
, HUAT_BWANDNOT
,
111 HUAT_ASL
, HUAT_ASR
, 0 };
113 static char *A_OutOpStrings
[] = { "Set", "Clear", "Toggle", "Assign", NULL
};
114 static UWORD A_OutOpVals
[] = { HUAT_SET
, HUAT_CLEAR
, HUAT_TOGGLE
, HUAT_ASSIGN
, 0 };
116 /* JPB_JOY_LEFT, JPB_JOY_RIGHT, JPB_JOY_UP, JPB_JOY_DOWN,
117 JPB_BUTTON_RED, JPB_BUTTON_BLUE, JPB_BUTTON_GREEN, JPB_BUTTON_YELLOW,
118 JPB_BUTTON_FORWARD, JPB_BUTTON_REVERSE, JPB_BUTTON_PLAY,
121 static char *A_JoypadPortStrings
[] = { "port 0", "port 1", "port 2", "port 3", NULL
};
123 static char *A_MiscOpStrings
[] = { "Activate window", "Window to front", "Window to back", "Close window",
124 "Zip window", "Screen cycle", "WB to front", "Display beep",
125 "Reboot machine", "Flush events", NULL
};
126 static UWORD A_MiscOpVals
[] = { HUAT_ACTWINDOW
, HUAT_WIN2FRONT
, HUAT_WIN2BACK
, HUAT_CLOSEWINDOW
,
127 HUAT_ZIPWINDOW
, HUAT_SCREENCYCLE
, HUAT_WB2FRONT
, HUAT_DISPLAYBEEP
,
128 HUAT_REBOOT
, HUAT_FLUSHEVENTS
, 0 };
131 /* /// "nRevLookup()" */
132 ULONG
nRevLookup(UWORD id
, UWORD def
, UWORD
*field
)
147 /* /// "nGUITask()" */
148 AROS_UFH0(void, GM_UNIQUENAME(nGUITask
))
152 struct Task
*thistask
;
153 struct NepHidBase
*nh
;
154 struct NepClassHid
*nch
;
156 struct HidUsageIDMap
*hum
;
158 char barbar
[] = "BAR,BAR,";
159 //char barbarbar[] = "BAR,BAR,BAR,";
160 char barbarbarbar
[] = "BAR,BAR,BAR,BAR,";
162 thistask
= FindTask(NULL
);
164 #define ps nch->nch_PsdBase
166 #define IntuitionBase nch->nch_IntBase
168 #define KeymapBase nch->nch_KeyBase
170 #define MUIMasterBase nch->nch_MUIBase
172 nch
= thistask
->tc_UserData
;
173 nh
= nch
->nch_ClsBase
;
175 ++nh
->nh_Library
.lib_OpenCnt
;
176 NewList(&nch
->nch_GUIItems
);
177 NewList(&nch
->nch_GUIOutItems
);
178 if(!(MUIMasterBase
= OpenLibrary(MUIMASTER_NAME
, MUIMASTER_VMIN
)))
180 KPRINTF(10, ("Couldn't open muimaster.library.\n"));
181 GM_UNIQUENAME(nGUITaskCleanup
)(nch
);
185 if(!(IntuitionBase
= OpenLibrary("intuition.library", 39)))
187 KPRINTF(10, ("Couldn't open intuition.library.\n"));
188 GM_UNIQUENAME(nGUITaskCleanup
)(nch
);
191 if(!(KeymapBase
= OpenLibrary("keymap.library", 39)))
193 KPRINTF(10, ("Couldn't open keymap.library.\n"));
194 GM_UNIQUENAME(nGUITaskCleanup
)(nch
);
197 if(!(ps
= OpenLibrary("poseidon.library", 4)))
199 KPRINTF(10, ("Couldn't open poseidon.library.\n"));
200 GM_UNIQUENAME(nGUITaskCleanup
)(nch
);
204 nch
->nch_ActionClass
= MUI_CreateCustomClass(NULL
, MUIC_Area
, NULL
, sizeof(struct ActionData
), GM_UNIQUENAME(ActionDispatcher
));
205 if(!nch
->nch_ActionClass
)
207 KPRINTF(10, ("Couldn't create ActionClass.\n"));
208 GM_UNIQUENAME(nGUITaskCleanup
)(nch
);
211 for(count
= 0; count
< 128; count
++)
213 struct InputEvent ie
;
222 ie
.ie_Class
= IECLASS_RAWKEY
;
226 ie
.ie_EventAddress
= NULL
;
228 if((betterstr
= nNumToStr(nch
, NTS_RAWKEY
, (ULONG
) count
, NULL
)))
230 strcpy(buf
, betterstr
);
231 actual
= strlen(buf
);
233 actual
= MapRawKey(&ie
, buf
, 15, NULL
);
241 if((buf
[charpos
] < 0x20) || ((buf
[charpos
] >= 0x80) && (buf
[charpos
] < 0xa0)))
246 } while(++charpos
< actual
);
250 nch
->nch_RawKeyArray
[count
] = psdCopyStrFmt("0x%02lx (%s)", count
, buf
);
252 strcpy(buf2
, "unprintable seq.");
256 targetpos
= strlen(buf2
);
257 buf2
[targetpos
++] = ' ';
258 psdSafeRawDoFmt(&buf2
[targetpos
], 79-targetpos
, "$%02lx", buf
[charpos
]);
259 } while((++charpos
< actual
) && targetpos
< 75);
260 nch
->nch_RawKeyArray
[count
] = psdCopyStrFmt("0x%02lx (%s)", count
, buf2
);
263 nch
->nch_RawKeyArray
[count
] = psdCopyStrFmt("0x%02lx", count
);
267 for(count
= 0; count
< 128; count
++)
269 nch
->nch_ExtRawKeyArray
[count
] = psdCopyStrFmt("0x%02lx %s", count
, nNumToStr(nch
, NTS_EXTRAWKEY
, (ULONG
) count
, "<undef.>"));
272 hum
= (struct HidUsageIDMap
*) hidusage07
;
274 while(hum
->hum_String
)
276 nch
->nch_USBKeyArray
[count
] = hum
++;
280 nch
->nch_USBKeyListDisplayHook
.h_Data
= nch
;
281 nch
->nch_ReportListDisplayHook
.h_Data
= nch
;
282 nch
->nch_ItemListDisplayHook
.h_Data
= nch
;
283 nch
->nch_ActionListDisplayHook
.h_Data
= nch
;
285 nch
->nch_USBKeyListDisplayHook
.h_Entry
= (APTR
) GM_UNIQUENAME(USBKeyListDisplayHook
);
286 nch
->nch_ReportListDisplayHook
.h_Entry
= (APTR
) GM_UNIQUENAME(ReportListDisplayHook
);
287 nch
->nch_ItemListDisplayHook
.h_Entry
= (APTR
) GM_UNIQUENAME(ItemListDisplayHook
);
288 nch
->nch_ActionListDisplayHook
.h_Entry
= (APTR
) GM_UNIQUENAME(ActionListDisplayHook
);
290 nch
->nch_App
= ApplicationObject
,
291 MUIA_Application_Title
, (IPTR
)GM_UNIQUENAME(libname
),
292 MUIA_Application_Version
, (IPTR
)VERSION_STRING
,
293 MUIA_Application_Copyright
, (IPTR
)"©2002-2009 Chris Hodges",
294 MUIA_Application_Author
, (IPTR
)"Chris Hodges <chrisly@platon42.de>",
295 MUIA_Application_Description
, (IPTR
)"Settings for the hid.class",
296 MUIA_Application_Base
, (IPTR
)"HID",
297 MUIA_Application_HelpFile
, (IPTR
)"HELP:Poseidon.guide",
298 MUIA_Application_Menustrip
, (IPTR
)MenustripObject
,
299 Child
, (IPTR
)MenuObjectT((IPTR
)"Project"),
300 Child
, (IPTR
)(nch
->nch_AboutMI
= MenuitemObject
,
301 MUIA_Menuitem_Title
, (IPTR
)"About...",
302 MUIA_Menuitem_Shortcut
, (IPTR
)"?",
305 Child
, (IPTR
)MenuObjectT((IPTR
)"Quick Setup"),
306 //Child, (IPTR)MUIA_Menu_Enabled, nch->nch_Interface ? TRUE : FALSE,
307 Child
, (IPTR
)MenuitemObject
,
308 MUIA_Menuitem_Title
, (IPTR
)"Mouse",
309 Child
, (IPTR
)(nch
->nch_SwapLMBRMBMI
= MenuitemObject
,
310 MUIA_Menuitem_Title
, (IPTR
)"Swap LMB<->RMB",
312 Child
, (IPTR
)MenuitemObject
,
313 MUIA_Menuitem_Title
, (IPTR
)NM_BARLABEL
,
315 Child
, (IPTR
)(nch
->nch_MouseAccel100MI
= MenuitemObject
,
316 MUIA_Menuitem_Title
, (IPTR
)"Acceleration off",
317 MUIA_Menuitem_Enabled
, FALSE
,
319 Child
, (IPTR
)(nch
->nch_MouseAccel150MI
= MenuitemObject
,
320 MUIA_Menuitem_Title
, (IPTR
)"Acceleration 150%",
321 MUIA_Menuitem_Enabled
, FALSE
,
323 Child
, (IPTR
)(nch
->nch_MouseAccel200MI
= MenuitemObject
,
324 MUIA_Menuitem_Title
, (IPTR
)"Acceleration 200%",
325 MUIA_Menuitem_Enabled
, FALSE
,
328 Child
, (IPTR
)MenuitemObject
,
329 MUIA_Menuitem_Title
, (IPTR
)"Joystick",
330 Child
, (IPTR
)(nch
->nch_JoyPort0MI
= MenuitemObject
,
331 MUIA_Menuitem_Title
, (IPTR
)"Select Port 0",
333 Child
, (IPTR
)(nch
->nch_JoyPort1MI
= MenuitemObject
,
334 MUIA_Menuitem_Title
, (IPTR
)"Select Port 1",
336 Child
, (IPTR
)(nch
->nch_JoyPort2MI
= MenuitemObject
,
337 MUIA_Menuitem_Title
, (IPTR
)"Select Port 2",
339 Child
, (IPTR
)(nch
->nch_JoyPort3MI
= MenuitemObject
,
340 MUIA_Menuitem_Title
, (IPTR
)"Select Port 3",
342 Child
, (IPTR
)MenuitemObject
,
343 MUIA_Menuitem_Title
, (IPTR
)NM_BARLABEL
,
345 Child
, (IPTR
)(nch
->nch_JoyAutofireMI
= MenuitemObject
,
346 MUIA_Menuitem_Title
, (IPTR
)"Add Autofire Actions",
347 MUIA_Menuitem_Enabled
, FALSE
,
351 Child
, (IPTR
)MenuObjectT((IPTR
)"Settings"),
352 Child
, (IPTR
)(nch
->nch_UseMI
= MenuitemObject
,
353 MUIA_Menuitem_Title
, (IPTR
)"Save",
354 MUIA_Menuitem_Shortcut
, (IPTR
)"S",
356 Child
, (IPTR
)(nch
->nch_SetDefaultMI
= MenuitemObject
,
357 MUIA_Menuitem_Title
, (IPTR
)"Save as Default",
358 MUIA_Menuitem_Shortcut
, (IPTR
)"D",
360 Child
, (IPTR
)MenuitemObject
,
361 MUIA_Menuitem_Title
, (IPTR
)NM_BARLABEL
,
363 Child
, (IPTR
)(nch
->nch_MUIPrefsMI
= MenuitemObject
,
364 MUIA_Menuitem_Title
, (IPTR
)"MUI Settings",
365 MUIA_Menuitem_Shortcut
, (IPTR
)"M",
368 Child
, (IPTR
)MenuObjectT((IPTR
)"Debug"),
369 Child
, (IPTR
)(nch
->nch_DebugReportMI
= MenuitemObject
,
370 MUIA_Menuitem_Title
, (IPTR
)"Report Descriptor",
375 SubWindow
, (IPTR
)(nch
->nch_MainWindow
= WindowObject
,
376 MUIA_Window_ID
, MAKE_ID('M','A','I','N'),
377 MUIA_Window_Title
, (IPTR
)GM_UNIQUENAME(libname
),
378 MUIA_HelpNode
, (IPTR
)GM_UNIQUENAME(libname
),
380 WindowContents
, (IPTR
)VGroup
,
381 Child
, (IPTR
)(nch
->nch_ActionObj
= NewObject(nch
->nch_ActionClass
->mcc_Class
, 0, MUIA_ShowMe
, FALSE
, TAG_END
)),
382 Child
, (IPTR
)RegisterGroup(nch
->nch_Interface
? MainGUIPages
: MainGUIPagesDefault
),
384 MUIA_Register_Frame
, TRUE
,
386 Child
, (IPTR
)VSpace(0),
387 Child
, (IPTR
)ColGroup(2), GroupFrameT(nch
->nch_Interface
? "Device Settings" : "Default Device Settings"),
388 //Child, (IPTR)HSpace(0),
389 Child
, (IPTR
)Label((IPTR
) "Shell console window:"),
390 Child
, (IPTR
)(nch
->nch_ConWindowObj
= StringObject
,
393 MUIA_String_AdvanceOnCR
, TRUE
,
394 MUIA_String_Contents
, (IPTR
)nch
->nch_CDC
->cdc_ShellCon
,
395 MUIA_String_MaxLen
, 127,
397 Child
, (IPTR
)Label((IPTR
) "Shell default stack:"),
398 Child
, (IPTR
)(nch
->nch_ShellStackObj
= StringObject
,
401 MUIA_String_AdvanceOnCR
, TRUE
,
402 MUIA_String_Integer
, nch
->nch_CDC
->cdc_ShellStack
,
403 MUIA_String_Accept
, (IPTR
)"0123456789",
405 Child
, (IPTR
)Label((IPTR
) "Enable keyboard reset:"),
407 Child
, (IPTR
)(nch
->nch_EnableKBResetObj
= ImageObject
, ImageButtonFrame
,
408 MUIA_Background
, MUII_ButtonBack
,
410 MUIA_InputMode
, MUIV_InputMode_Toggle
,
411 MUIA_Image_Spec
, MUII_CheckMark
,
412 MUIA_Image_FreeVert
, TRUE
,
413 MUIA_Selected
, nch
->nch_CDC
->cdc_EnableKBReset
,
414 MUIA_ShowSelState
, FALSE
,
416 Child
, (IPTR
)HSpace(0),
417 Child
, (IPTR
)Label((IPTR
) "Hijack ResetHandlers:"),
418 Child
, (IPTR
)(nch
->nch_EnableRHObj
= ImageObject
, ImageButtonFrame
,
419 MUIA_Background
, MUII_ButtonBack
,
421 MUIA_InputMode
, MUIV_InputMode_Toggle
,
422 MUIA_Image_Spec
, MUII_CheckMark
,
423 MUIA_Image_FreeVert
, TRUE
,
424 MUIA_Selected
, nch
->nch_CDC
->cdc_EnableRH
,
425 MUIA_ShowSelState
, FALSE
,
428 Child
, (IPTR
)Label((IPTR
) "Reset delay:"),
429 Child
, (IPTR
)(nch
->nch_ResetDelayObj
= SliderObject
, SliderFrame
,
432 MUIA_Numeric_Max
, 60,
433 MUIA_Numeric_Value
, nch
->nch_CDC
->cdc_ResetDelay
,
434 MUIA_Numeric_Format
, (IPTR
) "%ldsec",
436 Child
, (IPTR
)Label((IPTR
) "Turbo mouse:"),
438 Child
, (IPTR
)(nch
->nch_TurboMouseObj
= CycleObject
,
440 MUIA_Cycle_Entries
, (IPTR
)TurboMouseStrings
,
441 MUIA_Cycle_Active
, nch
->nch_CDC
->cdc_TurboMouse
,
443 Child
, (IPTR
)HSpace(0),
446 Child
, (IPTR
)VSpace(0),
447 Child
, (IPTR
)ColGroup(2), GroupFrameT("HID Output Control Window"),
448 Child
, (IPTR
)Label((IPTR
) "Open on startup:"),
450 Child
, (IPTR
)(nch
->nch_HIDCtrlAutoObj
= ImageObject
, ImageButtonFrame
,
451 MUIA_Background
, MUII_ButtonBack
,
453 MUIA_InputMode
, MUIV_InputMode_Toggle
,
454 MUIA_Image_Spec
, MUII_CheckMark
,
455 MUIA_Image_FreeVert
, TRUE
,
456 MUIA_Selected
, nch
->nch_CDC
->cdc_HIDCtrlOpen
,
457 MUIA_ShowSelState
, FALSE
,
459 Child
, (IPTR
)HSpace(0),
460 Child
, (IPTR
)(nch
->nch_HIDCtrlOpenObj
= TextObject
, ButtonFrame
,
461 MUIA_ShowMe
, (IPTR
)nch
->nch_Interface
,
462 MUIA_Background
, MUII_ButtonBack
,
464 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
465 MUIA_Text_Contents
, (IPTR
)"\33c Open now ",
468 Child
, (IPTR
)Label((IPTR
) "Window Title:"),
470 Child
, (IPTR
)(nch
->nch_HIDCtrlTitleObj
= StringObject
,
473 MUIA_String_AdvanceOnCR
, TRUE
,
474 MUIA_String_Contents
, (IPTR
)nch
->nch_CDC
->cdc_HIDCtrlTitle
,
475 MUIA_String_MaxLen
, 31,
477 Child
, (IPTR
)Label((IPTR
) "Rexx Port:"),
478 Child
, (IPTR
)(nch
->nch_HIDCtrlRexxObj
= StringObject
,
481 MUIA_String_AdvanceOnCR
, TRUE
,
482 MUIA_String_Contents
, (IPTR
)nch
->nch_CDC
->cdc_HIDCtrlRexx
,
483 MUIA_String_MaxLen
, 31,
487 Child
, (IPTR
)VSpace(0),
488 Child
, (IPTR
)ColGroup(4), GroupFrameT("LowLevel Library Joypad emulation"),
489 Child
, (IPTR
)Label((IPTR
) "Port 0:"),
490 Child
, (IPTR
)(nch
->nch_LLPortModeObj
[0] = CycleObject
,
492 MUIA_Cycle_Entries
, (IPTR
)LLPortStrings
,
493 MUIA_Cycle_Active
, nch
->nch_CDC
->cdc_LLPortMode
[0],
495 Child
, (IPTR
)Label((IPTR
) "Port 2:"),
496 Child
, (IPTR
)(nch
->nch_LLPortModeObj
[2] = CycleObject
,
498 MUIA_Cycle_Entries
, (IPTR
)LLPortStrings
,
499 MUIA_Cycle_Active
, nch
->nch_CDC
->cdc_LLPortMode
[2],
501 Child
, (IPTR
)Label((IPTR
) "Port 1:"),
502 Child
, (IPTR
)(nch
->nch_LLPortModeObj
[1] = CycleObject
,
504 MUIA_Cycle_Entries
, (IPTR
)LLPortStrings
,
505 MUIA_Cycle_Active
, nch
->nch_CDC
->cdc_LLPortMode
[1],
507 Child
, (IPTR
)Label((IPTR
) "Port 3:"),
508 Child
, (IPTR
)(nch
->nch_LLPortModeObj
[3] = CycleObject
,
510 MUIA_Cycle_Entries
, (IPTR
)LLPortStrings
,
511 MUIA_Cycle_Active
, nch
->nch_CDC
->cdc_LLPortMode
[3],
513 Child
, (IPTR
)Label((IPTR
) "Rumble Port:"),
514 Child
, (IPTR
)(nch
->nch_LLRumblePortObj
= CycleObject
,
516 MUIA_Cycle_Entries
, (IPTR
)LLRumbleStrings
,
517 MUIA_Cycle_Active
, nch
->nch_CDC
->cdc_LLRumblePort
,
519 Child
, (IPTR
)HSpace(0),
520 Child
, (IPTR
)HSpace(0),
522 Child
, (IPTR
)VSpace(0),
525 //Child, (IPTR)VSpace(0),
526 Child
, (IPTR
)HGroup
, GroupFrameT((IPTR
)(nch
->nch_Interface
? "Keyboard mapping" : "Default Keyboard mapping")),
529 Child
, (IPTR
)(nch
->nch_USBKeymapLVObj
= ListviewObject
,
530 MUIA_Listview_MultiSelect
, MUIV_Listview_MultiSelect_None
,
531 MUIA_Listview_List
, (IPTR
)ListObject
,
534 MUIA_List_SourceArray
, (IPTR
)nch
->nch_USBKeyArray
,
535 MUIA_List_DisplayHook
, (IPTR
)&nch
->nch_USBKeyListDisplayHook
,
536 MUIA_List_AutoVisible
, TRUE
,
540 Child
, (IPTR
)VSpace(0),
541 Child
, (IPTR
)Label((IPTR
) "->"),
542 Child
, (IPTR
)VSpace(0),
544 Child
, (IPTR
)(nch
->nch_RawKeymapLVObj
= ListviewObject
,
545 MUIA_Listview_Input
, TRUE
,
546 MUIA_Listview_MultiSelect
, MUIV_Listview_MultiSelect_None
,
547 MUIA_Listview_List
, (IPTR
)ListObject
,
550 MUIA_List_SourceArray
, (IPTR
)nch
->nch_RawKeyArray
,
551 MUIA_List_AutoVisible
, TRUE
,
556 Child
, (IPTR
)(nch
->nch_RestoreDefKeymapObj
= TextObject
, ButtonFrame
,
557 MUIA_Background
, MUII_ButtonBack
,
559 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
560 MUIA_Text_Contents
, (IPTR
)"\33c Restore default keymap ",
562 Child
, (IPTR
)HSpace(0),
563 Child
, (IPTR
)(nch
->nch_TrackKeyEventsObj
= ImageObject
, ImageButtonFrame
,
564 MUIA_Background
, MUII_ButtonBack
,
566 MUIA_InputMode
, MUIV_InputMode_Toggle
,
567 MUIA_Image_Spec
, MUII_CheckMark
,
568 MUIA_Image_FreeVert
, TRUE
,
569 MUIA_Disabled
, !nch
->nch_Interface
,
570 MUIA_ShowSelState
, FALSE
,
572 Child
, (IPTR
)Label((IPTR
) "Track incoming key events"),
576 //Child, (IPTR)VSpace(0),
579 //Child, (IPTR)VSpace(0),
580 Child
, (IPTR
)VGroup
, GroupFrameT((IPTR
)"Action handling"),
582 Child
, (IPTR
)VGroup
, GroupFrameT((IPTR
)"Reports and collections"),
583 MUIA_HorizWeight
, 10,
584 Child
, (IPTR
)(nch
->nch_ReportLVObj
= ListviewObject
,
585 MUIA_Listview_MultiSelect
, MUIV_Listview_MultiSelect_None
,
586 MUIA_Listview_List
, (IPTR
)ListObject
,
589 MUIA_List_DisplayHook
, (IPTR
)&nch
->nch_ReportListDisplayHook
,
590 MUIA_List_AutoVisible
, TRUE
,
594 Child
, (IPTR
)(nch
->nch_FillDefObj
= TextObject
, ButtonFrame
,
595 MUIA_Background
, MUII_ButtonBack
,
597 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
598 MUIA_Text_Contents
, (IPTR
)"\33c Fill defaults ",
600 Child
, (IPTR
)(nch
->nch_ClearActionsObj
= TextObject
, ButtonFrame
,
601 MUIA_Background
, MUII_ButtonBack
,
603 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
604 MUIA_Text_Contents
, (IPTR
)"\33c Clear actions ",
608 Child
, (IPTR
)VGroup
, GroupFrameT((IPTR
)"Usage items"),
609 Child
, (IPTR
)(nch
->nch_ItemLVObj
= ListviewObject
,
610 MUIA_Listview_MultiSelect
, MUIV_Listview_MultiSelect_None
,
611 MUIA_Listview_List
, (IPTR
)ListObject
,
614 MUIA_List_DisplayHook
, (IPTR
)&nch
->nch_ItemListDisplayHook
,
615 MUIA_List_Format
, (IPTR
)barbarbarbar
,
616 MUIA_List_Title
, TRUE
,
617 MUIA_List_AutoVisible
, TRUE
,
623 Child
, (IPTR
)(nch
->nch_TrackEventsObj
= ImageObject
, ImageButtonFrame
,
624 MUIA_Background
, MUII_ButtonBack
,
626 MUIA_InputMode
, MUIV_InputMode_Toggle
,
627 MUIA_Image_Spec
, MUII_CheckMark
,
628 MUIA_Image_FreeVert
, TRUE
,
630 MUIA_ShowSelState
, FALSE
,
632 Child
, (IPTR
)Label((IPTR
) "Track incoming events"),
633 Child
, (IPTR
)HSpace(0),
634 Child
, (IPTR
)(nch
->nch_ReportValuesObj
= ImageObject
, ImageButtonFrame
,
635 MUIA_Background
, MUII_ButtonBack
,
637 MUIA_InputMode
, MUIV_InputMode_Toggle
,
638 MUIA_Image_Spec
, MUII_CheckMark
,
639 MUIA_Image_FreeVert
, TRUE
,
641 MUIA_ShowSelState
, FALSE
,
643 Child
, (IPTR
)Label((IPTR
) "Report current values"),
644 Child
, (IPTR
)HSpace(0),
645 Child
, (IPTR
)(nch
->nch_DisableActionsObj
= ImageObject
, ImageButtonFrame
,
646 MUIA_Background
, MUII_ButtonBack
,
648 MUIA_InputMode
, MUIV_InputMode_Toggle
,
649 MUIA_Image_Spec
, MUII_CheckMark
,
650 MUIA_Image_FreeVert
, TRUE
,
652 MUIA_ShowSelState
, FALSE
,
654 Child
, (IPTR
)Label((IPTR
) "Disable all actions"),
656 Child
, (IPTR
)HGroup
, GroupFrameT("Performed actions"),
658 Child
, (IPTR
)(nch
->nch_ActionLVObj
= ListviewObject
,
659 MUIA_Listview_MultiSelect
, MUIV_Listview_MultiSelect_None
,
660 MUIA_Listview_List
, (IPTR
)ListObject
,
663 MUIA_List_DisplayHook
, (IPTR
)&nch
->nch_ActionListDisplayHook
,
664 MUIA_List_Format
, (IPTR
)barbar
,
665 MUIA_List_Title
, TRUE
,
666 MUIA_List_AutoVisible
, TRUE
,
670 Child
, (IPTR
)(nch
->nch_ActionNewObj
= TextObject
, ButtonFrame
,
671 MUIA_Background
, MUII_ButtonBack
,
673 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
674 MUIA_Text_Contents
, (IPTR
)"\33c New ",
676 Child
, (IPTR
)(nch
->nch_ActionCopyObj
= TextObject
, ButtonFrame
,
677 MUIA_Background
, MUII_ButtonBack
,
679 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
680 MUIA_Text_Contents
, (IPTR
)"\33c Copy ",
682 Child
, (IPTR
)(nch
->nch_ActionDelObj
= TextObject
, ButtonFrame
,
683 MUIA_Background
, MUII_ButtonBack
,
685 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
686 MUIA_Text_Contents
, (IPTR
)"\33c Del ",
688 Child
, (IPTR
)(nch
->nch_ActionUpObj
= TextObject
, ButtonFrame
,
689 MUIA_Background
, MUII_ButtonBack
,
691 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
692 MUIA_Text_Contents
, (IPTR
)"\33c Up ",
694 Child
, (IPTR
)(nch
->nch_ActionDownObj
= TextObject
, ButtonFrame
,
695 MUIA_Background
, MUII_ButtonBack
,
697 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
698 MUIA_Text_Contents
, (IPTR
)"\33c Down ",
702 Child
, (IPTR
)(nch
->nch_ActionAreaObj
= VGroup
,
705 Child
, (IPTR
)(nch
->nch_ActionSelectorObj
= CycleObject
,
707 MUIA_Cycle_Entries
, (IPTR
)ActionTypeStrings
,
708 MUIA_Cycle_Active
, 0,
710 Child
, (IPTR
)Label((IPTR
) "Trigger:"),
711 Child
, (IPTR
)(nch
->nch_ActionTriggerObj
= CycleObject
,
713 MUIA_Cycle_Entries
, (IPTR
)ActionTriggerStrings
,
714 MUIA_Cycle_Active
, 0,
718 Child
, (IPTR
)Label((IPTR
) "Opts:"),
719 Child
, (IPTR
)(nch
->nch_ActionAbsToRelObj
= TextObject
, ButtonFrame
,
720 MUIA_Background
, MUII_ButtonBack
,
722 MUIA_InputMode
, MUIV_InputMode_Toggle
,
723 MUIA_Text_Contents
, (IPTR
)"\33c Abs->Rel ",
725 Child
, (IPTR
)(nch
->nch_ActionClipEnableObj
= TextObject
, ButtonFrame
,
726 MUIA_Background
, MUII_ButtonBack
,
728 MUIA_InputMode
, MUIV_InputMode_Toggle
,
729 MUIA_Text_Contents
, (IPTR
)"\33c Clip ",
731 Child
, (IPTR
)(nch
->nch_ActionScaleEnableObj
= TextObject
, ButtonFrame
,
732 MUIA_Background
, MUII_ButtonBack
,
734 MUIA_InputMode
, MUIV_InputMode_Toggle
,
735 MUIA_Text_Contents
, (IPTR
)"\33c Scale ",
737 Child
, (IPTR
)(nch
->nch_ActionCCEnableObj
= TextObject
, ButtonFrame
,
738 MUIA_Background
, MUII_ButtonBack
,
740 MUIA_InputMode
, MUIV_InputMode_Toggle
,
741 MUIA_Text_Contents
, (IPTR
)"\33c CC ",
743 Child
, (IPTR
)(nch
->nch_ActionValEnableObj
= TextObject
, ButtonFrame
,
744 MUIA_Background
, MUII_ButtonBack
,
746 MUIA_InputMode
, MUIV_InputMode_Toggle
,
747 MUIA_Text_Contents
, (IPTR
)"\33c Val ",
750 Child
, (IPTR
)(nch
->nch_A_ClipGroupObj
= HGroup
, GroupFrameT("Clipping"),
752 Child
, (IPTR
)Label((IPTR
) "Min:"),
753 Child
, (IPTR
)(nch
->nch_A_ClipMinObj
= SliderObject
, SliderFrame
,
756 MUIA_Numeric_Max
, 100,
757 MUIA_Numeric_Format
, (IPTR
)"%ld%%",
759 Child
, (IPTR
)Label((IPTR
) "Max:"),
760 Child
, (IPTR
)(nch
->nch_A_ClipMaxObj
= SliderObject
, SliderFrame
,
763 MUIA_Numeric_Max
, 100,
764 MUIA_Numeric_Format
, (IPTR
)"%ld%%",
766 Child
, (IPTR
)Label((IPTR
) "Stretch:"),
767 Child
, (IPTR
)(nch
->nch_A_ClipStretchObj
= ImageObject
, ImageButtonFrame
,
768 MUIA_Background
, MUII_ButtonBack
,
770 MUIA_InputMode
, MUIV_InputMode_Toggle
,
771 MUIA_Image_Spec
, MUII_CheckMark
,
772 MUIA_Image_FreeVert
, TRUE
,
774 MUIA_ShowSelState
, FALSE
,
777 Child
, (IPTR
)(nch
->nch_A_ScaleGroupObj
= HGroup
, GroupFrameT("Scaling"),
779 Child
, (IPTR
)Label((IPTR
) "Min:"),
780 Child
, (IPTR
)(nch
->nch_A_ScaleMinObj
= StringObject
,
782 MUIA_String_Accept
, (IPTR
)"0123456789-",
784 MUIA_String_AdvanceOnCR
, TRUE
,
785 MUIA_String_MaxLen
, 10,
787 Child
, (IPTR
)Label((IPTR
) "Max:"),
788 Child
, (IPTR
)(nch
->nch_A_ScaleMaxObj
= StringObject
,
790 MUIA_String_Accept
, (IPTR
)"0123456789-",
792 MUIA_String_AdvanceOnCR
, TRUE
,
793 MUIA_String_MaxLen
, 10,
796 Child
, (IPTR
)(nch
->nch_A_CCGroupObj
= VGroup
, GroupFrameT("Pre-condition code"),
799 Child
, (IPTR
)Label((IPTR
) "If"),
800 Child
, (IPTR
)(nch
->nch_A_CCVar1Obj
= CycleObject
,
802 MUIA_Cycle_Entries
, (IPTR
)A_CCVariableStrings
,
804 Child
, (IPTR
)(nch
->nch_A_CCCondObj
= CycleObject
,
806 MUIA_Cycle_Entries
, (IPTR
)A_CCCondStrings
,
808 Child
, (IPTR
)(nch
->nch_A_CCVar2Obj
= CycleObject
,
810 MUIA_Cycle_Entries
, (IPTR
)A_CCVariableStrings
,
814 Child
, (IPTR
)Label((IPTR
) "Left constant:"),
815 Child
, (IPTR
)(nch
->nch_A_CCConst1Obj
= StringObject
,
817 MUIA_String_Accept
, (IPTR
)"0123456789-",
819 MUIA_String_AdvanceOnCR
, TRUE
,
820 MUIA_String_MaxLen
, 10,
822 Child
, (IPTR
)Label((IPTR
) "Right constant:"),
823 Child
, (IPTR
)(nch
->nch_A_CCConst2Obj
= StringObject
,
825 MUIA_String_Accept
, (IPTR
)"0123456789-",
827 MUIA_String_AdvanceOnCR
, TRUE
,
828 MUIA_String_MaxLen
, 10,
832 Child
, (IPTR
)(nch
->nch_A_ValGroupObj
= VGroup
, GroupFrameT("Input value redirection"),
835 Child
, (IPTR
)Label((IPTR
) "Take value for action from"),
836 Child
, (IPTR
)(nch
->nch_A_ValVarObj
= CycleObject
,
838 MUIA_Cycle_Entries
, (IPTR
)A_CCVariableStrings
,
842 Child
, (IPTR
)Label((IPTR
) "Constant:"),
843 Child
, (IPTR
)(nch
->nch_A_ValConstObj
= StringObject
,
845 MUIA_String_Accept
, (IPTR
)"0123456789-",
847 MUIA_String_AdvanceOnCR
, TRUE
,
848 MUIA_String_MaxLen
, 10,
852 Child
, (IPTR
)(nch
->nch_ActionPageObj
= VGroup
,
853 MUIA_Group_PageMode
, TRUE
,
854 //MUIA_Group_ActivePage, MUIV_Group_ActivePage_First,
855 Child
, (IPTR
)VGroup
, GroupFrameT("No action"), /* HUA_NOP */
856 Child
, (IPTR
)VSpace(0),
858 Child
, (IPTR
)HSpace(0),
859 Child
, (IPTR
)Label((IPTR
) "Does absolutely nothing."),
860 Child
, (IPTR
)HSpace(0),
862 Child
, (IPTR
)VSpace(0),
864 Child
, (IPTR
)VGroup
, GroupFrameT("Change key qualifiers"), /* HUA_QUALIFIER */
865 Child
, (IPTR
)VSpace(0),
867 Child
, (IPTR
)HSpace(0),
868 Child
, (IPTR
)(nch
->nch_A_KeyQualOpObj
= CycleObject
,
870 MUIA_Cycle_Entries
, (IPTR
)A_QualOpStrings
,
872 Child
, (IPTR
)Label((IPTR
) "qualifier"),
873 Child
, (IPTR
)(nch
->nch_A_KeyQualObj
= CycleObject
,
875 MUIA_Cycle_Entries
, (IPTR
)A_QualifierStrings
,
877 Child
, (IPTR
)HSpace(0),
879 Child
, (IPTR
)VSpace(0),
881 Child
, (IPTR
)VGroup
, GroupFrameT("USB Keyboard mapping"), /* HUA_KEYMAP */
882 Child
, (IPTR
)VSpace(0),
884 Child
, (IPTR
)HSpace(0),
885 Child
, (IPTR
)Label((IPTR
) "\33cMapping of USB keycodes\nto Amiga rawcodes"),
886 Child
, (IPTR
)HSpace(0),
888 Child
, (IPTR
)VSpace(0),
890 Child
, (IPTR
)VGroup
, GroupFrameT("Raw key"), /* HUA_RAWKEY */
891 //Child, (IPTR)VSpace(0),
892 Child
, (IPTR
)Label((IPTR
) "\33cSelect key to send"),
893 Child
, (IPTR
)(nch
->nch_A_RawKeyObj
= ListviewObject
,
894 MUIA_Listview_Input
, TRUE
,
895 MUIA_Listview_MultiSelect
, MUIV_Listview_MultiSelect_None
,
896 MUIA_Listview_List
, (IPTR
)ListObject
,
899 MUIA_List_SourceArray
, (IPTR
)nch
->nch_RawKeyArray
,
900 MUIA_List_AutoVisible
, TRUE
,
904 Child
, (IPTR
)(nch
->nch_A_RawKeyUpObj
= ImageObject
, ImageButtonFrame
,
905 MUIA_Background
, MUII_ButtonBack
,
907 MUIA_InputMode
, MUIV_InputMode_Toggle
,
908 MUIA_Image_Spec
, MUII_CheckMark
,
909 MUIA_Image_FreeVert
, TRUE
,
911 MUIA_ShowSelState
, FALSE
,
913 Child
, (IPTR
)Label((IPTR
) "Send keyup event instead of keydown"),
914 Child
, (IPTR
)HSpace(0),
916 //Child, (IPTR)VSpace(0),
918 Child
, (IPTR
)VGroup
, GroupFrameT("Vanilla key"), /* HUA_VANILLA */
919 Child
, (IPTR
)VSpace(0),
921 Child
, (IPTR
)Label((IPTR
) "Key to send:"),
922 Child
, (IPTR
)(nch
->nch_A_VanillaStrObj
= StringObject
,
925 MUIA_String_AdvanceOnCR
, TRUE
,
926 MUIA_String_MaxLen
, 80,
929 Child
, (IPTR
)VSpace(0),
931 Child
, (IPTR
)VGroup
, GroupFrameT("Keystring"), /* HUA_KEYSTRING */
932 Child
, (IPTR
)VSpace(0),
934 Child
, (IPTR
)Label((IPTR
) "String to send:"),
935 Child
, (IPTR
)(nch
->nch_A_KeyStringObj
= StringObject
,
938 MUIA_String_AdvanceOnCR
, TRUE
,
939 MUIA_String_MaxLen
, 80,
942 Child
, (IPTR
)VSpace(0),
944 Child
, (IPTR
)VGroup
, GroupFrameT("Mouse pointer position"), /* HUA_MOUSEPOS */
945 Child
, (IPTR
)VSpace(0),
947 Child
, (IPTR
)HSpace(0),
948 Child
, (IPTR
)Label((IPTR
) "Move mouse"),
949 Child
, (IPTR
)(nch
->nch_A_MousePosOpObj
= CycleObject
,
951 MUIA_Cycle_Entries
, (IPTR
)A_MousePosOpStrings
,
953 Child
, (IPTR
)HSpace(0),
955 Child
, (IPTR
)VSpace(0),
957 Child
, (IPTR
)VGroup
, GroupFrameT("Mouse buttons"), /* HUA_BUTTONS */
958 Child
, (IPTR
)VSpace(0),
960 Child
, (IPTR
)HSpace(0),
961 Child
, (IPTR
)(nch
->nch_A_MouseButOpObj
= CycleObject
,
963 MUIA_Cycle_Entries
, (IPTR
)A_MouseButOpStrings
,
965 Child
, (IPTR
)(nch
->nch_A_MouseButObj
= CycleObject
,
967 MUIA_Cycle_Entries
, (IPTR
)A_MouseButStrings
,
969 Child
, (IPTR
)Label((IPTR
) "mouse button"),
970 Child
, (IPTR
)HSpace(0),
972 Child
, (IPTR
)VSpace(0),
974 Child
, (IPTR
)VGroup
, GroupFrameT("Tablet information"), /* HUA_TABLET */
975 Child
, (IPTR
)VSpace(0),
977 Child
, (IPTR
)HSpace(0),
978 Child
, (IPTR
)Label((IPTR
) "Send"),
979 Child
, (IPTR
)(nch
->nch_A_TabletAxisObj
= CycleObject
,
981 MUIA_Cycle_Entries
, (IPTR
)A_TabletAxisStrings
,
983 Child
, (IPTR
)Label((IPTR
) "data"),
984 Child
, (IPTR
)HSpace(0),
986 Child
, (IPTR
)VSpace(0),
988 Child
, (IPTR
)VGroup
, GroupFrameT("Digital joypad (lowlevel.library)"), /* HUA_DIGJOY */
989 Child
, (IPTR
)VSpace(0),
991 Child
, (IPTR
)HSpace(0),
992 Child
, (IPTR
)(nch
->nch_A_JoypadOpObj
= CycleObject
,
994 MUIA_Cycle_Entries
, (IPTR
)A_JoypadOpStrings
,
996 Child
, (IPTR
)(nch
->nch_A_JoypadFeatObj
= CycleObject
,
998 MUIA_Cycle_Entries
, (IPTR
)A_JoypadFeatStrings
,
1000 Child
, (IPTR
)Label((IPTR
) "on"),
1001 Child
, (IPTR
)(nch
->nch_A_JoypadPortObj
= CycleObject
,
1003 MUIA_Cycle_Entries
, (IPTR
)A_JoypadPortStrings
,
1005 Child
, (IPTR
)HSpace(0),
1007 Child
, (IPTR
)VSpace(0),
1009 Child
, (IPTR
)VGroup
, GroupFrameT("Analogue joysticks (lowlevel hack)"), /* HUA_ANALOGJOY */
1010 Child
, (IPTR
)VSpace(0),
1011 Child
, (IPTR
)HGroup
,
1012 Child
, (IPTR
)HSpace(0),
1013 Child
, (IPTR
)Label((IPTR
) "Set"),
1014 Child
, (IPTR
)(nch
->nch_A_APadFeatObj
= CycleObject
,
1016 MUIA_Cycle_Entries
, (IPTR
)A_APadFeatStrings
,
1018 Child
, (IPTR
)Label((IPTR
) "of"),
1019 Child
, (IPTR
)(nch
->nch_A_APadPortObj
= CycleObject
,
1021 MUIA_Cycle_Entries
, (IPTR
)A_JoypadPortStrings
,
1023 Child
, (IPTR
)HSpace(0),
1025 Child
, (IPTR
)VSpace(0),
1027 Child
, (IPTR
)VGroup
, GroupFrameT("Scrollwheel information"), /* HUA_WHEEL */
1028 Child
, (IPTR
)VSpace(0),
1029 Child
, (IPTR
)HGroup
,
1030 Child
, (IPTR
)HSpace(0),
1031 Child
, (IPTR
)Label((IPTR
) "Send"),
1032 Child
, (IPTR
)(nch
->nch_A_WheelOpObj
= CycleObject
,
1034 MUIA_Cycle_Entries
, (IPTR
)A_WheelOpStrings
,
1036 Child
, (IPTR
)Label((IPTR
) "event"),
1037 Child
, (IPTR
)HSpace(0),
1039 Child
, (IPTR
)HGroup
,
1040 Child
, (IPTR
)Label((IPTR
) "Distance:"),
1041 Child
, (IPTR
)(nch
->nch_A_WheelDistObj
= SliderObject
, SliderFrame
,
1043 MUIA_Numeric_Min
, 1,
1044 MUIA_Numeric_Max
, 32,
1047 Child
, (IPTR
)VSpace(0),
1049 Child
, (IPTR
)VGroup
, GroupFrameT("Sound playback"), /* HUA_SOUND */
1050 Child
, (IPTR
)VSpace(0),
1051 Child
, (IPTR
)ColGroup(2),
1052 Child
, (IPTR
)Label((IPTR
) "Soundfile:"),
1053 Child
, (IPTR
)PopaslObject
,
1055 MUIA_Popstring_String
, (IPTR
)(nch
->nch_A_SoundFileObj
= StringObject
,
1058 MUIA_String_AdvanceOnCR
, TRUE
,
1060 MUIA_Popstring_Button
, (IPTR
)PopButton(MUII_PopFile
),
1061 ASLFR_TitleText
, (IPTR
)"Select sound file...",
1063 Child
, (IPTR
)Label((IPTR
) "Volume:"),
1064 Child
, (IPTR
)(nch
->nch_A_SoundVolObj
= SliderObject
, SliderFrame
,
1066 MUIA_Numeric_Min
, 0,
1067 MUIA_Numeric_Max
, 64,
1070 Child
, (IPTR
)VSpace(0),
1072 Child
, (IPTR
)VGroup
, GroupFrameT("Shell command execution"), /* HUA_SHELL */
1073 Child
, (IPTR
)VSpace(0),
1074 Child
, (IPTR
)ColGroup(2),
1075 Child
, (IPTR
)Label((IPTR
) "Command:"),
1076 Child
, (IPTR
)PopaslObject
,
1077 MUIA_Popstring_String
, (IPTR
)(nch
->nch_A_ShellComObj
= StringObject
,
1080 MUIA_String_AdvanceOnCR
, TRUE
,
1082 MUIA_Popstring_Button
, (IPTR
)PopButton(MUII_PopFile
),
1083 ASLFR_TitleText
, (IPTR
) "Select an executable...",
1085 Child
, (IPTR
)Label((IPTR
) "ASync:"),
1086 Child
, (IPTR
)HGroup
,
1087 Child
, (IPTR
)(nch
->nch_A_ShellAsyncObj
= ImageObject
, ImageButtonFrame
,
1088 MUIA_Background
, MUII_ButtonBack
,
1090 MUIA_InputMode
, MUIV_InputMode_Toggle
,
1091 MUIA_Image_Spec
, MUII_CheckMark
,
1092 MUIA_Image_FreeVert
, TRUE
,
1093 MUIA_Selected
, nch
->nch_CDC
->cdc_EnableRH
,
1094 MUIA_ShowSelState
, FALSE
,
1096 Child
, (IPTR
)HSpace(0),
1099 Child
, (IPTR
)VSpace(0),
1101 Child
, (IPTR
)VGroup
, GroupFrameT("Arexx command execution"), /* HUA_AREXX */
1102 Child
, (IPTR
)VSpace(0),
1103 Child
, (IPTR
)HGroup
,
1104 Child
, (IPTR
)HSpace(0),
1105 Child
, (IPTR
)Label((IPTR
) "Sorry, not yet implemented."),
1106 Child
, (IPTR
)HSpace(0),
1108 Child
, (IPTR
)VSpace(0),
1110 Child
, (IPTR
)VGroup
, GroupFrameT("HID output variables"), /* HUA_OUTPUT */
1111 Child
, (IPTR
)(nch
->nch_A_OutItemLVObj
= ListviewObject
,
1112 MUIA_Listview_MultiSelect
, MUIV_Listview_MultiSelect_None
,
1113 MUIA_Listview_List
, (IPTR
)ListObject
,
1116 MUIA_List_DisplayHook
, (IPTR
)&nch
->nch_ItemListDisplayHook
,
1117 MUIA_List_Format
, (IPTR
)barbarbarbar
,
1118 MUIA_List_Title
, TRUE
,
1119 MUIA_List_AutoVisible
, TRUE
,
1122 //Child, (IPTR)VSpace(0),
1123 Child
, (IPTR
)HGroup
,
1124 Child
, (IPTR
)Label((IPTR
) "Array values:"),
1125 Child
, (IPTR
)(nch
->nch_A_OutArrayObj
= StringObject
,
1128 MUIA_String_AdvanceOnCR
, TRUE
,
1129 MUIA_String_MaxLen
, 256,
1132 Child
, (IPTR
)HGroup
,
1133 Child
, (IPTR
)Label((IPTR
) "Operation:"),
1134 Child
, (IPTR
)(nch
->nch_A_OutOpObj
= CycleObject
,
1136 MUIA_Cycle_Entries
, (IPTR
)A_OutOpStrings
,
1140 Child
, (IPTR
)VGroup
, GroupFrameT("HID feature variables"), /* HUA_FEATURE */
1141 Child
, (IPTR
)(nch
->nch_A_FeatItemLVObj
= ListviewObject
,
1142 MUIA_Listview_MultiSelect
, MUIV_Listview_MultiSelect_None
,
1143 MUIA_Listview_List
, (IPTR
)ListObject
,
1146 MUIA_List_DisplayHook
, (IPTR
)&nch
->nch_ItemListDisplayHook
,
1147 MUIA_List_Format
, (IPTR
)barbarbarbar
,
1148 MUIA_List_Title
, TRUE
,
1149 MUIA_List_AutoVisible
, TRUE
,
1152 //Child, (IPTR)VSpace(0),
1153 Child
, (IPTR
)HGroup
,
1154 Child
, (IPTR
)Label((IPTR
) "Array values:"),
1155 Child
, (IPTR
)(nch
->nch_A_FeatArrayObj
= StringObject
,
1158 MUIA_String_AdvanceOnCR
, TRUE
,
1159 MUIA_String_MaxLen
, 256,
1162 Child
, (IPTR
)HGroup
,
1163 Child
, (IPTR
)Label((IPTR
) "Operation:"),
1164 Child
, (IPTR
)(nch
->nch_A_FeatOpObj
= CycleObject
,
1166 MUIA_Cycle_Entries
, (IPTR
)A_OutOpStrings
,
1170 Child
, (IPTR
)VGroup
, GroupFrameT("Miscellaneous stuff"), /* HUA_MISC */
1171 Child
, (IPTR
)VSpace(0),
1172 Child
, (IPTR
)HGroup
,
1173 Child
, (IPTR
)HSpace(0),
1174 Child
, (IPTR
)Label((IPTR
) "Event:"),
1175 Child
, (IPTR
)(nch
->nch_A_MiscOpObj
= CycleObject
,
1177 MUIA_Cycle_Entries
, (IPTR
)A_MiscOpStrings
,
1179 Child
, (IPTR
)HSpace(0),
1181 Child
, (IPTR
)VSpace(0),
1183 Child
, (IPTR
)VGroup
, GroupFrameT("Changing variables"), /* HUA_VARIABLES */
1184 Child
, (IPTR
)VSpace(0),
1185 Child
, (IPTR
)HGroup
,
1186 Child
, (IPTR
)(nch
->nch_A_TarVarObj
= CycleObject
,
1188 MUIA_Cycle_Entries
, (IPTR
)A_TarVariableStrings
,
1190 Child
, (IPTR
)(nch
->nch_A_TarVarOpObj
= CycleObject
,
1192 MUIA_Cycle_Entries
, (IPTR
)A_TarVarOpStrings
,
1195 Child
, (IPTR
)VSpace(0),
1197 Child
, (IPTR
)VGroup
, GroupFrameT("Extended Raw key"), /* HUA_EXTRAWKEY */
1198 //Child, (IPTR)VSpace(0),
1199 Child
, (IPTR
)Label((IPTR
) "\33cSelect key to send"),
1200 Child
, (IPTR
)(nch
->nch_A_ExtRawKeyObj
= ListviewObject
,
1201 MUIA_Listview_Input
, TRUE
,
1202 MUIA_Listview_MultiSelect
, MUIV_Listview_MultiSelect_None
,
1203 MUIA_Listview_List
, (IPTR
)ListObject
,
1206 MUIA_List_SourceArray
, (IPTR
)nch
->nch_ExtRawKeyArray
,
1207 MUIA_List_AutoVisible
, TRUE
,
1210 Child
, (IPTR
)HGroup
,
1211 Child
, (IPTR
)(nch
->nch_A_ExtRawKeyUpObj
= ImageObject
, ImageButtonFrame
,
1212 MUIA_Background
, MUII_ButtonBack
,
1214 MUIA_InputMode
, MUIV_InputMode_Toggle
,
1215 MUIA_Image_Spec
, MUII_CheckMark
,
1216 MUIA_Image_FreeVert
, TRUE
,
1217 MUIA_ShowSelState
, FALSE
,
1219 Child
, (IPTR
)Label((IPTR
) "Send keyup event instead of keydown"),
1220 Child
, (IPTR
)HSpace(0),
1222 //Child, (IPTR)VSpace(0),
1228 //Child, (IPTR)VSpace(0),
1231 //Child, (IPTR)VSpace(0),
1232 Child
, (IPTR
)HGroup
,
1233 MUIA_Group_SameWidth
, TRUE
,
1234 Child
, (IPTR
)(nch
->nch_UseObj
= TextObject
, ButtonFrame
,
1235 MUIA_ShowMe
, (IPTR
)nch
->nch_Interface
,
1236 MUIA_Background
, MUII_ButtonBack
,
1238 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
1239 MUIA_Text_Contents
, (IPTR
)"\33c Save ",
1241 Child
, (IPTR
)(nch
->nch_SetDefaultObj
= TextObject
, ButtonFrame
,
1242 MUIA_Background
, MUII_ButtonBack
,
1244 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
1245 MUIA_Text_Contents
, (IPTR
)(nch
->nch_Interface
? "\33c Save as Default " : "\33c Save Defaults "),
1247 Child
, (IPTR
)(nch
->nch_CloseObj
= TextObject
, ButtonFrame
,
1248 MUIA_Background
, MUII_ButtonBack
,
1250 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
1251 MUIA_Text_Contents
, (IPTR
)"\33c Use ",
1260 KPRINTF(10, ("Couldn't create application\n"));
1261 GM_UNIQUENAME(nGUITaskCleanup
)(nch
);
1266 struct ActionData
*ad
= INST_DATA(nch
->nch_ActionClass
->mcc_Class
, nch
->nch_ActionObj
);
1270 nch
->nch_GUICurrentColl
= NULL
;
1271 nch
->nch_GUICurrentItem
= NULL
;
1272 nch
->nch_QuitGUI
= FALSE
;
1274 DoMethod(nch
->nch_MainWindow
, MUIM_Notify
, MUIA_Window_CloseRequest
, TRUE
,
1275 nch
->nch_ActionObj
, 1, MUIM_Action_UseConfig
);
1276 DoMethod(nch
->nch_UseObj
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
1277 nch
->nch_ActionObj
, 1, MUIM_Action_StoreConfig
);
1278 DoMethod(nch
->nch_SetDefaultObj
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
1279 nch
->nch_ActionObj
, 1, MUIM_Action_DefaultConfig
);
1280 DoMethod(nch
->nch_CloseObj
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
1281 nch
->nch_ActionObj
, 1, MUIM_Action_UseConfig
);
1283 DoMethod(nch
->nch_AboutMI
, MUIM_Notify
, MUIA_Menuitem_Trigger
, MUIV_EveryTime
,
1284 nch
->nch_ActionObj
, 1, MUIM_Action_About
);
1285 DoMethod(nch
->nch_UseMI
, MUIM_Notify
, MUIA_Menuitem_Trigger
, MUIV_EveryTime
,
1286 nch
->nch_ActionObj
, 1, MUIM_Action_StoreConfig
);
1287 DoMethod(nch
->nch_SetDefaultMI
, MUIM_Notify
, MUIA_Menuitem_Trigger
, MUIV_EveryTime
,
1288 nch
->nch_ActionObj
, 1, MUIM_Action_DefaultConfig
);
1289 DoMethod(nch
->nch_MUIPrefsMI
, MUIM_Notify
, MUIA_Menuitem_Trigger
, MUIV_EveryTime
,
1290 nch
->nch_App
, 2, MUIM_Application_OpenConfigWindow
, 0);
1291 DoMethod(nch
->nch_SwapLMBRMBMI
, MUIM_Notify
, MUIA_Menuitem_Trigger
, MUIV_EveryTime
,
1292 nch
->nch_ActionObj
, 1, MUIM_Action_SwapLMBRMB
);
1293 DoMethod(nch
->nch_MouseAccel100MI
, MUIM_Notify
, MUIA_Menuitem_Trigger
, MUIV_EveryTime
,
1294 nch
->nch_ActionObj
, 2, MUIM_Action_SetMouseAccel
, 100);
1295 DoMethod(nch
->nch_MouseAccel150MI
, MUIM_Notify
, MUIA_Menuitem_Trigger
, MUIV_EveryTime
,
1296 nch
->nch_ActionObj
, 2, MUIM_Action_SetMouseAccel
, 150);
1297 DoMethod(nch
->nch_MouseAccel200MI
, MUIM_Notify
, MUIA_Menuitem_Trigger
, MUIV_EveryTime
,
1298 nch
->nch_ActionObj
, 2, MUIM_Action_SetMouseAccel
, 200);
1299 DoMethod(nch
->nch_JoyPort0MI
, MUIM_Notify
, MUIA_Menuitem_Trigger
, MUIV_EveryTime
,
1300 nch
->nch_ActionObj
, 2, MUIM_Action_SetJoyPort
, 0);
1301 DoMethod(nch
->nch_JoyPort1MI
, MUIM_Notify
, MUIA_Menuitem_Trigger
, MUIV_EveryTime
,
1302 nch
->nch_ActionObj
, 2, MUIM_Action_SetJoyPort
, 1);
1303 DoMethod(nch
->nch_JoyPort2MI
, MUIM_Notify
, MUIA_Menuitem_Trigger
, MUIV_EveryTime
,
1304 nch
->nch_ActionObj
, 2, MUIM_Action_SetJoyPort
, 2);
1305 DoMethod(nch
->nch_JoyPort3MI
, MUIM_Notify
, MUIA_Menuitem_Trigger
, MUIV_EveryTime
,
1306 nch
->nch_ActionObj
, 2, MUIM_Action_SetJoyPort
, 3);
1307 DoMethod(nch
->nch_JoyAutofireMI
, MUIM_Notify
, MUIA_Menuitem_Trigger
, MUIV_EveryTime
,
1308 nch
->nch_ActionObj
, 1, MUIM_Action_AddAutofire
);
1310 DoMethod(nch
->nch_DebugReportMI
, MUIM_Notify
, MUIA_Menuitem_Trigger
, MUIV_EveryTime
,
1311 nch
->nch_ActionObj
, 1, MUIM_Action_DebugReport
);
1313 DoMethod(nch
->nch_EnableKBResetObj
, MUIM_Notify
, MUIA_Selected
, MUIV_EveryTime
,
1314 nch
->nch_ActionObj
, 1, MUIM_Action_UpdateDevPrefs
);
1315 DoMethod(nch
->nch_EnableRHObj
, MUIM_Notify
, MUIA_Selected
, MUIV_EveryTime
,
1316 nch
->nch_ActionObj
, 1, MUIM_Action_UpdateDevPrefs
);
1317 DoMethod(nch
->nch_ResetDelayObj
, MUIM_Notify
, MUIA_Numeric_Value
, MUIV_EveryTime
,
1318 nch
->nch_ActionObj
, 1, MUIM_Action_UpdateDevPrefs
);
1319 DoMethod(nch
->nch_ShellStackObj
, MUIM_Notify
, MUIA_String_Integer
, MUIV_EveryTime
,
1320 nch
->nch_ActionObj
, 1, MUIM_Action_UpdateDevPrefs
);
1321 DoMethod(nch
->nch_TurboMouseObj
, MUIM_Notify
, MUIA_Cycle_Active
, MUIV_EveryTime
,
1322 nch
->nch_ActionObj
, 1, MUIM_Action_UpdateDevPrefs
);
1324 DoMethod(nch
->nch_HIDCtrlAutoObj
, MUIM_Notify
, MUIA_Selected
, MUIV_EveryTime
,
1325 nch
->nch_ActionObj
, 1, MUIM_Action_UpdateDevPrefs
);
1326 DoMethod(nch
->nch_HIDCtrlOpenObj
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
1327 nch
->nch_ActionObj
, 1, MUIM_Action_ShowHIDControl
);
1329 for(count
= 0; count
< 4; count
++)
1331 DoMethod(nch
->nch_LLPortModeObj
[count
], MUIM_Notify
, MUIA_Cycle_Active
, MUIV_EveryTime
,
1332 nch
->nch_ActionObj
, 1, MUIM_Action_UpdateDevPrefs
);
1334 DoMethod(nch
->nch_LLRumblePortObj
, MUIM_Notify
, MUIA_Cycle_Active
, MUIV_EveryTime
,
1335 nch
->nch_ActionObj
, 1, MUIM_Action_UpdateDevPrefs
);
1337 DoMethod(nch
->nch_USBKeymapLVObj
, MUIM_Notify
, MUIA_List_Active
, MUIV_EveryTime
,
1338 nch
->nch_ActionObj
, 1, MUIM_Action_KeymapSelectUSB
);
1339 DoMethod(nch
->nch_RawKeymapLVObj
, MUIM_Notify
, MUIA_List_Active
, MUIV_EveryTime
,
1340 nch
->nch_ActionObj
, 1, MUIM_Action_KeymapSelectRaw
);
1341 DoMethod(nch
->nch_RestoreDefKeymapObj
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
1342 nch
->nch_ActionObj
, 1, MUIM_Action_RestDefKeymap
);
1343 DoMethod(nch
->nch_TrackKeyEventsObj
, MUIM_Notify
, MUIA_Selected
, MUIV_EveryTime
,
1344 nch
->nch_ActionObj
, 1, MUIM_Action_SetTracking
);
1346 DoMethod(nch
->nch_ActionSelectorObj
, MUIM_Notify
, MUIA_Cycle_Active
, MUIV_EveryTime
,
1347 nch
->nch_ActionPageObj
, 3, MUIM_Set
, MUIA_Group_ActivePage
, MUIV_TriggerValue
);
1349 DoMethod(nch
->nch_ReportLVObj
, MUIM_Notify
, MUIA_List_Active
, MUIV_EveryTime
,
1350 nch
->nch_ActionObj
, 1, MUIM_Action_SelectReport
);
1352 DoMethod(nch
->nch_FillDefObj
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
1353 nch
->nch_ActionObj
, 1, MUIM_Action_FillDefReport
);
1354 DoMethod(nch
->nch_ClearActionsObj
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
1355 nch
->nch_ActionObj
, 1, MUIM_Action_ClearReport
);
1357 DoMethod(nch
->nch_TrackEventsObj
, MUIM_Notify
, MUIA_Selected
, MUIV_EveryTime
,
1358 nch
->nch_ActionObj
, 1, MUIM_Action_SetTracking
);
1359 DoMethod(nch
->nch_ReportValuesObj
, MUIM_Notify
, MUIA_Selected
, MUIV_EveryTime
,
1360 nch
->nch_ActionObj
, 1, MUIM_Action_SetTracking
);
1361 DoMethod(nch
->nch_DisableActionsObj
, MUIM_Notify
, MUIA_Selected
, MUIV_EveryTime
,
1362 nch
->nch_ActionObj
, 1, MUIM_Action_SetTracking
);
1364 DoMethod(nch
->nch_ItemLVObj
, MUIM_Notify
, MUIA_List_Active
, MUIV_EveryTime
,
1365 nch
->nch_ActionObj
, 1, MUIM_Action_SelectItem
);
1367 DoMethod(nch
->nch_ActionLVObj
, MUIM_Notify
, MUIA_List_Active
, MUIV_EveryTime
,
1368 nch
->nch_ActionObj
, 1, MUIM_Action_SelectAction
);
1370 DoMethod(nch
->nch_ActionNewObj
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
1371 nch
->nch_ActionObj
, 1, MUIM_Action_NewAction
);
1372 DoMethod(nch
->nch_ActionCopyObj
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
1373 nch
->nch_ActionObj
, 1, MUIM_Action_CopyAction
);
1374 DoMethod(nch
->nch_ActionDelObj
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
1375 nch
->nch_ActionObj
, 1, MUIM_Action_DelAction
);
1376 DoMethod(nch
->nch_ActionUpObj
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
1377 nch
->nch_ActionObj
, 1, MUIM_Action_MoveActionUp
);
1378 DoMethod(nch
->nch_ActionDownObj
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
1379 nch
->nch_ActionObj
, 1, MUIM_Action_MoveActionDown
);
1381 DoMethod(nch
->nch_ActionClipEnableObj
, MUIM_Notify
, MUIA_Selected
, MUIV_EveryTime
,
1382 nch
->nch_A_ClipGroupObj
, 3, MUIM_Set
, MUIA_ShowMe
, MUIV_TriggerValue
);
1383 DoMethod(nch
->nch_ActionScaleEnableObj
, MUIM_Notify
, MUIA_Selected
, MUIV_EveryTime
,
1384 nch
->nch_A_ScaleGroupObj
, 3, MUIM_Set
, MUIA_ShowMe
, MUIV_TriggerValue
);
1385 DoMethod(nch
->nch_ActionCCEnableObj
, MUIM_Notify
, MUIA_Selected
, MUIV_EveryTime
,
1386 nch
->nch_A_CCGroupObj
, 3, MUIM_Set
, MUIA_ShowMe
, MUIV_TriggerValue
);
1387 DoMethod(nch
->nch_ActionValEnableObj
, MUIM_Notify
, MUIA_Selected
, MUIV_EveryTime
,
1388 nch
->nch_A_ValGroupObj
, 3, MUIM_Set
, MUIA_ShowMe
, MUIV_TriggerValue
);
1390 DoMethod(nch
->nch_ActionSelectorObj
, MUIM_Notify
, MUIA_Cycle_Active
, MUIV_EveryTime
,
1391 nch
->nch_ActionObj
, 1, MUIM_Action_SetActionType
);
1392 DoMethod(nch
->nch_ActionTriggerObj
, MUIM_Notify
, MUIA_Cycle_Active
, MUIV_EveryTime
,
1393 nch
->nch_ActionObj
, 1, MUIM_Action_UpdateAction
);
1395 DoMethod(nch
->nch_ActionAbsToRelObj
, MUIM_Notify
, MUIA_Selected
, MUIV_EveryTime
,
1396 nch
->nch_ActionObj
, 1, MUIM_Action_UpdateAOptions
);
1397 DoMethod(nch
->nch_ActionClipEnableObj
, MUIM_Notify
, MUIA_Selected
, MUIV_EveryTime
,
1398 nch
->nch_ActionObj
, 1, MUIM_Action_UpdateAOptions
);
1399 DoMethod(nch
->nch_ActionScaleEnableObj
, MUIM_Notify
, MUIA_Selected
, MUIV_EveryTime
,
1400 nch
->nch_ActionObj
, 1, MUIM_Action_UpdateAOptions
);
1401 DoMethod(nch
->nch_ActionCCEnableObj
, MUIM_Notify
, MUIA_Selected
, MUIV_EveryTime
,
1402 nch
->nch_ActionObj
, 1, MUIM_Action_UpdateAOptions
);
1403 DoMethod(nch
->nch_ActionValEnableObj
, MUIM_Notify
, MUIA_Selected
, MUIV_EveryTime
,
1404 nch
->nch_ActionObj
, 1, MUIM_Action_UpdateAOptions
);
1406 DoMethod(nch
->nch_A_ClipMinObj
, MUIM_Notify
, MUIA_Numeric_Value
, MUIV_EveryTime
,
1407 nch
->nch_ActionObj
, 1, MUIM_Action_UpdateAOptions
);
1408 DoMethod(nch
->nch_A_ClipMaxObj
, MUIM_Notify
, MUIA_Numeric_Value
, MUIV_EveryTime
,
1409 nch
->nch_ActionObj
, 1, MUIM_Action_UpdateAOptions
);
1410 DoMethod(nch
->nch_A_ClipStretchObj
, MUIM_Notify
, MUIA_Selected
, MUIV_EveryTime
,
1411 nch
->nch_ActionObj
, 1, MUIM_Action_UpdateAOptions
);
1413 DoMethod(nch
->nch_A_ScaleMinObj
, MUIM_Notify
, MUIA_String_Contents
, MUIV_EveryTime
,
1414 nch
->nch_ActionObj
, 1, MUIM_Action_UpdateAOptions
);
1415 DoMethod(nch
->nch_A_ScaleMaxObj
, MUIM_Notify
, MUIA_String_Contents
, MUIV_EveryTime
,
1416 nch
->nch_ActionObj
, 1, MUIM_Action_UpdateAOptions
);
1418 DoMethod(nch
->nch_A_CCVar1Obj
, MUIM_Notify
, MUIA_Cycle_Active
, MUIV_EveryTime
,
1419 nch
->nch_ActionObj
, 1, MUIM_Action_UpdateAOptions
);
1420 DoMethod(nch
->nch_A_CCCondObj
, MUIM_Notify
, MUIA_Cycle_Active
, MUIV_EveryTime
,
1421 nch
->nch_ActionObj
, 1, MUIM_Action_UpdateAOptions
);
1422 DoMethod(nch
->nch_A_CCVar2Obj
, MUIM_Notify
, MUIA_Cycle_Active
, MUIV_EveryTime
,
1423 nch
->nch_ActionObj
, 1, MUIM_Action_UpdateAOptions
);
1424 DoMethod(nch
->nch_A_CCConst1Obj
, MUIM_Notify
, MUIA_String_Contents
, MUIV_EveryTime
,
1425 nch
->nch_ActionObj
, 1, MUIM_Action_UpdateAOptions
);
1426 DoMethod(nch
->nch_A_CCConst2Obj
, MUIM_Notify
, MUIA_String_Contents
, MUIV_EveryTime
,
1427 nch
->nch_ActionObj
, 1, MUIM_Action_UpdateAOptions
);
1429 DoMethod(nch
->nch_A_ValVarObj
, MUIM_Notify
, MUIA_Cycle_Active
, MUIV_EveryTime
,
1430 nch
->nch_ActionObj
, 1, MUIM_Action_UpdateAOptions
);
1431 DoMethod(nch
->nch_A_ValConstObj
, MUIM_Notify
, MUIA_String_Contents
, MUIV_EveryTime
,
1432 nch
->nch_ActionObj
, 1, MUIM_Action_UpdateAOptions
);
1434 DoMethod(nch
->nch_A_KeyQualObj
, MUIM_Notify
, MUIA_Cycle_Active
, MUIV_EveryTime
,
1435 nch
->nch_ActionObj
, 1, MUIM_Action_UpdateAction
);
1436 DoMethod(nch
->nch_A_KeyQualOpObj
, MUIM_Notify
, MUIA_Cycle_Active
, MUIV_EveryTime
,
1437 nch
->nch_ActionObj
, 1, MUIM_Action_UpdateAction
);
1438 DoMethod(nch
->nch_A_RawKeyObj
, MUIM_Notify
, MUIA_List_Active
, MUIV_EveryTime
,
1439 nch
->nch_ActionObj
, 1, MUIM_Action_UpdateAction
);
1440 DoMethod(nch
->nch_A_RawKeyUpObj
, MUIM_Notify
, MUIA_Selected
, MUIV_EveryTime
,
1441 nch
->nch_ActionObj
, 1, MUIM_Action_UpdateAction
);
1442 DoMethod(nch
->nch_A_VanillaStrObj
, MUIM_Notify
, MUIA_String_Contents
, MUIV_EveryTime
,
1443 nch
->nch_ActionObj
, 1, MUIM_Action_UpdateAction
);
1444 DoMethod(nch
->nch_A_KeyStringObj
, MUIM_Notify
, MUIA_String_Contents
, MUIV_EveryTime
,
1445 nch
->nch_ActionObj
, 1, MUIM_Action_UpdateAction
);
1446 DoMethod(nch
->nch_A_MousePosOpObj
, MUIM_Notify
, MUIA_Cycle_Active
, MUIV_EveryTime
,
1447 nch
->nch_ActionObj
, 1, MUIM_Action_UpdateAction
);
1448 DoMethod(nch
->nch_A_MouseButOpObj
, MUIM_Notify
, MUIA_Cycle_Active
, MUIV_EveryTime
,
1449 nch
->nch_ActionObj
, 1, MUIM_Action_UpdateAction
);
1450 DoMethod(nch
->nch_A_MouseButObj
, MUIM_Notify
, MUIA_Cycle_Active
, MUIV_EveryTime
,
1451 nch
->nch_ActionObj
, 1, MUIM_Action_UpdateAction
);
1452 DoMethod(nch
->nch_A_TabletAxisObj
, MUIM_Notify
, MUIA_Cycle_Active
, MUIV_EveryTime
,
1453 nch
->nch_ActionObj
, 1, MUIM_Action_UpdateAction
);
1454 DoMethod(nch
->nch_A_WheelOpObj
, MUIM_Notify
, MUIA_Cycle_Active
, MUIV_EveryTime
,
1455 nch
->nch_ActionObj
, 1, MUIM_Action_UpdateAction
);
1456 DoMethod(nch
->nch_A_WheelDistObj
, MUIM_Notify
, MUIA_Numeric_Value
, MUIV_EveryTime
,
1457 nch
->nch_ActionObj
, 1, MUIM_Action_UpdateAction
);
1458 DoMethod(nch
->nch_A_JoypadOpObj
, MUIM_Notify
, MUIA_Cycle_Active
, MUIV_EveryTime
,
1459 nch
->nch_ActionObj
, 1, MUIM_Action_UpdateAction
);
1460 DoMethod(nch
->nch_A_JoypadFeatObj
, MUIM_Notify
, MUIA_Cycle_Active
, MUIV_EveryTime
,
1461 nch
->nch_ActionObj
, 1, MUIM_Action_UpdateAction
);
1462 DoMethod(nch
->nch_A_JoypadPortObj
, MUIM_Notify
, MUIA_Cycle_Active
, MUIV_EveryTime
,
1463 nch
->nch_ActionObj
, 1, MUIM_Action_UpdateAction
);
1464 DoMethod(nch
->nch_A_APadFeatObj
, MUIM_Notify
, MUIA_Cycle_Active
, MUIV_EveryTime
,
1465 nch
->nch_ActionObj
, 1, MUIM_Action_UpdateAction
);
1466 DoMethod(nch
->nch_A_APadPortObj
, MUIM_Notify
, MUIA_Cycle_Active
, MUIV_EveryTime
,
1467 nch
->nch_ActionObj
, 1, MUIM_Action_UpdateAction
);
1468 DoMethod(nch
->nch_A_SoundFileObj
, MUIM_Notify
, MUIA_String_Contents
, MUIV_EveryTime
,
1469 nch
->nch_ActionObj
, 1, MUIM_Action_UpdateAction
);
1470 DoMethod(nch
->nch_A_SoundVolObj
, MUIM_Notify
, MUIA_Numeric_Value
, MUIV_EveryTime
,
1471 nch
->nch_ActionObj
, 1, MUIM_Action_UpdateAction
);
1472 DoMethod(nch
->nch_A_ShellComObj
, MUIM_Notify
, MUIA_String_Contents
, MUIV_EveryTime
,
1473 nch
->nch_ActionObj
, 1, MUIM_Action_UpdateAction
);
1474 DoMethod(nch
->nch_A_ShellAsyncObj
, MUIM_Notify
, MUIA_Selected
, MUIV_EveryTime
,
1475 nch
->nch_ActionObj
, 1, MUIM_Action_UpdateAction
);
1476 DoMethod(nch
->nch_A_MiscOpObj
, MUIM_Notify
, MUIA_Cycle_Active
, MUIV_EveryTime
,
1477 nch
->nch_ActionObj
, 1, MUIM_Action_UpdateAction
);
1478 DoMethod(nch
->nch_A_TarVarObj
, MUIM_Notify
, MUIA_Cycle_Active
, MUIV_EveryTime
,
1479 nch
->nch_ActionObj
, 1, MUIM_Action_UpdateAction
);
1480 DoMethod(nch
->nch_A_TarVarOpObj
, MUIM_Notify
, MUIA_Cycle_Active
, MUIV_EveryTime
,
1481 nch
->nch_ActionObj
, 1, MUIM_Action_UpdateAction
);
1482 DoMethod(nch
->nch_A_OutOpObj
, MUIM_Notify
, MUIA_Cycle_Active
, MUIV_EveryTime
,
1483 nch
->nch_ActionObj
, 1, MUIM_Action_UpdateAction
);
1484 DoMethod(nch
->nch_A_OutArrayObj
, MUIM_Notify
, MUIA_String_Contents
, MUIV_EveryTime
,
1485 nch
->nch_ActionObj
, 1, MUIM_Action_UpdateAction
);
1486 DoMethod(nch
->nch_A_OutItemLVObj
, MUIM_Notify
, MUIA_List_Active
, MUIV_EveryTime
,
1487 nch
->nch_ActionObj
, 1, MUIM_Action_UpdateAction
);
1488 DoMethod(nch
->nch_A_FeatOpObj
, MUIM_Notify
, MUIA_Cycle_Active
, MUIV_EveryTime
,
1489 nch
->nch_ActionObj
, 1, MUIM_Action_UpdateAction
);
1490 DoMethod(nch
->nch_A_FeatArrayObj
, MUIM_Notify
, MUIA_String_Contents
, MUIV_EveryTime
,
1491 nch
->nch_ActionObj
, 1, MUIM_Action_UpdateAction
);
1492 DoMethod(nch
->nch_A_FeatItemLVObj
, MUIM_Notify
, MUIA_List_Active
, MUIV_EveryTime
,
1493 nch
->nch_ActionObj
, 1, MUIM_Action_UpdateAction
);
1494 DoMethod(nch
->nch_A_ExtRawKeyObj
, MUIM_Notify
, MUIA_List_Active
, MUIV_EveryTime
,
1495 nch
->nch_ActionObj
, 1, MUIM_Action_UpdateAction
);
1496 DoMethod(nch
->nch_A_ExtRawKeyUpObj
, MUIM_Notify
, MUIA_Selected
, MUIV_EveryTime
,
1497 nch
->nch_ActionObj
, 1, MUIM_Action_UpdateAction
);
1499 if(nch
->nch_Interface
)
1501 struct NepHidCollection
*nhc
;
1502 struct NepHidReport
*nhr
= (struct NepHidReport
*) nch
->nch_HidReports
.lh_Head
;
1503 struct NepHidItem
*nhi
;
1504 struct NepHidGItem
*nhgi
;
1507 nch
->nch_GUICurrentColl
= NULL
;
1508 while(nhr
->nhr_Node
.ln_Succ
)
1510 nhc
= (struct NepHidCollection
*) nhr
->nhr_Collections
.lh_Head
;
1511 while(nhc
->nhc_Node
.ln_Succ
)
1513 if(nhc
->nhc_Items
.lh_Head
->ln_Succ
)
1515 DoMethod(nch
->nch_ReportLVObj
, MUIM_List_InsertSingle
, nhc
, MUIV_List_Insert_Bottom
);
1516 if(!nch
->nch_GUICurrentColl
)
1518 nch
->nch_GUICurrentColl
= nhc
;
1519 set(nch
->nch_ReportLVObj
, MUIA_List_Active
, MUIV_List_Active_Top
);
1522 nhi
= (struct NepHidItem
*) nhc
->nhc_Items
.lh_Head
;
1523 while(nhi
->nhi_Node
.ln_Succ
)
1525 if(nhi
->nhi_Type
== REPORT_MAIN_OUTPUT
)
1527 outobj
= nch
->nch_A_OutItemLVObj
;
1529 else if(nhi
->nhi_Type
== REPORT_MAIN_FEATURE
)
1531 outobj
= nch
->nch_A_FeatItemLVObj
;
1537 if(nhi
->nhi_Flags
& RPF_MAIN_VARIABLE
)
1539 if((nhgi
= nAllocGOutItem(nch
, nhi
, &nhi
->nhi_ActionList
, nhi
->nhi_Usage
)))
1541 DoMethod(outobj
, MUIM_List_InsertSingle
, nhgi
, MUIV_List_Insert_Bottom
);
1546 //if(nhi->nhi_SameUsages)
1548 if((nhgi
= nAllocGOutItem(nch
, nhi
, &nhi
->nhi_ActionList
, nhi
->nhi_Usage
)))
1550 if((newstr
= psdCopyStrFmt("%s Array [%ld]", nhgi
->nhgi_Name
, nhi
->nhi_Count
)))
1552 psdFreeVec(nhgi
->nhgi_Name
);
1553 nhgi
->nhgi_Name
= newstr
;
1555 DoMethod(outobj
, MUIM_List_InsertSingle
, nhgi
, MUIV_List_Insert_Bottom
);
1563 if((nhgi
= nAllocGOutItem(nch
, nhi
, &nhi
->nhi_ActionMap
[acount
], nhi
->nhi_UsageMap
[acount
])))
1565 if((newstr
= psdCopyStrFmt(" +%s", nhgi
->nhgi_Name
)))
1567 psdFreeVec(nhgi
->nhgi_Name
);
1568 nhgi
->nhgi_Name
= newstr
;
1571 DoMethod(outobj
, MUIM_List_InsertSingle
, nhgi
, MUIV_List_Insert_Bottom
);
1573 } while(++acount
< (nhi
->nhi_LogicalMax
-nhi
->nhi_LogicalMin
+1));
1578 nhi
= (struct NepHidItem
*) nhi
->nhi_Node
.ln_Succ
;
1580 nhc
= (struct NepHidCollection
*) nhc
->nhc_Node
.ln_Succ
;
1582 nhr
= (struct NepHidReport
*) nhr
->nhr_Node
.ln_Succ
;
1593 get(nch
->nch_App
, MUIA_Application_Iconified
, &iconify
);
1594 set(nch
->nch_MainWindow
, MUIA_Window_Open
, TRUE
);
1595 get(nch
->nch_MainWindow
, MUIA_Window_Open
, &isopen
);
1596 if(!(isopen
|| iconify
))
1598 GM_UNIQUENAME(nGUITaskCleanup
)(nch
);
1601 nch
->nch_TrackingSignal
= AllocSignal(-1);
1602 sigmask
= (1<<nch
->nch_TrackingSignal
);
1605 retid
= DoMethod(nch
->nch_App
, MUIM_Application_NewInput
, &sigs
);
1608 sigs
= Wait(sigs
| sigmask
| SIGBREAKF_CTRL_C
);
1609 if(nch
->nch_TrackEvents
&& (sigs
& sigmask
))
1613 struct NepHidItem
*titem
;
1614 struct List
*talist
;
1615 struct NepHidCollection
*nhc
;
1616 struct NepHidGItem
*nhgi
;
1618 talist
= nch
->nch_LastItemAList
;
1619 if((titem
= nch
->nch_LastItem
))
1622 if(nch
->nch_GUICurrentItem
)
1624 if(nch
->nch_GUICurrentItem
->nhgi_ActionList
== talist
)
1631 if(nch
->nch_GUICurrentColl
== titem
->nhi_Collection
)
1633 /* Already the right collection, find item */
1638 DoMethod(nch
->nch_ItemLVObj
, MUIM_List_GetEntry
, count
, &nhgi
);
1643 if(nhgi
->nhgi_ActionList
== talist
)
1646 set(nch
->nch_ItemLVObj
, MUIA_List_Active
, count
);
1647 DoMethod(nch
->nch_ItemLVObj
, MUIM_List_Jump
, count
);
1648 nch
->nch_LastItemAList
= NULL
;
1649 nch
->nch_LastItem
= NULL
;
1655 /* Find collection */
1660 DoMethod(nch
->nch_ReportLVObj
, MUIM_List_GetEntry
, count
, &nhc
);
1665 if(nhc
== titem
->nhi_Collection
)
1668 set(nch
->nch_ReportLVObj
, MUIA_List_Active
, count
);
1669 DoMethod(nch
->nch_ReportLVObj
, MUIM_List_Jump
, count
);
1678 if(nch
->nch_TrackKeyEvents
&& (sigs
& sigmask
))
1680 if((nch
->nch_CurrUSBKey
!= nch
->nch_LastUSBKey
) && nch
->nch_LastUSBKey
)
1682 hum
= (struct HidUsageIDMap
*) hidusage07
;
1684 while(hum
->hum_String
)
1686 if(hum
->hum_ID
== (nch
->nch_LastUSBKey
& 0xffff))
1688 set(nch
->nch_USBKeymapLVObj
, MUIA_List_Active
, count
);
1694 nch
->nch_CurrUSBKey
= nch
->nch_LastUSBKey
;
1698 if(nch
->nch_ReportValues
&& (sigs
& sigmask
) && nch
->nch_ItemChanged
)
1700 DoMethod(nch
->nch_ItemLVObj
, MUIM_List_Redraw
, MUIV_List_Redraw_Active
);
1701 nch
->nch_ItemChanged
= FALSE
;
1704 if(sigs
& SIGBREAKF_CTRL_C
)
1709 } while((!nch
->nch_QuitGUI
) && (retid
!= MUIV_Application_ReturnID_Quit
));
1710 FreeSignal(nch
->nch_TrackingSignal
);
1711 nch
->nch_TrackingSignal
= -1;
1712 set(nch
->nch_MainWindow
, MUIA_Window_Open
, FALSE
);
1714 GM_UNIQUENAME(nGUITaskCleanup
)(nch
);
1720 /* /// "nGUITaskCleanup()" */
1721 void GM_UNIQUENAME(nGUITaskCleanup
)(struct NepClassHid
*nch
)
1724 struct NepHidGItem
*nhgi
;
1728 MUI_DisposeObject(nch
->nch_App
);
1729 nch
->nch_App
= NULL
;
1732 for(count
= 0; count
< 128; count
++)
1734 psdFreeVec(nch
->nch_RawKeyArray
[count
]);
1735 nch
->nch_RawKeyArray
[count
] = NULL
;
1736 psdFreeVec(nch
->nch_ExtRawKeyArray
[count
]);
1737 nch
->nch_ExtRawKeyArray
[count
] = NULL
;
1739 nhgi
= (struct NepHidGItem
*) nch
->nch_GUIItems
.lh_Head
;
1740 while(nhgi
->nhgi_Node
.ln_Succ
)
1742 nFreeGItem(nch
, nhgi
);
1743 nhgi
= (struct NepHidGItem
*) nch
->nch_GUIItems
.lh_Head
;
1745 nhgi
= (struct NepHidGItem
*) nch
->nch_GUIOutItems
.lh_Head
;
1746 while(nhgi
->nhgi_Node
.ln_Succ
)
1748 nFreeGItem(nch
, nhgi
);
1749 nhgi
= (struct NepHidGItem
*) nch
->nch_GUIOutItems
.lh_Head
;
1751 if(nch
->nch_ActionClass
)
1753 MUI_DeleteCustomClass(nch
->nch_ActionClass
);
1754 nch
->nch_ActionClass
= NULL
;
1759 CloseLibrary(MUIMasterBase
);
1760 MUIMasterBase
= NULL
;
1764 CloseLibrary(IntuitionBase
);
1765 IntuitionBase
= NULL
;
1769 CloseLibrary(KeymapBase
);
1778 nch
->nch_GUITask
= NULL
;
1779 if(nch
->nch_ReadySigTask
)
1781 Signal(nch
->nch_ReadySigTask
, 1L<<nch
->nch_ReadySignal
);
1783 --nch
->nch_ClsBase
->nh_Library
.lib_OpenCnt
;
1787 /* /// "nAllocGItem()" */
1788 struct NepHidGItem
* nAllocGItem(struct NepClassHid
*nch
, struct NepHidItem
*nhi
, struct List
*actionlist
, ULONG usageid
)
1790 struct NepHidGItem
*nhgi
;
1792 if(!(nhgi
= psdAllocVec(sizeof(struct NepHidGItem
))))
1796 nhgi
->nhgi_Item
= nhi
;
1797 nhgi
->nhgi_ActionList
= actionlist
;
1800 nhgi
->nhgi_Name
= nGetUsageName(nch
, usageid
);
1802 AddTail(&nch
->nch_GUIItems
, &nhgi
->nhgi_Node
);
1807 /* /// "nAllocGOutItem()" */
1808 struct NepHidGItem
* nAllocGOutItem(struct NepClassHid
*nch
, struct NepHidItem
*nhi
, struct List
*actionlist
, ULONG usageid
)
1810 struct NepHidGItem
*nhgi
;
1812 if(!(nhgi
= psdAllocVec(sizeof(struct NepHidGItem
))))
1816 nhgi
->nhgi_Item
= nhi
;
1817 nhgi
->nhgi_ActionList
= actionlist
;
1820 nhgi
->nhgi_Name
= nGetUsageName(nch
, usageid
);
1822 AddTail(&nch
->nch_GUIOutItems
, &nhgi
->nhgi_Node
);
1827 /* /// "nFreeGItem()" */
1828 void nFreeGItem(struct NepClassHid
*nch
, struct NepHidGItem
*nhgi
)
1832 Remove(&nhgi
->nhgi_Node
);
1833 psdFreeVec(nhgi
->nhgi_Name
);
1839 /* /// "USBKeyListDisplayHook()" */
1840 AROS_UFH3(LONG
, GM_UNIQUENAME(USBKeyListDisplayHook
),
1841 AROS_UFHA(struct Hook
*, hook
, A0
),
1842 AROS_UFHA(char **, strarr
, A2
),
1843 AROS_UFHA(struct HidUsageIDMap
*, hum
, A1
))
1849 *strarr
= hum
->hum_String
;
1851 *strarr
= "\33l\33uHID Key name";
1859 /* /// "ReportListDisplayHook()" */
1860 AROS_UFH3(LONG
, GM_UNIQUENAME(ReportListDisplayHook
),
1861 AROS_UFHA(struct Hook
*, hook
, A0
),
1862 AROS_UFHA(char **, strarr
, A2
),
1863 AROS_UFHA(struct NepHidCollection
*, nhc
, A1
))
1867 struct NepClassHid
*nch
= (struct NepClassHid
*) hook
->h_Data
;
1871 if(!nhc
->nhc_Parent
)
1873 *strarr
= nhc
->nhc_Name
;
1877 *strarr
= tarptr
= nch
->nch_TmpStrBufReport
;
1878 srcptr
= nhc
->nhc_Name
;
1879 while((*tarptr
++ = *srcptr
++));
1880 while((nhc
= nhc
->nhc_Parent
))
1884 srcptr
= nhc
->nhc_Name
;
1885 while((*tarptr
++ = *srcptr
++));
1891 *strarr
= "\33l\33uName";
1899 /* /// "ItemListDisplayHook()" */
1900 AROS_UFH3(LONG
, GM_UNIQUENAME(ItemListDisplayHook
),
1901 AROS_UFHA(struct Hook
*, hook
, A0
),
1902 AROS_UFHA(char **, strarr
, A2
),
1903 AROS_UFHA(struct NepHidGItem
*, nhgi
, A1
))
1907 struct NepClassHid
*nch
= (struct NepClassHid
*) hook
->h_Data
;
1908 struct NepHidItem
*nhi
;
1913 nhi
= nhgi
->nhgi_Item
;
1914 psdSafeRawDoFmt(nch
->nch_TmpStrBufItem
, 10, "%ld", nhi
->nhi_LogicalMin
);
1915 psdSafeRawDoFmt(&nch
->nch_TmpStrBufItem
[10], 10, "%ld", nhi
->nhi_LogicalMax
);
1916 buf
= &nch
->nch_TmpStrBufItem
[30];
1917 flags
= nhi
->nhi_Flags
;
1918 if(flags
& RPF_MAIN_CONST
)
1920 strcpy(buf
, "const ");
1923 if(!(flags
& RPF_MAIN_NONLINEAR
))
1925 strcpy(buf
, "lin. ");
1928 if(flags
& RPF_MAIN_RELATIVE
)
1930 strcpy(buf
, "rel. ");
1933 strcpy(buf
, "abs. ");
1936 *strarr
++ = nhgi
->nhgi_Name
;
1937 if(flags
& RPF_MAIN_VARIABLE
)
1939 strcpy(buf
, "var. ");
1941 psdSafeRawDoFmt(&nch
->nch_TmpStrBufItem
[20], 10, "%ld", nhi
->nhi_OldValue
);
1942 *strarr
++ = &nch
->nch_TmpStrBufItem
[20];
1944 strcpy(buf
, "array ");
1948 if(flags
& RPF_MAIN_CONST
)
1950 strcpy(buf
, "const ");
1953 if(flags
& RPF_MAIN_WRAP
)
1955 strcpy(buf
, "wrap ");
1958 if(flags
& RPF_MAIN_NOPREF
)
1960 strcpy(buf
, "nopref. ");
1963 if(flags
& RPF_MAIN_NULLSTATE
)
1965 strcpy(buf
, "null ");
1968 if(flags
& RPF_MAIN_VOLATILE
)
1970 strcpy(buf
, "vola. ");
1973 if(flags
& RPF_MAIN_BUFBYTES
)
1975 strcpy(buf
, "bufbytes");
1977 strcpy(buf
, "bitfield");
1979 *strarr
++ = nch
->nch_TmpStrBufItem
;
1980 *strarr
++ = &nch
->nch_TmpStrBufItem
[10];
1981 *strarr
= &nch
->nch_TmpStrBufItem
[30];
1983 *strarr
++ = "\33l\33uName";
1984 *strarr
++ = "\33l\33uVal";
1985 *strarr
++ = "\33l\33uMin";
1986 *strarr
++ = "\33l\33uMax";
1987 *strarr
= "\33l\33uType";
1996 /* /// "ActionListDisplayHook()" */
1997 AROS_UFH3(LONG
, GM_UNIQUENAME(ActionListDisplayHook
),
1998 AROS_UFHA(struct Hook
*, hook
, A0
),
1999 AROS_UFHA(char **, strarr
, A2
),
2000 AROS_UFHA(struct NepHidAction
*, nha
, A1
))
2004 struct NepClassHid
*nch
= (struct NepClassHid
*) hook
->h_Data
;
2005 STRPTR p1str
, p2str
;
2009 *strarr
++ = ActionTypeStrings
[nha
->nha_Type
& HUA_ATYPEMASK
];
2010 switch(nha
->nha_Type
& HUA_TRIGMASK
)
2022 *strarr
++ = "Always";
2033 switch(nha
->nha_Type
& HUA_ATYPEMASK
)
2042 switch(nha
->nha_QualMode
)
2058 psdSafeRawDoFmt(nch
->nch_TmpStrBufAction
, 80, "%s %s", p1str
, A_QualifierStrings
[nha
->nha_Qualifier
]);
2059 *strarr
= nch
->nch_TmpStrBufAction
;
2063 switch(nha
->nha_MouseAxis
)
2066 *strarr
= "Delta X";
2070 *strarr
= "Delta Y";
2074 *strarr
= "Absolute X";
2078 *strarr
= "Absolute Y";
2085 switch(nha
->nha_ButtonMode
)
2101 switch(nha
->nha_ButtonNo
)
2104 p2str
= "left mouse button";
2108 p2str
= "right mouse button";
2112 p2str
= "middle mouse button";
2116 p2str
= "fourth mouse button";
2120 p2str
= "fifth mouse button";
2123 psdSafeRawDoFmt(*strarr
= nch
->nch_TmpStrBufAction
, 80, "%s %s", p1str
, p2str
);
2127 switch(nha
->nha_WheelMode
)
2130 *strarr
= "Wheel horizontal";
2134 *strarr
= "Wheel vertical";
2138 *strarr
= "Wheel left";
2142 *strarr
= "Wheel right";
2146 *strarr
= "Wheel up";
2150 *strarr
= "Wheel down";
2156 p1str
= A_JoypadOpStrings
[nRevLookup(nha
->nha_JoypadOp
, 0, A_JoypadOpVals
)];
2157 p2str
= A_JoypadFeatStrings
[nRevLookup(nha
->nha_JoypadFeat
, 0, A_JoypadFeatVals
)];
2158 psdSafeRawDoFmt(*strarr
= nch
->nch_TmpStrBufAction
, 80, "%s %s (port %ld)", p1str
, p2str
, (ULONG
) nha
->nha_JoypadPort
);
2162 p1str
= A_APadFeatStrings
[nRevLookup(nha
->nha_APadFeat
, 0, A_APadFeatVals
)];
2163 psdSafeRawDoFmt(*strarr
= nch
->nch_TmpStrBufAction
, 80, "Set %s (port %ld)", p1str
, (ULONG
) nha
->nha_JoypadPort
);
2167 switch(nha
->nha_TabletAxis
)
2170 *strarr
= "Pressure";
2174 *strarr
= "X rotation";
2178 *strarr
= "Y rotation";
2182 *strarr
= "Z rotation";
2186 *strarr
= "In proximity";
2190 *strarr
= "Z position";
2195 psdSafeRawDoFmt(*strarr
= nch
->nch_TmpStrBufAction
, 80, "%s %s",
2196 (nha
->nha_RawKey
& IECODE_UP_PREFIX
) ? "keyup" : "keydown",
2197 nch
->nch_RawKeyArray
[nha
->nha_RawKey
& (~IECODE_UP_PREFIX
)]);
2201 *strarr
= p1str
= nha
->nha_SoundFile
;
2212 *strarr
= nha
->nha_VanillaString
;
2216 *strarr
= nha
->nha_KeyString
;
2220 *strarr
= nha
->nha_ExeString
;
2225 struct NepHidItem
*nhi
;
2227 BOOL freeit
= FALSE
;
2229 p1str
= A_OutOpStrings
[nRevLookup(nha
->nha_OutOp
, 0, A_OutOpVals
)];
2231 if((nhi
= nFindItemID(nch
, nha
->nha_OutItem
, REPORT_MAIN_OUTPUT
, &dummy
)))
2233 p2str
= nGetUsageName(nch
, nhi
->nhi_Usage
);
2235 if(!(nhi
->nhi_Flags
& RPF_MAIN_VARIABLE
))
2237 p1str
= nha
->nha_OutArray
;
2240 psdSafeRawDoFmt(*strarr
= nch
->nch_TmpStrBufAction
, 80, "%s %s", p1str
, p2str
);
2250 struct NepHidItem
*nhi
;
2252 BOOL freeit
= FALSE
;
2254 p1str
= A_OutOpStrings
[nRevLookup(nha
->nha_FeatOp
, 0, A_OutOpVals
)];
2256 if((nhi
= nFindItemID(nch
, nha
->nha_FeatItem
, REPORT_MAIN_FEATURE
, &dummy
)))
2258 p2str
= nGetUsageName(nch
, nhi
->nhi_Usage
);
2260 if(!(nhi
->nhi_Flags
& RPF_MAIN_VARIABLE
))
2262 p1str
= nha
->nha_OutArray
;
2265 psdSafeRawDoFmt(*strarr
= nch
->nch_TmpStrBufAction
, 80, "%s %s", p1str
, p2str
);
2274 *strarr
= A_MiscOpStrings
[nRevLookup(nha
->nha_MiscMode
, 0, A_MiscOpVals
)];
2278 p1str
= A_TarVariableStrings
[nRevLookup(nha
->nha_TarVar
, 0, A_TarVariableVals
)];
2279 p2str
= A_TarVarOpStrings
[nRevLookup(nha
->nha_TarVarOp
, 0, A_TarVarOpVals
)];
2280 psdSafeRawDoFmt(*strarr
= nch
->nch_TmpStrBufAction
, 80, "%s %s", p1str
, p2str
);
2284 psdSafeRawDoFmt(*strarr
= nch
->nch_TmpStrBufAction
, 80, "%s %s",
2285 (nha
->nha_RawKey
& IECODE_UP_PREFIX
) ? "keyup" : "keydown",
2286 nch
->nch_ExtRawKeyArray
[nha
->nha_RawKey
& (~IECODE_UP_PREFIX
)]);
2291 *strarr
++ = "\33l\33uType";
2292 *strarr
++ = "\33l\33uTrigger";
2293 *strarr
= "\33l\33uParams";
2301 /* /// "ActionDispatcher()" */
2302 AROS_UFH3(IPTR
, GM_UNIQUENAME(ActionDispatcher
),
2303 AROS_UFHA(struct IClass
*, cl
, A0
),
2304 AROS_UFHA(Object
*, obj
, A2
),
2305 AROS_UFHA(Msg
, msg
, A1
))
2309 struct ActionData
*ad
= (struct ActionData
*) 0xABADCAFE;
2310 struct NepClassHid
*nch
= NULL
;
2311 struct HidUsageIDMap
*hum
;
2316 if(msg
->MethodID
!= OM_NEW
)
2318 ad
= INST_DATA(cl
, obj
);
2321 switch(msg
->MethodID
)
2324 if(!(obj
= (Object
*) DoSuperMethodA(cl
,obj
,msg
)))
2330 case MUIM_Action_UseConfig
:
2331 case MUIM_Action_DefaultConfig
:
2332 case MUIM_Action_StoreConfig
:
2334 struct PsdIFFContext
*pic
;
2335 struct PsdIFFContext
*rppic
;
2336 struct NepHidReport
*nhr
;
2337 struct NepHidCollection
*nhc
;
2338 struct NepHidItem
*nhi
;
2339 struct List
*alistptr
;
2344 DoMethod(nch
->nch_ActionObj
, MUIM_Action_UpdateDevPrefs
);
2345 DoMethod(nch
->nch_ActionObj
, MUIM_Action_UpdateAction
);
2346 DoMethod(nch
->nch_ActionObj
, MUIM_Action_UpdateAOptions
);
2348 if(msg
->MethodID
== MUIM_Action_DefaultConfig
)
2350 pic
= psdGetClsCfg(GM_UNIQUENAME(libname
));
2353 psdSetClsCfg(GM_UNIQUENAME(libname
), NULL
);
2354 pic
= psdGetClsCfg(GM_UNIQUENAME(libname
));
2358 psdAddCfgEntry(pic
, nch
->nch_CDC
);
2359 psdAddCfgEntry(pic
, &nch
->nch_KeymapCfg
);
2360 psdSaveCfgToDisk(NULL
, FALSE
);
2363 if(nch
->nch_Interface
)
2365 pic
= psdGetUsbDevCfg(GM_UNIQUENAME(libname
), nch
->nch_DevIDString
, nch
->nch_IfIDString
);
2368 psdSetUsbDevCfg(GM_UNIQUENAME(libname
), nch
->nch_DevIDString
, nch
->nch_IfIDString
, NULL
);
2369 pic
= psdGetUsbDevCfg(GM_UNIQUENAME(libname
), nch
->nch_DevIDString
, nch
->nch_IfIDString
);
2373 psdAddCfgEntry(pic
, nch
->nch_CDC
);
2374 if(memcmp(&nch
->nch_KeymapCfg
, &nch
->nch_ClsBase
->nh_DummyNCH
.nch_KeymapCfg
, sizeof(struct KeymapCfg
)))
2376 psdAddCfgEntry(pic
, &nch
->nch_KeymapCfg
);
2378 psdRemCfgChunk(pic
, AROS_LONG2BE(nch
->nch_KeymapCfg
.kmc_ChunkID
));
2381 /* Create config file */
2382 newform
[0] = AROS_LONG2BE(ID_FORM
);
2383 newform
[1] = AROS_LONG2BE(4);
2384 nhr
= (struct NepHidReport
*) nch
->nch_HidReports
.lh_Head
;
2385 while(nhr
->nhr_Node
.ln_Succ
)
2387 if(nhr
->nhr_ReportID
== 0xffff)
2389 newform
[2] = AROS_LONG2BE(MAKE_ID('X','R','P','T'));
2391 else if(nhr
->nhr_ReportID
== 0xfffe)
2393 newform
[2] = AROS_LONG2BE(MAKE_ID('W','C','O','M'));
2395 newform
[2] = AROS_LONG2BE(MAKE_ID('R','P','T','0')+nhr
->nhr_ReportID
);
2398 rppic
= psdFindCfgForm(pic
, AROS_LONG2BE(newform
[2]));
2401 rppic
= psdAddCfgEntry(pic
, newform
);
2407 psdRemCfgChunk(rppic
, 0);
2410 /* find out, if we can get rid of defaults before saving */
2411 nhc
= (struct NepHidCollection
*) nhr
->nhr_Collections
.lh_Head
;
2412 while(nhc
->nhc_Node
.ln_Succ
)
2414 nhi
= (struct NepHidItem
*) nhc
->nhc_Items
.lh_Head
;
2415 while(nhi
->nhi_Node
.ln_Succ
)
2417 if(nhi
->nhi_Flags
& RPF_MAIN_VARIABLE
)
2419 usageptr
= &nhi
->nhi_Usage
;
2420 alistptr
= &nhi
->nhi_ActionList
;
2423 usageptr
= nhi
->nhi_UsageMap
;
2424 alistptr
= nhi
->nhi_ActionMap
;
2425 count
= nhi
->nhi_MapSize
;
2429 nCheckForDefaultAction(nch
, nhi
, alistptr
++, nhc
, *usageptr
++);
2431 nhi
= (struct NepHidItem
*) nhi
->nhi_Node
.ln_Succ
;
2433 nhc
= (struct NepHidCollection
*) nhc
->nhc_Node
.ln_Succ
;
2436 nhc
= (struct NepHidCollection
*) nhr
->nhr_Collections
.lh_Head
;
2437 while(nhc
->nhc_Node
.ln_Succ
)
2439 nhi
= (struct NepHidItem
*) nhc
->nhc_Items
.lh_Head
;
2440 while(nhi
->nhi_Node
.ln_Succ
)
2442 nSaveItem(nch
, rppic
, &nhi
->nhi_ActionList
, nhr
->nhr_ItemIDBase
);
2443 if((alistptr
= nhi
->nhi_ActionMap
))
2445 count
= nhi
->nhi_MapSize
;
2448 nSaveItem(nch
, rppic
, alistptr
++, nhr
->nhr_ItemIDBase
);
2451 nhi
= (struct NepHidItem
*) nhi
->nhi_Node
.ln_Succ
;
2453 nhc
= (struct NepHidCollection
*) nhc
->nhc_Node
.ln_Succ
;
2455 nhr
= (struct NepHidReport
*) nhr
->nhr_Node
.ln_Succ
;
2457 if(msg
->MethodID
!= MUIM_Action_UseConfig
)
2459 psdSaveCfgToDisk(NULL
, FALSE
);
2461 nch
->nch_QuitGUI
= TRUE
;
2464 nch
->nch_QuitGUI
= TRUE
;
2469 case MUIM_Action_About
:
2470 MUI_RequestA(nch
->nch_App
, nch
->nch_MainWindow
, 0, NULL
, "Blimey!", VERSION_STRING
, NULL
);
2473 case MUIM_Action_UpdateDevPrefs
:
2475 CONST_STRPTR tmpstr
;
2477 get(nch
->nch_ConWindowObj
, MUIA_String_Contents
, &tmpstr
);
2478 strncpy(nch
->nch_CDC
->cdc_ShellCon
, tmpstr
, 127);
2480 get(nch
->nch_EnableKBResetObj
, MUIA_Selected
, &nch
->nch_CDC
->cdc_EnableKBReset
);
2481 get(nch
->nch_EnableRHObj
, MUIA_Selected
, &nch
->nch_CDC
->cdc_EnableRH
);
2482 get(nch
->nch_ResetDelayObj
, MUIA_Numeric_Value
, &nch
->nch_CDC
->cdc_ResetDelay
);
2483 get(nch
->nch_ShellStackObj
, MUIA_String_Integer
, &nch
->nch_CDC
->cdc_ShellStack
);
2484 get(nch
->nch_TurboMouseObj
, MUIA_Cycle_Active
, &nch
->nch_CDC
->cdc_TurboMouse
);
2486 get(nch
->nch_HIDCtrlAutoObj
, MUIA_Selected
, &nch
->nch_CDC
->cdc_HIDCtrlOpen
);
2488 get(nch
->nch_HIDCtrlRexxObj
, MUIA_String_Contents
, &tmpstr
);
2489 strncpy(nch
->nch_CDC
->cdc_HIDCtrlRexx
, tmpstr
, 31);
2491 get(nch
->nch_HIDCtrlTitleObj
, MUIA_String_Contents
, &tmpstr
);
2492 strncpy(nch
->nch_CDC
->cdc_HIDCtrlTitle
, tmpstr
, 31);
2494 for(count
= 0; count
< 4; count
++)
2496 get(nch
->nch_LLPortModeObj
[count
], MUIA_Cycle_Active
, &nch
->nch_CDC
->cdc_LLPortMode
[count
]);
2498 get(nch
->nch_LLRumblePortObj
, MUIA_Cycle_Active
, &nch
->nch_CDC
->cdc_LLRumblePort
);
2500 if(nch
->nch_EPInPipe
)
2502 psdSetAttrs(PGA_PIPE
, nch
->nch_EPInPipe
,
2503 PPA_Interval
, nch
->nch_CDC
->cdc_TurboMouse
? 1<<nch
->nch_CDC
->cdc_TurboMouse
: nch
->nch_EPInInterval
,
2510 case MUIM_Action_SelectReport
:
2512 struct NepHidGItem
*nhgi
= NULL
;
2513 struct NepHidItem
*nhi
= NULL
;
2516 STRPTR idstr1
, idstr2
;
2520 nch
->nch_SilentActionUpdate
= TRUE
;
2521 DoMethod(nch
->nch_ReportLVObj
, MUIM_List_GetEntry
, MUIV_List_GetEntry_Active
, &nch
->nch_GUICurrentColl
);
2522 set(nch
->nch_ItemLVObj
, MUIA_List_Quiet
, TRUE
);
2523 DoMethod(nch
->nch_ItemLVObj
, MUIM_List_Clear
);
2524 nhgi
= (struct NepHidGItem
*) nch
->nch_GUIItems
.lh_Head
;
2525 while(nhgi
->nhgi_Node
.ln_Succ
)
2527 nFreeGItem(nch
, nhgi
);
2528 nhgi
= (struct NepHidGItem
*) nch
->nch_GUIItems
.lh_Head
;
2530 nch
->nch_GUICurrentItem
= NULL
;
2531 if(nch
->nch_GUICurrentColl
)
2534 nhi
= (struct NepHidItem
*) nch
->nch_GUICurrentColl
->nhc_Items
.lh_Head
;
2535 while(nhi
->nhi_Node
.ln_Succ
)
2537 if(nhi
->nhi_Type
== REPORT_MAIN_INPUT
)
2539 if(nhi
->nhi_Flags
& RPF_MAIN_VARIABLE
)
2541 if((nhgi
= nAllocGItem(nch
, nhi
, &nhi
->nhi_ActionList
, nhi
->nhi_Usage
)))
2543 DoMethod(nch
->nch_ItemLVObj
, MUIM_List_InsertSingle
, nhgi
, MUIV_List_Insert_Bottom
);
2544 if((!nch
->nch_GUICurrentItem
) ||
2545 (nch
->nch_TrackEvents
&& (nhgi
->nhgi_ActionList
== nch
->nch_LastItemAList
)))
2547 nch
->nch_GUICurrentItem
= nhgi
;
2553 if((nhgi
= nAllocGItem(nch
, nhi
, &nhi
->nhi_ActionList
, 0)))
2555 idstr1
= nGetUsageName(nch
, nhi
->nhi_UsageMap
[0]);
2556 if(nhi
->nhi_SameUsages
)
2558 nhgi
->nhgi_Name
= psdCopyStrFmt("%s Array", idstr1
);
2560 idstr2
= nGetUsageName(nch
, nhi
->nhi_UsageMap
[nhi
->nhi_LogicalMax
-nhi
->nhi_LogicalMin
]);
2561 nhgi
->nhgi_Name
= psdCopyStrFmt("Default for %s->%s", idstr1
, idstr2
);
2565 DoMethod(nch
->nch_ItemLVObj
, MUIM_List_InsertSingle
, nhgi
, MUIV_List_Insert_Bottom
);
2566 if((!nch
->nch_GUICurrentItem
) ||
2567 (nch
->nch_TrackEvents
&& (nhgi
->nhgi_ActionList
== nch
->nch_LastItemAList
)))
2569 nch
->nch_GUICurrentItem
= nhgi
;
2574 if(!nhi
->nhi_SameUsages
)
2579 if((nhgi
= nAllocGItem(nch
, nhi
, &nhi
->nhi_ActionMap
[acount
], nhi
->nhi_UsageMap
[acount
])))
2581 if((newstr
= psdCopyStrFmt(" +%s", nhgi
->nhgi_Name
)))
2583 psdFreeVec(nhgi
->nhgi_Name
);
2584 nhgi
->nhgi_Name
= newstr
;
2587 DoMethod(nch
->nch_ItemLVObj
, MUIM_List_InsertSingle
, nhgi
, MUIV_List_Insert_Bottom
);
2588 if((!nch
->nch_GUICurrentItem
) ||
2589 (nch
->nch_TrackEvents
&& (nhgi
->nhgi_ActionList
== nch
->nch_LastItemAList
)))
2591 nch
->nch_GUICurrentItem
= nhgi
;
2596 } while(++acount
< (nhi
->nhi_LogicalMax
-nhi
->nhi_LogicalMin
+1));
2600 nhi
= (struct NepHidItem
*) nhi
->nhi_Node
.ln_Succ
;
2602 set(nch
->nch_FillDefObj
, MUIA_Disabled
, FALSE
);
2603 set(nch
->nch_ClearActionsObj
, MUIA_Disabled
, FALSE
);
2604 set(nch
->nch_ItemLVObj
, MUIA_Disabled
, FALSE
);
2605 set(nch
->nch_ItemLVObj
, MUIA_List_Quiet
, FALSE
);
2606 nch
->nch_SilentActionUpdate
= FALSE
;
2607 set(nch
->nch_ItemLVObj
, MUIA_List_Active
, jumppos
);
2608 DoMethod(nch
->nch_ItemLVObj
, MUIM_List_Jump
, jumppos
);
2610 set(nch
->nch_FillDefObj
, MUIA_Disabled
, TRUE
);
2611 set(nch
->nch_ClearActionsObj
, MUIA_Disabled
, TRUE
);
2612 nch
->nch_SilentActionUpdate
= FALSE
;
2613 set(nch
->nch_ItemLVObj
, MUIA_Disabled
, TRUE
);
2614 set(nch
->nch_ItemLVObj
, MUIA_List_Quiet
, FALSE
);
2616 if(!nch
->nch_GUICurrentAction
)
2618 DoMethod(nch
->nch_ActionObj
, MUIM_Action_SelectAction
);
2623 case MUIM_Action_DebugReport
:
2624 if(nch
->nch_GUICurrentColl
)
2626 nDebugReport(nch
, nch
->nch_GUICurrentColl
->nhc_Report
);
2630 case MUIM_Action_SelectItem
:
2632 struct NepHidGItem
*nhgi
;
2633 struct NepHidAction
*nha
;
2635 nch
->nch_SilentActionUpdate
= TRUE
;
2636 DoMethod(nch
->nch_ItemLVObj
, MUIM_List_GetEntry
, MUIV_List_GetEntry_Active
, &nch
->nch_GUICurrentItem
);
2637 set(nch
->nch_ActionLVObj
, MUIA_List_Quiet
, TRUE
);
2638 DoMethod(nch
->nch_ActionLVObj
, MUIM_List_Clear
);
2639 nch
->nch_GUICurrentAction
= NULL
;
2640 nch
->nch_SilentActionUpdate
= FALSE
;
2641 if((nhgi
= nch
->nch_GUICurrentItem
))
2643 nha
= (struct NepHidAction
*) nhgi
->nhgi_ActionList
->lh_Head
;
2644 while(nha
->nha_Node
.ln_Succ
)
2646 DoMethod(nch
->nch_ActionLVObj
, MUIM_List_InsertSingle
, nha
, MUIV_List_Insert_Bottom
);
2647 if(!nch
->nch_GUICurrentAction
)
2649 nch
->nch_GUICurrentAction
= nha
;
2650 set(nch
->nch_ActionLVObj
, MUIA_List_Active
, MUIV_List_Active_Top
);
2652 nha
= (struct NepHidAction
*) nha
->nha_Node
.ln_Succ
;
2654 set(nch
->nch_ActionLVObj
, MUIA_Disabled
, FALSE
);
2655 set(nch
->nch_ActionNewObj
, MUIA_Disabled
, FALSE
);
2656 //set(nch->nch_ActionLVObj, MUIA_List_Active, MUIV_List_Active_Off);
2658 set(nch
->nch_ActionLVObj
, MUIA_Disabled
, TRUE
);
2659 set(nch
->nch_ActionNewObj
, MUIA_Disabled
, TRUE
);
2660 set(nch
->nch_ActionCopyObj
, MUIA_Disabled
, TRUE
);
2661 set(nch
->nch_ActionDelObj
, MUIA_Disabled
, TRUE
);
2662 set(nch
->nch_ActionUpObj
, MUIA_Disabled
, TRUE
);
2663 set(nch
->nch_ActionDownObj
, MUIA_Disabled
, TRUE
);
2665 if(!nch
->nch_GUICurrentAction
)
2667 DoMethod(nch
->nch_ActionObj
, MUIM_Action_SelectAction
);
2669 set(nch
->nch_ActionLVObj
, MUIA_List_Quiet
, FALSE
);
2674 case MUIM_Action_SelectAction
:
2676 struct NepHidAction
*nha
;
2677 if(!nch
->nch_SilentActionUpdate
)
2679 DoMethod(nch
->nch_ActionLVObj
, MUIM_List_GetEntry
, MUIV_List_GetEntry_Active
, &nch
->nch_GUICurrentAction
);
2680 if((nha
= nch
->nch_GUICurrentAction
))
2682 set(nch
->nch_ActionSelectorObj
, MUIA_Cycle_Active
, nha
->nha_Type
& HUA_ATYPEMASK
);
2683 set(nch
->nch_ActionAreaObj
, MUIA_Disabled
, FALSE
);
2684 set(nch
->nch_ActionCopyObj
, MUIA_Disabled
, FALSE
);
2685 set(nch
->nch_ActionDelObj
, MUIA_Disabled
, FALSE
);
2686 set(nch
->nch_ActionUpObj
, MUIA_Disabled
, FALSE
);
2687 set(nch
->nch_ActionDownObj
, MUIA_Disabled
, FALSE
);
2688 DoMethod(nch
->nch_ActionObj
, MUIM_Action_SetActionType
);
2690 set(nch
->nch_ActionAreaObj
, MUIA_Disabled
, TRUE
);
2691 set(nch
->nch_ActionCopyObj
, MUIA_Disabled
, TRUE
);
2692 set(nch
->nch_ActionDelObj
, MUIA_Disabled
, TRUE
);
2693 set(nch
->nch_ActionUpObj
, MUIA_Disabled
, TRUE
);
2694 set(nch
->nch_ActionDownObj
, MUIA_Disabled
, TRUE
);
2700 case MUIM_Action_FillDefReport
:
2702 struct NepHidItem
*nhi
;
2703 struct NepHidCollection
*nhc
;
2705 struct List
*alistptr
;
2708 DoMethod(nch
->nch_ReportLVObj
, MUIM_List_GetEntry
, MUIV_List_GetEntry_Active
, &nhc
);
2711 if(MUI_Request(nch
->nch_App
, nch
->nch_MainWindow
, 0, NULL
, "Fill with default|Cancel",
2712 "Warning! This operation will erase\n"
2713 "all of the actions defined for\n"
2714 "the selected collection '%s'\n"
2715 "replace it with default values.", nhc
->nhc_Name
))
2717 DoMethod(nch
->nch_ActionLVObj
, MUIM_List_Clear
);
2719 nCleanCollection(nch
, nhc
);
2720 nhi
= (struct NepHidItem
*) nhc
->nhc_Items
.lh_Head
;
2721 while(nhi
->nhi_Node
.ln_Succ
)
2723 if(nhi
->nhi_Flags
& RPF_MAIN_VARIABLE
)
2725 usageptr
= &nhi
->nhi_Usage
;
2726 alistptr
= &nhi
->nhi_ActionList
;
2729 usageptr
= nhi
->nhi_UsageMap
;
2730 alistptr
= nhi
->nhi_ActionMap
;
2731 count
= nhi
->nhi_MapSize
;
2735 nDetectDefaultAction(nch
, nhi
, alistptr
++, nhc
, *usageptr
++);
2737 nhi
= (struct NepHidItem
*) nhi
->nhi_Node
.ln_Succ
;
2740 nch
->nch_GUICurrentAction
= NULL
;
2741 set(nch
->nch_ItemLVObj
, MUIA_List_Active
, MUIV_List_Active_Off
);
2742 set(nch
->nch_ItemLVObj
, MUIA_List_Active
, MUIV_List_Active_Top
);
2748 case MUIM_Action_SwapLMBRMB
:
2749 case MUIM_Action_SetJoyPort
:
2751 struct NepHidItem
*nhi
;
2752 struct NepHidCollection
*nhc
;
2753 struct NepHidAction
*nha
;
2755 struct List
*alistptr
;
2757 DoMethod(nch
->nch_ReportLVObj
, MUIM_List_GetEntry
, MUIV_List_GetEntry_Active
, &nhc
);
2760 nhi
= (struct NepHidItem
*) nhc
->nhc_Items
.lh_Head
;
2761 while(nhi
->nhi_Node
.ln_Succ
)
2763 if(nhi
->nhi_Flags
& RPF_MAIN_VARIABLE
)
2765 alistptr
= &nhi
->nhi_ActionList
;
2768 alistptr
= nhi
->nhi_ActionMap
;
2769 count
= nhi
->nhi_MapSize
;
2773 nha
= (struct NepHidAction
*) alistptr
->lh_Head
;
2774 while(nha
->nha_Node
.ln_Succ
)
2776 if(msg
->MethodID
== MUIM_Action_SwapLMBRMB
)
2778 if(nha
->nha_ButtonNo
== 1)
2780 nha
->nha_ButtonNo
= 2;
2782 else if(nha
->nha_ButtonNo
== 2)
2784 nha
->nha_ButtonNo
= 1;
2787 if(((nha
->nha_Type
& HUA_ATYPEMASK
) == HUA_DIGJOY
) ||
2788 ((nha
->nha_Type
& HUA_ATYPEMASK
) == HUA_ANALOGJOY
))
2790 nha
->nha_JoypadPort
= (IPTR
)((struct opSet
*) msg
)->ops_AttrList
;
2793 nha
= (struct NepHidAction
*) nha
->nha_Node
.ln_Succ
;
2797 nhi
= (struct NepHidItem
*) nhi
->nhi_Node
.ln_Succ
;
2799 DoMethod(nch
->nch_ActionObj
, MUIM_Action_SelectItem
);
2805 case MUIM_Action_ClearReport
:
2807 struct NepHidCollection
*nhc
;
2809 DoMethod(nch
->nch_ReportLVObj
, MUIM_List_GetEntry
, MUIV_List_GetEntry_Active
, &nhc
);
2812 if(MUI_Request(nch
->nch_App
, nch
->nch_MainWindow
, 0, NULL
, "Clear|Cancel",
2813 "Warning! This operation will erase\n"
2814 "all of the actions defined for\n"
2815 "the selected collection '%s'\n"
2816 "replace them with default values.", nhc
->nhc_Name
))
2818 DoMethod(nch
->nch_ActionLVObj
, MUIM_List_Clear
);
2820 nCleanCollection(nch
, nhc
);
2822 nch
->nch_GUICurrentAction
= NULL
;
2823 set(nch
->nch_ItemLVObj
, MUIA_List_Active
, MUIV_List_Active_Off
);
2824 set(nch
->nch_ItemLVObj
, MUIA_List_Active
, MUIV_List_Active_Top
);
2830 case MUIM_Action_SetTracking
:
2833 get(nch
->nch_TrackKeyEventsObj
, MUIA_Selected
, &state
);
2834 nch
->nch_TrackKeyEvents
= state
;
2835 get(nch
->nch_TrackEventsObj
, MUIA_Selected
, &state
);
2836 nch
->nch_TrackEvents
= state
;
2837 get(nch
->nch_ReportValuesObj
, MUIA_Selected
, &state
);
2838 nch
->nch_ReportValues
= state
;
2839 get(nch
->nch_DisableActionsObj
, MUIA_Selected
, &state
);
2840 nch
->nch_DisableActions
= state
;
2844 case MUIM_Action_NewAction
:
2846 struct NepHidAction
*nha
;
2847 if(nch
->nch_GUICurrentItem
)
2850 nha
= nAllocAction(nch
, nch
->nch_GUICurrentItem
->nhgi_ActionList
, HUA_NOP
|HUA_DOWNEVENT
);
2854 DoMethod(nch
->nch_ActionLVObj
, MUIM_List_InsertSingle
, nha
, MUIV_List_Insert_Bottom
);
2855 set(nch
->nch_ActionLVObj
, MUIA_List_Active
, MUIV_List_Active_Bottom
);
2861 case MUIM_Action_CopyAction
:
2863 struct NepHidAction
*nha
;
2864 struct NepHidAction
*newnha
;
2865 DoMethod(nch
->nch_ActionLVObj
, MUIM_List_GetEntry
, MUIV_List_GetEntry_Active
, &nch
->nch_GUICurrentAction
);
2866 if((nha
= nch
->nch_GUICurrentAction
))
2868 newnha
= psdAllocVec(sizeof(struct NepHidAction
));
2873 AddTail(nch
->nch_GUICurrentItem
->nhgi_ActionList
, &newnha
->nha_Node
);
2875 DoMethod(nch
->nch_ActionLVObj
, MUIM_List_InsertSingle
, newnha
, MUIV_List_Insert_Bottom
);
2876 set(nch
->nch_ActionLVObj
, MUIA_List_Active
, MUIV_List_Active_Bottom
);
2882 case MUIM_Action_DelAction
:
2884 struct NepHidAction
*nha
;
2885 DoMethod(nch
->nch_ActionLVObj
, MUIM_List_GetEntry
, MUIV_List_GetEntry_Active
, &nch
->nch_GUICurrentAction
);
2886 if((nha
= nch
->nch_GUICurrentAction
))
2888 nch
->nch_GUICurrentAction
= NULL
;
2889 DoMethod(nch
->nch_ActionLVObj
, MUIM_List_Remove
, MUIV_List_Remove_Active
);
2891 Remove(&nha
->nha_Node
);
2898 case MUIM_Action_MoveActionUp
:
2901 struct Node
*nhapred
;
2902 struct Node
*nhapredpred
;
2903 struct Node
*nhasucc
;
2904 DoMethod(nch
->nch_ActionLVObj
, MUIM_List_GetEntry
, MUIV_List_GetEntry_Active
, &nha
);
2907 nhasucc
= nha
->ln_Succ
;
2908 nhapred
= nha
->ln_Pred
;
2909 if((nhapredpred
= nhapred
->ln_Pred
))
2912 nhapredpred
->ln_Succ
= nha
;
2913 nha
->ln_Pred
= nhapredpred
;
2914 nha
->ln_Succ
= nhapred
;
2915 nhapred
->ln_Pred
= nha
;
2916 nhapred
->ln_Succ
= nhasucc
;
2917 nhasucc
->ln_Pred
= nhapred
;
2919 DoMethod(nch
->nch_ActionLVObj
, MUIM_List_Move
, MUIV_List_Move_Active
, MUIV_List_Move_Previous
);
2920 set(nch
->nch_ActionLVObj
, MUIA_List_Active
, MUIV_List_Active_Up
);
2926 case MUIM_Action_MoveActionDown
:
2929 struct Node
*nhapred
;
2930 struct Node
*nhasucc
;
2931 struct Node
*nhasuccsucc
;
2932 DoMethod(nch
->nch_ActionLVObj
, MUIM_List_GetEntry
, MUIV_List_GetEntry_Active
, &nha
);
2935 nhasucc
= nha
->ln_Succ
;
2936 nhapred
= nha
->ln_Pred
;
2937 if((nhasuccsucc
= nhasucc
->ln_Succ
))
2940 nhapred
->ln_Succ
= nhasucc
;
2941 nhasucc
->ln_Pred
= nhapred
;
2942 nhasucc
->ln_Succ
= nha
;
2943 nha
->ln_Pred
= nhasucc
;
2944 nha
->ln_Succ
= nhasuccsucc
;
2945 nhasuccsucc
->ln_Pred
= nha
;
2947 DoMethod(nch
->nch_ActionLVObj
, MUIM_List_Move
, MUIV_List_Move_Active
, MUIV_List_Move_Next
);
2948 set(nch
->nch_ActionLVObj
, MUIA_List_Active
, MUIV_List_Active_Down
);
2954 case MUIM_Action_SetActionType
:
2956 struct NepHidAction
*nha
;
2957 if((nha
= nch
->nch_GUICurrentAction
))
2960 get(nch
->nch_ActionSelectorObj
, MUIA_Cycle_Active
, &tmpval
);
2961 if(tmpval
!= (nha
->nha_Type
& HUA_ATYPEMASK
))
2963 nha
->nha_IsDefault
= FALSE
;
2965 nha
->nha_Type
= (nha
->nha_Type
& HUA_TRIGMASK
) | tmpval
;
2966 nnset(nch
->nch_ActionTriggerObj
, MUIA_Cycle_Active
, nRevLookup(nha
->nha_Type
& HUA_TRIGMASK
, 0, ActionTriggerVals
));
2968 nnset(nch
->nch_ActionAbsToRelObj
, MUIA_Selected
, nha
->nha_AbsToRel
);
2969 nnset(nch
->nch_ActionClipEnableObj
, MUIA_Selected
, nha
->nha_ClipEnable
);
2970 nnset(nch
->nch_A_ClipMinObj
, MUIA_Numeric_Value
, nha
->nha_ClipMin
);
2971 nnset(nch
->nch_A_ClipMaxObj
, MUIA_Numeric_Value
, nha
->nha_ClipMax
);
2972 nnset(nch
->nch_A_ClipStretchObj
, MUIA_Selected
, nha
->nha_ClipStretch
);
2974 nnset(nch
->nch_ActionScaleEnableObj
, MUIA_Selected
, nha
->nha_ScaleEnable
);
2975 psdSafeRawDoFmt(nch
->nch_TmpStrBuf0
, 80, "%ld", nha
->nha_ScaleMin
);
2976 nnset(nch
->nch_A_ScaleMinObj
, MUIA_String_Contents
, nch
->nch_TmpStrBuf0
);
2977 psdSafeRawDoFmt(nch
->nch_TmpStrBuf0
, 80, "%ld", nha
->nha_ScaleMax
);
2978 nnset(nch
->nch_A_ScaleMaxObj
, MUIA_String_Contents
, nch
->nch_TmpStrBuf0
);
2980 nnset(nch
->nch_ActionCCEnableObj
, MUIA_Selected
, nha
->nha_CCEnable
);
2981 nnset(nch
->nch_A_CCVar1Obj
, MUIA_Cycle_Active
, nRevLookup(nha
->nha_CCVar1
, 0, A_CCVariableVals
));
2982 nnset(nch
->nch_A_CCCondObj
, MUIA_Cycle_Active
, nRevLookup(nha
->nha_CCCond
, 0, A_CCCondVals
));
2983 nnset(nch
->nch_A_CCVar2Obj
, MUIA_Cycle_Active
, nRevLookup(nha
->nha_CCVar2
, 0, A_CCVariableVals
));
2984 psdSafeRawDoFmt(nch
->nch_TmpStrBuf0
, 80, "%ld", nha
->nha_CCConst1
);
2985 nnset(nch
->nch_A_CCConst1Obj
, MUIA_String_Contents
, nch
->nch_TmpStrBuf0
);
2986 psdSafeRawDoFmt(nch
->nch_TmpStrBuf0
, 80, "%ld", nha
->nha_CCConst2
);
2987 nnset(nch
->nch_A_CCConst2Obj
, MUIA_String_Contents
, nch
->nch_TmpStrBuf0
);
2989 nnset(nch
->nch_ActionValEnableObj
, MUIA_Selected
, nha
->nha_ValEnable
);
2990 nnset(nch
->nch_A_ValVarObj
, MUIA_Cycle_Active
, nRevLookup(nha
->nha_ValVar
, 0, A_CCVariableVals
));
2991 psdSafeRawDoFmt(nch
->nch_TmpStrBuf0
, 80, "%ld", nha
->nha_ValConst
);
2992 nnset(nch
->nch_A_ValConstObj
, MUIA_String_Contents
, nch
->nch_TmpStrBuf0
);
2994 nnset(nch
->nch_A_ClipGroupObj
, MUIA_ShowMe
, nha
->nha_ClipEnable
);
2995 nnset(nch
->nch_A_ScaleGroupObj
, MUIA_ShowMe
, nha
->nha_ScaleEnable
);
2996 nnset(nch
->nch_A_CCGroupObj
, MUIA_ShowMe
, nha
->nha_CCEnable
);
2997 nnset(nch
->nch_A_ValGroupObj
, MUIA_ShowMe
, nha
->nha_ValEnable
);
2999 nnset(nch
->nch_A_KeyQualOpObj
, MUIA_Cycle_Active
, nRevLookup(nha
->nha_QualMode
, 0, A_QualOpVals
));
3000 nnset(nch
->nch_A_KeyQualObj
, MUIA_Cycle_Active
, nha
->nha_Qualifier
);
3001 nnset(nch
->nch_A_RawKeyUpObj
, MUIA_Selected
, nha
->nha_RawKey
& IECODE_UP_PREFIX
);
3002 nnset(nch
->nch_A_RawKeyObj
, MUIA_List_Active
, nha
->nha_RawKey
& (~IECODE_UP_PREFIX
));
3003 nnset(nch
->nch_A_VanillaStrObj
, MUIA_String_Contents
, nha
->nha_VanillaString
);
3004 nnset(nch
->nch_A_KeyStringObj
, MUIA_String_Contents
, nha
->nha_KeyString
);
3005 nnset(nch
->nch_A_MousePosOpObj
, MUIA_Cycle_Active
, nRevLookup(nha
->nha_MouseAxis
, 0, A_MousePosOpVals
));
3006 nnset(nch
->nch_A_MouseButOpObj
, MUIA_Cycle_Active
, nRevLookup(nha
->nha_ButtonMode
, 0, A_MouseButOpVals
));
3007 nnset(nch
->nch_A_MouseButObj
, MUIA_Cycle_Active
, nha
->nha_ButtonNo
? nha
->nha_ButtonNo
-1 : 0);
3008 nnset(nch
->nch_A_TabletAxisObj
, MUIA_Cycle_Active
, nRevLookup(nha
->nha_TabletAxis
, 0, A_TabletAxisVals
));
3009 nnset(nch
->nch_A_WheelOpObj
, MUIA_Cycle_Active
, nRevLookup(nha
->nha_WheelMode
, 0, A_WheelOpVals
));
3010 nnset(nch
->nch_A_WheelDistObj
, MUIA_Numeric_Value
, nha
->nha_WheelDist
);
3011 nnset(nch
->nch_A_JoypadOpObj
, MUIA_Cycle_Active
, nRevLookup(nha
->nha_JoypadOp
, 0, A_JoypadOpVals
));
3012 nnset(nch
->nch_A_JoypadFeatObj
, MUIA_Cycle_Active
, nRevLookup(nha
->nha_JoypadFeat
, 0, A_JoypadFeatVals
));
3013 nnset(nch
->nch_A_JoypadPortObj
, MUIA_Cycle_Active
, nha
->nha_JoypadPort
);
3014 nnset(nch
->nch_A_APadFeatObj
, MUIA_Cycle_Active
, nRevLookup(nha
->nha_APadFeat
, 0, A_APadFeatVals
));
3015 nnset(nch
->nch_A_APadPortObj
, MUIA_Cycle_Active
, nha
->nha_JoypadPort
);
3016 nnset(nch
->nch_A_SoundFileObj
, MUIA_String_Contents
, nha
->nha_SoundFile
);
3017 nnset(nch
->nch_A_SoundVolObj
, MUIA_Numeric_Value
, nha
->nha_SoundVolume
);
3018 nnset(nch
->nch_A_ShellComObj
, MUIA_String_Contents
, nha
->nha_ExeString
);
3019 nnset(nch
->nch_A_ShellAsyncObj
, MUIA_Selected
, nha
->nha_ShellAsync
);
3020 nnset(nch
->nch_A_OutOpObj
, MUIA_Cycle_Active
, nRevLookup(nha
->nha_OutOp
, 0, A_OutOpVals
));
3021 nnset(nch
->nch_A_OutArrayObj
, MUIA_String_Contents
, nha
->nha_OutArray
);
3023 struct NepHidItem
*nhi
;
3024 struct NepHidGItem
*nhgi
;
3026 if((nhi
= nFindItemID(nch
, nha
->nha_OutItem
, REPORT_MAIN_OUTPUT
, &pos
)))
3032 DoMethod(nch
->nch_A_OutItemLVObj
, MUIM_List_GetEntry
, pos
, &nhgi
);
3037 if(nhgi
->nhgi_Item
== nhi
)
3039 nnset(nch
->nch_A_OutItemLVObj
, MUIA_List_Active
, pos
);
3047 nnset(nch
->nch_A_FeatOpObj
, MUIA_Cycle_Active
, nRevLookup(nha
->nha_FeatOp
, 0, A_OutOpVals
));
3048 nnset(nch
->nch_A_FeatArrayObj
, MUIA_String_Contents
, nha
->nha_OutArray
);
3050 struct NepHidItem
*nhi
;
3051 struct NepHidGItem
*nhgi
;
3053 if((nhi
= nFindItemID(nch
, nha
->nha_FeatItem
, REPORT_MAIN_FEATURE
, &pos
)))
3059 DoMethod(nch
->nch_A_FeatItemLVObj
, MUIM_List_GetEntry
, pos
, &nhgi
);
3064 if(nhgi
->nhgi_Item
== nhi
)
3066 nnset(nch
->nch_A_FeatItemLVObj
, MUIA_List_Active
, pos
);
3074 nnset(nch
->nch_A_MiscOpObj
, MUIA_Cycle_Active
, nRevLookup(nha
->nha_MiscMode
, 0, A_MiscOpVals
));
3076 nnset(nch
->nch_A_TarVarObj
, MUIA_Cycle_Active
, nRevLookup(nha
->nha_TarVar
, 0, A_TarVariableVals
));
3077 nnset(nch
->nch_A_TarVarOpObj
, MUIA_Cycle_Active
, nRevLookup(nha
->nha_TarVarOp
, 0, A_TarVarOpVals
));
3079 nnset(nch
->nch_A_ExtRawKeyUpObj
, MUIA_Selected
, nha
->nha_RawKey
& IECODE_UP_PREFIX
);
3080 nnset(nch
->nch_A_ExtRawKeyObj
, MUIA_List_Active
, nha
->nha_RawKey
& (~IECODE_UP_PREFIX
));
3082 DoMethod(nch
->nch_ActionObj
, MUIM_Action_UpdateAction
);
3083 DoMethod(nch
->nch_ActionObj
, MUIM_Action_UpdateAOptions
);
3084 DoMethod(nch
->nch_ActionLVObj
, MUIM_List_Redraw
, MUIV_List_Redraw_Active
);
3089 case MUIM_Action_UpdateAOptions
:
3091 struct NepHidAction
*nha
;
3093 if((nha
= nch
->nch_GUICurrentAction
))
3095 nha
->nha_IsDefault
= FALSE
;
3097 get(nch
->nch_ActionAbsToRelObj
, MUIA_Selected
, &tmpval
);
3098 nha
->nha_AbsToRel
= tmpval
;
3101 get(nch
->nch_ActionClipEnableObj
, MUIA_Selected
, &tmpval
);
3102 nha
->nha_ClipEnable
= tmpval
;
3106 get(nch
->nch_A_ClipMinObj
, MUIA_Numeric_Value
, &tmpval
);
3107 nha
->nha_ClipMin
= tmpval
;
3109 get(nch
->nch_A_ClipMaxObj
, MUIA_Numeric_Value
, &tmpval
);
3110 nha
->nha_ClipMax
= tmpval
;
3112 get(nch
->nch_A_ClipStretchObj
, MUIA_Selected
, &tmpval
);
3113 nha
->nha_ClipStretch
= tmpval
;
3117 get(nch
->nch_ActionScaleEnableObj
, MUIA_Selected
, &tmpval
);
3118 nha
->nha_ScaleEnable
= tmpval
;
3122 get(nch
->nch_A_ScaleMinObj
, MUIA_String_Integer
, &tmpval
);
3123 nha
->nha_ScaleMin
= tmpval
;
3125 get(nch
->nch_A_ScaleMaxObj
, MUIA_String_Integer
, &tmpval
);
3126 nha
->nha_ScaleMax
= tmpval
;
3130 get(nch
->nch_ActionCCEnableObj
, MUIA_Selected
, &tmpval
);
3131 nha
->nha_CCEnable
= tmpval
;
3135 get(nch
->nch_A_CCVar1Obj
, MUIA_Cycle_Active
, &tmpval
);
3136 nha
->nha_CCVar1
= A_CCVariableVals
[tmpval
];
3138 get(nch
->nch_A_CCCondObj
, MUIA_Cycle_Active
, &tmpval
);
3139 nha
->nha_CCCond
= A_CCCondVals
[tmpval
];
3141 get(nch
->nch_A_CCVar2Obj
, MUIA_Cycle_Active
, &tmpval
);
3142 nha
->nha_CCVar2
= A_CCVariableVals
[tmpval
];
3144 get(nch
->nch_A_CCConst1Obj
, MUIA_String_Integer
, &tmpval
);
3145 nha
->nha_CCConst1
= tmpval
;
3147 get(nch
->nch_A_CCConst2Obj
, MUIA_String_Integer
, &tmpval
);
3148 nha
->nha_CCConst2
= tmpval
;
3152 get(nch
->nch_ActionValEnableObj
, MUIA_Selected
, &tmpval
);
3153 nha
->nha_ValEnable
= tmpval
;
3157 get(nch
->nch_A_ValVarObj
, MUIA_Cycle_Active
, &tmpval
);
3158 nha
->nha_ValVar
= A_CCVariableVals
[tmpval
];
3160 get(nch
->nch_A_ValConstObj
, MUIA_String_Integer
, &tmpval
);
3161 nha
->nha_ValConst
= tmpval
;
3167 case MUIM_Action_UpdateAction
:
3169 struct NepHidAction
*nha
;
3170 struct NepHidGItem
*nhgi
;
3172 if((nha
= nch
->nch_GUICurrentAction
))
3174 nha
->nha_IsDefault
= FALSE
;
3176 get(nch
->nch_ActionTriggerObj
, MUIA_Cycle_Active
, &tmpval
);
3177 nha
->nha_Type
= (nha
->nha_Type
& HUA_ATYPEMASK
) | ActionTriggerVals
[tmpval
];
3178 switch(nha
->nha_Type
& HUA_ATYPEMASK
)
3182 get(nch
->nch_A_KeyQualOpObj
, MUIA_Cycle_Active
, &tmpval
);
3183 nha
->nha_QualMode
= A_QualOpVals
[tmpval
];
3185 get(nch
->nch_A_KeyQualObj
, MUIA_Cycle_Active
, &tmpval
);
3186 nha
->nha_Qualifier
= tmpval
;
3191 get(nch
->nch_A_RawKeyUpObj
, MUIA_Selected
, &tmpval
);
3195 get(nch
->nch_A_RawKeyObj
, MUIA_List_Active
, &tmpval
);
3196 nha
->nha_RawKey
= tmpval
|IECODE_UP_PREFIX
;
3199 get(nch
->nch_A_RawKeyObj
, MUIA_List_Active
, &tmpval
);
3200 nha
->nha_RawKey
= tmpval
;
3206 get(nch
->nch_A_VanillaStrObj
, MUIA_String_Contents
, &tmpstr
);
3207 strncpy(nha
->nha_VanillaString
, tmpstr
, 79);
3212 get(nch
->nch_A_KeyStringObj
, MUIA_String_Contents
, &tmpstr
);
3213 strncpy(nha
->nha_KeyString
, tmpstr
, 79);
3218 get(nch
->nch_A_MousePosOpObj
, MUIA_Cycle_Active
, &tmpval
);
3219 nha
->nha_MouseAxis
= A_MousePosOpVals
[tmpval
];
3224 get(nch
->nch_A_MouseButOpObj
, MUIA_Cycle_Active
, &tmpval
);
3225 nha
->nha_ButtonMode
= A_MouseButOpVals
[tmpval
];
3227 get(nch
->nch_A_MouseButObj
, MUIA_Cycle_Active
, &tmpval
);
3228 nha
->nha_ButtonNo
= tmpval
+1;
3233 get(nch
->nch_A_TabletAxisObj
, MUIA_Cycle_Active
, &tmpval
);
3234 nha
->nha_TabletAxis
= A_TabletAxisVals
[tmpval
];
3239 get(nch
->nch_A_WheelOpObj
, MUIA_Cycle_Active
, &tmpval
);
3240 nha
->nha_WheelMode
= A_WheelOpVals
[tmpval
];
3242 get(nch
->nch_A_WheelDistObj
, MUIA_Numeric_Value
, &tmpval
);
3243 nha
->nha_WheelDist
= tmpval
;
3248 get(nch
->nch_A_JoypadOpObj
, MUIA_Cycle_Active
, &tmpval
);
3249 nha
->nha_JoypadOp
= A_JoypadOpVals
[tmpval
];
3251 get(nch
->nch_A_JoypadFeatObj
, MUIA_Cycle_Active
, &tmpval
);
3252 nha
->nha_JoypadFeat
= A_JoypadFeatVals
[tmpval
];
3254 get(nch
->nch_A_JoypadPortObj
, MUIA_Cycle_Active
, &tmpval
);
3255 nha
->nha_JoypadPort
= tmpval
;
3260 get(nch
->nch_A_APadFeatObj
, MUIA_Cycle_Active
, &tmpval
);
3261 nha
->nha_APadFeat
= A_APadFeatVals
[tmpval
];
3263 get(nch
->nch_A_APadPortObj
, MUIA_Cycle_Active
, &tmpval
);
3264 nha
->nha_JoypadPort
= tmpval
;
3269 get(nch
->nch_A_SoundFileObj
, MUIA_String_Contents
, &tmpstr
);
3270 strncpy(nha
->nha_SoundFile
, tmpstr
, 255);
3272 get(nch
->nch_A_SoundVolObj
, MUIA_Numeric_Value
, &tmpval
);
3273 nha
->nha_SoundVolume
= tmpval
;
3278 get(nch
->nch_A_ShellComObj
, MUIA_String_Contents
, &tmpstr
);
3279 strncpy(nha
->nha_ExeString
, tmpstr
, 79);
3281 get(nch
->nch_A_ShellAsyncObj
, MUIA_Selected
, &tmpval
);
3282 nha
->nha_ShellAsync
= tmpval
;
3286 DoMethod(nch
->nch_A_OutItemLVObj
, MUIM_List_GetEntry
, MUIV_List_GetEntry_Active
, &nhgi
);
3288 get(nch
->nch_A_OutOpObj
, MUIA_Cycle_Active
, &tmpval
);
3289 nha
->nha_OutOp
= A_OutOpVals
[tmpval
];
3291 get(nch
->nch_A_OutArrayObj
, MUIA_String_Contents
, &tmpstr
);
3292 strncpy(nha
->nha_OutArray
, tmpstr
, 255);
3295 nha
->nha_OutItem
= GET_WTYPE(nhgi
->nhgi_ActionList
);
3296 if(nhgi
->nhgi_Item
->nhi_Flags
& RPF_MAIN_VARIABLE
)
3298 set(nch
->nch_A_OutArrayObj
, MUIA_Disabled
, TRUE
);
3299 set(nch
->nch_A_OutOpObj
, MUIA_Disabled
, FALSE
);
3301 set(nch
->nch_A_OutArrayObj
, MUIA_Disabled
, FALSE
);
3302 set(nch
->nch_A_OutOpObj
, MUIA_Disabled
, TRUE
);
3305 nha
->nha_OutItem
= 0;
3310 DoMethod(nch
->nch_A_FeatItemLVObj
, MUIM_List_GetEntry
, MUIV_List_GetEntry_Active
, &nhgi
);
3312 get(nch
->nch_A_FeatOpObj
, MUIA_Cycle_Active
, &tmpval
);
3313 nha
->nha_FeatOp
= A_OutOpVals
[tmpval
];
3315 get(nch
->nch_A_FeatArrayObj
, MUIA_String_Contents
, &tmpstr
);
3316 strncpy(nha
->nha_OutArray
, tmpstr
, 255);
3319 nha
->nha_FeatItem
= GET_WTYPE(nhgi
->nhgi_ActionList
);
3321 nha
->nha_FeatItem
= 0;
3327 get(nch
->nch_A_MiscOpObj
, MUIA_Cycle_Active
, &tmpval
);
3328 nha
->nha_MiscMode
= A_MiscOpVals
[tmpval
];
3333 get(nch
->nch_A_TarVarObj
, MUIA_Cycle_Active
, &tmpval
);
3334 nha
->nha_TarVar
= A_TarVariableVals
[tmpval
];
3336 get(nch
->nch_A_TarVarOpObj
, MUIA_Cycle_Active
, &tmpval
);
3337 nha
->nha_TarVarOp
= A_TarVarOpVals
[tmpval
];
3342 get(nch
->nch_A_ExtRawKeyUpObj
, MUIA_Selected
, &tmpval
);
3346 get(nch
->nch_A_ExtRawKeyObj
, MUIA_List_Active
, &tmpval
);
3347 nha
->nha_RawKey
= tmpval
|IECODE_UP_PREFIX
;
3350 get(nch
->nch_A_ExtRawKeyObj
, MUIA_List_Active
, &tmpval
);
3351 nha
->nha_RawKey
= tmpval
;
3356 DoMethod(nch
->nch_ActionLVObj
, MUIM_List_Redraw
, MUIV_List_Redraw_Active
);
3361 case MUIM_Action_KeymapSelectUSB
:
3362 DoMethod(nch
->nch_USBKeymapLVObj
, MUIM_List_GetEntry
, MUIV_List_GetEntry_Active
, &hum
);
3365 nch
->nch_CurrUSBKey
= hum
->hum_ID
| 0x070000;
3366 set(nch
->nch_RawKeymapLVObj
, MUIA_List_Active
, nch
->nch_KeymapCfg
.kmc_Keymap
[hum
->hum_ID
]);
3370 case MUIM_Action_KeymapSelectRaw
:
3371 DoMethod(nch
->nch_USBKeymapLVObj
, MUIM_List_GetEntry
, MUIV_List_GetEntry_Active
, &hum
);
3375 get(nch
->nch_RawKeymapLVObj
, MUIA_List_Active
, &tmpval
);
3376 nch
->nch_KeymapCfg
.kmc_Keymap
[hum
->hum_ID
] = tmpval
;
3380 case MUIM_Action_RestDefKeymap
:
3381 CopyMemQuick(usbkeymap
, nch
->nch_KeymapCfg
.kmc_Keymap
, 256);
3382 DoMethod(nch
->nch_USBKeymapLVObj
, MUIM_List_GetEntry
, MUIV_List_GetEntry_Active
, &hum
);
3385 nch
->nch_CurrUSBKey
= hum
->hum_ID
| 0x070000;
3386 set(nch
->nch_RawKeymapLVObj
, MUIA_List_Active
, nch
->nch_KeymapCfg
.kmc_Keymap
[hum
->hum_ID
]);
3390 case MUIM_Action_ShowHIDControl
:
3394 DoMethod(nch
->nch_HCApp
, MUIM_Application_PushMethod
,
3395 nch
->nch_HCActionObj
, 1, MUIM_Action_ShowHIDControl
);
3400 return(DoSuperMethodA(cl
,obj
,msg
));