revert between 56095 -> 55830 in arch
[AROS.git] / rom / usb / classes / hid / hid.h
blob367040d6674ea185c484ee110d6f6baab9342342
1 #ifndef HID_H
2 #define HID_H
4 #include <devices/keyboard.h>
5 #include <intuition/intuition.h>
6 #include <intuition/intuitionbase.h>
7 #include <libraries/mui.h>
8 #include <libraries/gadtools.h>
10 #if defined(__GNUC__)
11 # pragma pack(2)
12 #endif
14 struct ClsDevCfg
16 ULONG cdc_ChunkID;
17 ULONG cdc_Length;
18 ULONG cdc_EnableKBReset;
19 ULONG cdc_EnableRH;
20 ULONG cdc_ResetDelay;
21 ULONG cdc_ShellStack;
22 char cdc_ShellCon[128];
23 ULONG cdc_PollingMode;
24 ULONG cdc_LLPortMode[4];
25 ULONG cdc_HIDCtrlOpen;
26 char cdc_HIDCtrlRexx[32];
27 char cdc_HIDCtrlTitle[32];
28 ULONG cdc_LLRumblePort;
29 ULONG cdc_TurboMouse;
32 struct KeymapCfg
34 ULONG kmc_ChunkID;
35 ULONG kmc_Length;
36 UBYTE kmc_Keymap[256];
39 struct NepHidActionChunk
41 ULONG nhac_ID;
42 ULONG nhac_Length;
43 UWORD nhac_Type;
44 UBYTE nhac_QualMode;
45 UBYTE nhac_Qualifier;
46 UBYTE nhac_MouseAxis;
47 UBYTE nhac_WheelMode;
48 UBYTE nhac_WheelDist;
49 UBYTE nhac_ButtonMode;
50 UBYTE nhac_ButtonNo;
51 UBYTE nhac_RawKey;
52 UBYTE nhac_TabletAxis;
53 UBYTE nhac_SoundVolume;
54 UBYTE nhac_ShellAsync;
55 UBYTE nhac_MiscMode;
56 UBYTE nhac_AbsToRel;
57 UBYTE nhac_ScaleEnable;
58 UBYTE nhac_ClipEnable;
59 UBYTE nhac_CCEnable;
60 UBYTE nhac_ClipMin;
61 UBYTE nhac_ClipMax;
62 UBYTE nhac_ClipStretch;
63 UBYTE nhac_CCVar1;
64 UBYTE nhac_CCCond;
65 UBYTE nhac_CCVar2;
66 UBYTE nhac_ValEnable;
67 UBYTE nhac_ValVar;
68 LONG nhac_ScaleMin;
69 LONG nhac_ScaleMax;
70 LONG nhac_CCConst1;
71 LONG nhac_CCConst2;
72 LONG nhac_ValConst;
73 UBYTE nhac_JoypadOp;
74 UBYTE nhac_JoypadFeat;
75 UBYTE nhac_JoypadPort;
76 UBYTE nhac_TarVar;
77 UBYTE nhac_TarVarOp;
78 UBYTE nhac_OutOp;
79 UWORD nhac_OutItem;
80 UWORD nhac_FeatItem;
81 UBYTE nhac_FeatOp;
82 UBYTE nhac_APadFeat;
85 struct NepHidAction
87 struct Node nha_Node;
88 UWORD nha_Type;
89 /* HUA_QUALIFIER */
90 UBYTE nha_QualMode;
91 UBYTE nha_Qualifier;
92 /* HUA_MOUSEPOS */
93 UBYTE nha_MouseAxis;
94 UBYTE nha_WheelMode;
95 UBYTE nha_WheelDist;
96 /* HUA_BUTTONS */
97 UBYTE nha_ButtonMode;
98 UBYTE nha_ButtonNo;
99 /* HUA_RAWKEY */
100 UBYTE nha_RawKey;
101 /* HUA_TABLET */
102 UBYTE nha_TabletAxis;
103 /* HUA_SOUND */
104 UBYTE nha_SoundVolume;
105 UBYTE nha_ShellAsync;
106 UBYTE nha_MiscMode;
107 /* action options */
108 UBYTE nha_AbsToRel;
109 UBYTE nha_ScaleEnable;
110 UBYTE nha_ClipEnable;
111 UBYTE nha_CCEnable;
112 UBYTE nha_ClipMin;
113 UBYTE nha_ClipMax;
114 UBYTE nha_ClipStretch;
115 UBYTE nha_CCVar1;
116 UBYTE nha_CCCond;
117 UBYTE nha_CCVar2;
118 UBYTE nha_ValEnable;
119 UBYTE nha_ValVar;
120 LONG nha_ScaleMin;
121 LONG nha_ScaleMax;
122 LONG nha_CCConst1;
123 LONG nha_CCConst2;
124 LONG nha_ValConst;
125 /* HUA_DIGJOY */
126 UBYTE nha_JoypadOp;
127 UBYTE nha_JoypadFeat;
128 UBYTE nha_JoypadPort;
129 /* HUA_VARIABLES */
130 UBYTE nha_TarVar;
131 UBYTE nha_TarVarOp;
132 /* HUA_OUTPUT */
133 UBYTE nha_OutOp;
134 UWORD nha_OutItem;
135 /* HUA_FEATURE */
136 UWORD nha_FeatItem;
137 UBYTE nha_FeatOp;
138 UBYTE nha_APadFeat;
140 char nha_SoundFile[256];
141 /* HUA_VANILLA */
142 char nha_VanillaString[80];
143 /* HUA_KEYSTRING */
144 char nha_KeyString[80];
145 /* HUA_SHELL */
146 char nha_ExeString[80];
147 char nha_OutArray[256];
148 BOOL nha_IsDefault;
151 #if defined(__GNUC__)
152 # pragma pack()
153 #endif
155 /* Action Types */
156 #define HUA_NOP 0x0000 /* implemented (haha!) */
157 #define HUA_QUALIFIER 0x0001 /* implemented */
158 #define HUA_KEYMAP 0x0002 /* implemented */
159 #define HUA_RAWKEY 0x0003 /* implemented */
160 #define HUA_VANILLA 0x0004 /* implemented */
161 #define HUA_KEYSTRING 0x0005 /* implemented */
162 #define HUA_MOUSEPOS 0x0006 /* implemented */
163 #define HUA_BUTTONS 0x0007 /* implemented */
164 #define HUA_TABLET 0x0008 /* implemented */
165 #define HUA_DIGJOY 0x0009 /* implemented */
166 #define HUA_ANALOGJOY 0x000a /* implemented */
167 #define HUA_WHEEL 0x000b /* implemented */
168 #define HUA_SOUND 0x000c /* implemented */
169 #define HUA_SHELL 0x000d /* implemented */
170 #define HUA_AREXX 0x000e
171 #define HUA_OUTPUT 0x000f /* implemented */
172 #define HUA_FEATURE 0x0010 /* implemented */
173 #define HUA_MISC 0x0011 /* implemented */
174 #define HUA_VARIABLES 0x0012 /* implemented */
175 #define HUA_EXTRAWKEY 0x0013 /* implemented */
176 #define HUA_ATYPEMASK 0x0fff
178 #define HUA_DOWNEVENT 0x4000
179 #define HUA_UPEVENT 0x8000
180 #define HUA_ANY (HUA_DOWNEVENT|HUA_UPEVENT)
181 #define HUA_ALWAYS (0x2000|HUA_ANY)
182 #define HUA_NAN 0x1000
183 #define HUA_TRIGMASK 0xf000
185 #define HUAT_SET 0x01
186 #define HUAT_CLEAR 0x02
187 #define HUAT_TOGGLE 0x03
188 #define HUAT_ASSIGN 0x04
189 #define HUAT_ADD 0x05
190 #define HUAT_SUB 0x06
191 #define HUAT_MULTIPLY 0x07
192 #define HUAT_DIVIDE 0x08
193 #define HUAT_MODULO 0x09
194 #define HUAT_ASSNOT 0x0a
196 #define HUAT_AND 0x10
197 #define HUAT_OR 0x11
198 #define HUAT_XOR 0x12
199 #define HUAT_BWAND 0x13
200 #define HUAT_BWOR 0x14
201 #define HUAT_BWXOR 0x15
202 #define HUAT_ASL 0x16
203 #define HUAT_ASR 0x17
204 #define HUAT_ANDNOT 0x18
205 #define HUAT_BWANDNOT 0x19
206 #define HUAT_NAND 0x1a
207 #define HUAT_BWNAND 0x1b
209 #define HUAT_EQ 0x60
210 #define HUAT_NE 0x61
211 #define HUAT_LT 0x62
212 #define HUAT_LE 0x63
213 #define HUAT_GT 0x64
214 #define HUAT_GE 0x65
216 #define HUAT_DELTAX 0x20
217 #define HUAT_DELTAY 0x21
218 #define HUAT_LEFT 0x22
219 #define HUAT_RIGHT 0x23
220 #define HUAT_UP 0x24
221 #define HUAT_DOWN 0x25
222 #define HUAT_RED 0x26
223 #define HUAT_BLUE 0x27
224 #define HUAT_GREEN 0x28
225 #define HUAT_YELLOW 0x29
226 #define HUAT_FORWARD 0x2a
227 #define HUAT_REVERSE 0x2b
228 #define HUAT_PLAY 0x2c
229 #define HUAT_HATSWITCH 0x2d
230 #define HUAT_ABSX 0x30
231 #define HUAT_ABSY 0x31
233 #define HUAT_PRESSURE 0x40
234 #define HUAT_XROT 0x41
235 #define HUAT_YROT 0x42
236 #define HUAT_ZROT 0x43
237 #define HUAT_PROX 0x44
238 #define HUAT_ABSZ 0x45
240 #define HUAT_ACTWINDOW 0x80
241 #define HUAT_WIN2FRONT 0x81
242 #define HUAT_WIN2BACK 0x82
243 #define HUAT_CLOSEWINDOW 0x83
244 #define HUAT_ZIPWINDOW 0x84
245 #define HUAT_SCREENCYCLE 0x85
246 #define HUAT_WB2FRONT 0x86
247 #define HUAT_DISPLAYBEEP 0x87
248 #define HUAT_REBOOT 0x88
249 #define HUAT_FLUSHEVENTS 0x89
251 #define HUAT_GLOBVARA 0xa0
252 #define HUAT_GLOBVARB 0xa1
253 #define HUAT_GLOBVARC 0xa2
254 #define HUAT_GLOBVARD 0xa3
255 #define HUAT_GLOBVARE 0xa4
256 #define HUAT_GLOBVARF 0xa5
257 #define HUAT_GLOBVARG 0xa6
258 #define HUAT_GLOBVARH 0xa7
260 #define HUAT_LOCALVAR1 0xb1
261 #define HUAT_LOCALVAR2 0xb2
262 #define HUAT_LOCALVAR3 0xb3
263 #define HUAT_LOCALVAR4 0xb4
264 #define HUAT_LOCALVAR5 0xb5
265 #define HUAT_LOCALVAR6 0xb6
266 #define HUAT_LOCALVAR7 0xb7
267 #define HUAT_LOCALVAR8 0xb8
269 #define HUAT_EITEMVALUE 0xc0
270 #define HUAT_OITEMVALUE 0xc1
271 #define HUAT_CONST 0xc2
272 #define HUAT_CLICKCOUNT 0xc3
273 #define HUAT_QUALIFIERS 0xc4
274 #define HUAT_RANDOMBIT 0xc5
275 #define HUAT_RANDOMVAL 0xc6
276 #define HUAT_CLICKTIME 0xc7
277 #define HUAT_TIMER 0xc8
278 #define HUAT_ALLQUAL 0xc9
281 /* Annotations for the stuff
283 Global interface stuff:
284 Change keymap
285 Shell con window, shell stack
287 Reset handler, Reboot delay
289 * HUA_QUALIFIER:
290 {set|clear|toggle|assign} qualifier {X}
291 [{report state} to LED page]
293 * HUA_KEYMAP:
294 1:1 mapping of keyboard to the global interface keymap
296 * HUA_RAWKEY:
297 Send {keyvalue} {down|up|both}
298 [Record key]
300 * HUA_VANILLA:
301 Send {vanilla key} to keyboard
303 * HUA_KEYSTRING:
304 Send {keystring} to keyboard
306 * HUA_MOUSEPOS:
307 [CM] Send {X|Y} {relative|absolute} mousepos
308 [CM] Move {X|Y} relative {delta}
310 * HUA_BUTTONS:
311 {set|clear|toggle|assign} {lmb|rmb|mmb|4b|5b}
313 * HUA_TABLET:
314 Send {X axis|Y axis|Z axis|X rot.|Y rot.|Z rot.|Pressure|Proximity}
315 Pressure threshold for LMB: {percentage}
317 * HUA_DIGJOY:
318 Send {left|right|up|down|fire1|fire2} to port {0|1}
319 Threshold {percentage}
321 * HUA_ANALOGJOY:
323 * HUA_WHEEL:
324 Send {deltax|deltay|left|right|up|down}. {WheelDist}
326 * HUA_SOUND:
327 Play {soundfile} at {volume}
329 * HUA_SHELL:
330 Launch {commandline} {synchroneously|async}
332 * HUA_MISC:
333 {Activate Window|WindowToFront|WindowToBack|Screencycle|WB2Front|CloseWindow|ZoomWindow|Reboot}
335 * HUA_AREXX:
337 * HUA_OUTPUT:
339 * HUA_EXTRAWKEY:
340 Send {keyvalue} {down|up|both}
344 #define HID_PARAM_UNDEF 0x80000000
346 struct NepHidGlobal
348 struct Node nhg_Node;
349 ULONG nhg_UsagePage;
350 LONG nhg_LogicalMin;
351 LONG nhg_LogicalMax;
352 LONG nhg_PhysicalMin;
353 LONG nhg_PhysicalMax;
354 LONG nhg_UnitExp;
355 ULONG nhg_Unit;
356 ULONG nhg_ReportID;
357 ULONG nhg_ReportSize;
358 ULONG nhg_ReportCount;
361 struct NepHidUsage
363 struct Node nhu_Node;
364 ULONG nhu_Usage;
365 ULONG nhu_UsageMax;
368 struct NepHidCollection
370 struct Node nhc_Node;
371 struct NepHidCollection *nhc_Parent;
372 struct NepHidReport *nhc_Report; /* uplink */
373 ULONG nhc_Usage; /* Usage ID */
374 STRPTR nhc_Name; /* Name of this top collection */
375 struct List nhc_Items; /* List of items */
378 struct NepHidItem
380 struct Node nhi_Node;
381 struct NepHidCollection *nhi_Collection; /* uplink */
382 UWORD nhi_Type;
383 ULONG nhi_Flags;
384 UWORD nhi_Offset;
385 UWORD nhi_Size;
386 BOOL nhi_IsSigned;
388 ULONG nhi_Count; /* only for arrays */
389 ULONG nhi_MapSize; /* only for arrays */
390 ULONG *nhi_UsageMap; /* only for arrays */
391 struct List *nhi_ActionMap; /* only for arrays */
392 LONG *nhi_Buffer; /* only for arrays */
393 LONG *nhi_OldBuffer; /* only for arrays */
395 LONG nhi_LogicalMin;
396 LONG nhi_LogicalMax;
397 LONG nhi_PhysicalMin;
398 LONG nhi_PhysicalMax;
399 LONG nhi_UnitExp;
400 ULONG nhi_Unit;
402 LONG nhi_RealMin; /* after abs->rel conversion */
403 LONG nhi_RealMax; /* after abs->rel conversion */
405 ULONG nhi_Usage; /* only for variables */
406 ULONG nhi_DesignIndex;
407 ULONG nhi_StringIndex;
409 LONG nhi_OldValue; /* old value */
411 ULONG nhi_LastMicros; /* time of last up->down transition */
412 ULONG nhi_LastSeconds;
413 ULONG nhi_HoldMicros; /* time of last up->down transition (until up event) */
414 ULONG nhi_HoldSeconds;
415 ULONG nhi_ClickCount;
417 struct List nhi_ActionList; /* Action (or default action for arrays) */
418 BOOL nhi_SameUsages; /* For arrays, if all usageIDs are the same */
421 /* nhgi_ObjTypes */
422 #define NHGIOT_SHOTBUTTON 1
423 #define NHGIOT_TOGGLEBUTTON 2
424 #define NHGIOT_SLIDER 3
425 #define NHGIOT_SLIDERIMM 4
427 struct NepHidGItem
429 struct Node nhgi_Node;
430 STRPTR nhgi_Name;
431 struct NepHidItem *nhgi_Item;
432 struct List *nhgi_ActionList;
433 Object *nhgi_GUIObj;
434 UWORD nhgi_ObjType;
437 struct NepHidReport
439 struct Node nhr_Node; /* Node linkage */
440 ULONG nhr_ReportLength; /* Report Buffer Length */
441 UBYTE *nhr_ReportBuf; /* Report descriptor buffer */
443 ULONG nhr_ReportInSize; /* Size of report in bits */
444 ULONG nhr_ReportOutSize; /* Size of report in bits */
445 ULONG nhr_ReportFeatSize; /* Size of report in bits */
446 ULONG nhr_InItemCount; /* Number of in items */
447 ULONG nhr_OutItemCount; /* Number of out items */
448 ULONG nhr_FeatItemCount; /* Number of feature items */
449 ULONG nhr_ReportID; /* Report ID */
450 BOOL nhr_OutTouched; /* Some output item was touched */
451 BOOL nhr_FeatTouched; /* Some feature item was touched */
452 struct List nhr_Collections; /* Top collections */
453 struct NepHidItem **nhr_InItemMap; /* Array to items at bitpos */
454 struct NepHidItem **nhr_OutItemMap; /* Array to items at bitpos */
455 struct NepHidItem **nhr_FeatItemMap; /* Array to items at bitpos */
456 UWORD nhr_ItemIDBase; /* Starting offset for items (lh_Type) in this report */
459 struct NepClassHid
461 struct Node nch_Node; /* Node linkage */
462 struct NepHidBase *nch_ClsBase; /* Up linkage */
463 struct Library *nch_Base; /* Poseidon base */
464 struct Library *nch_HIntBase; /* Intuition base (hid class) */
465 struct PsdDevice *nch_Device; /* Up linkage */
466 struct PsdConfig *nch_Config; /* Up linkage */
467 struct PsdInterface *nch_Interface; /* Up linkage */
468 struct PsdPipe *nch_EP0Pipe; /* Endpoint 0 pipe */
469 struct PsdEndpoint *nch_EPIn; /* Endpoint Int In */
470 struct PsdPipe *nch_EPInPipe; /* Endpoint Int In pipe */
471 struct PsdEndpoint *nch_EPOut; /* optional Endpoint Int Out */
472 struct PsdPipe *nch_EPOutPipe; /* optional Endpoint Int Out pipe */
473 UBYTE *nch_EPInBuf; /* Packet buffer for EPIn */
474 UBYTE *nch_EPOutBuf; /* Packet buffer for EPOut */
475 IPTR nch_EPInInterval; /* Interval for polling */
476 struct Task *nch_ReadySigTask; /* Task to send ready signal to */
477 LONG nch_ReadySignal; /* Signal to send when ready */
478 struct Task *nch_Task; /* Subtask */
479 struct MsgPort *nch_TaskMsgPort; /* Message Port of Subtask */
480 struct MsgPort *nch_InpMsgPort; /* input.device MsgPort */
481 struct IOStdReq *nch_InpIOReq; /* input.device IORequest */
482 struct InputEvent nch_FakeEvent; /* Input Event */
483 struct IENewTablet nch_TabletEvent; /* Tablet Event */
484 struct Library *nch_InputBase; /* Pointer to input.device base */
485 IPTR nch_IfNum; /* Interface number */
487 struct UsbHidDesc *nch_HidDesc; /* HID Descriptor */
488 struct List nch_HidReports; /* List of reports */
489 struct List nch_HidStack; /* Global Stack for push/pop */
490 struct List nch_HidUsages; /* List of usages */
491 struct List nch_HidDesigns; /* List of designators */
492 struct List nch_HidStrings; /* List of strings */
493 struct NepHidGlobal nch_HidGlobal; /* Global variables */
494 BOOL nch_UsesReportID; /* one byte report prefix */
495 UWORD nch_MaxReportID; /* max report ID */
496 ULONG nch_MaxReportSize; /* Size of buffer */
497 ULONG nch_MaxInSize; /* Size of EPIn packets */
498 ULONG nch_MaxOutSize; /* Size of EPOut packets */
499 ULONG nch_MaxFeatSize; /* Size of EPOut packets */
500 struct NepHidReport **nch_ReportMap; /* direct report mapping */
502 STRPTR nch_DevIDString; /* Device ID String */
503 STRPTR nch_IfIDString; /* Interface ID String */
505 BOOL nch_OS4Hack; /* Use ADDEVENT when possible */
506 BOOL nch_TrackKeyEvents;
507 ULONG nch_LastUSBKey;
508 ULONG nch_CurrUSBKey;
509 BOOL nch_TrackEvents;
510 BOOL nch_ReportValues;
511 BOOL nch_DisableActions;
512 BOOL nch_ItemChanged;
513 struct NepHidItem *nch_LastItem;
514 struct List *nch_LastItemAList;
516 struct NepHidItem *nch_XtraInitItem; /* item to be called at start */
517 struct NepHidItem *nch_XtraQuitItem; /* item to be called at end */
519 /* variables for actions */
520 BOOL nch_OutFeatTouched; /* indicate change at output or feature items */
521 BOOL nch_NewQualifiers; /* Trigger qualifiers event */
522 ULONG nch_KeyQualifiers; /* Key qualifiers */
524 BOOL nch_NewMouseRel; /* Trigger mousepos event */
525 ULONG nch_MouseAbsX; /* Absolute Mouse X movement */
526 ULONG nch_MouseAbsY; /* Absolute Mouse Y movement */
527 ULONG nch_MouseAbsZ; /* Absolute Stylus Z movement */
528 ULONG nch_MouseRangeX; /* Max Mouse X range */
529 ULONG nch_MouseRangeY; /* Max Mouse Y range */
530 ULONG nch_MouseRangeZ; /* Max Mouse Z range */
531 BOOL nch_NewMouseAbs; /* Trigger mousepos event */
532 ULONG nch_MouseDeltaX; /* Delta Mouse X movement */
533 ULONG nch_MouseDeltaY; /* Delta Mouse Y movement */
535 ULONG nch_MouseButtons; /* mouse button bits */
536 BOOL nch_VldPressure; /* Tablet Pressure valid */
537 BOOL nch_VldRotX; /* Tablet X Rotation valid */
538 BOOL nch_VldRotY; /* Tablet Y Rotation valid */
539 BOOL nch_VldRotZ; /* Tablet Y Rotation valid */
540 BOOL nch_VldProx; /* Tablet Proximits valid */
542 LONG nch_TabPressure; /* Tablet Pressure */
543 LONG nch_TabRotX; /* Tablet X Rotation */
544 LONG nch_TabRotY; /* Tablet Y Rotation */
545 LONG nch_TabRotZ; /* Tablet Z Rotation */
546 BOOL nch_TabProx; /* Tablet Proximity */
548 ULONG nch_TabTags[20];
550 struct NepHidItem *nch_RumbleMotors[2]; /* Rumble motor item cache */
551 ULONG nch_LLPortState[4]; /* Joypad port status */
552 ULONG nch_LLHatswitch[4]; /* Hatswitch stuff */
553 ULONG nch_LLAnalogue[4]; /* Analogue joypad stuff */
554 ULONG nch_LocalVars[8]; /* local variables */
556 BOOL nch_UsingDefaultCfg;
557 BOOL nch_ReloadCfg; /* indicator for the HidTask */
558 struct ClsDevCfg *nch_CDC;
559 ULONG nch_LastCfgCRC; /* use this to check config change */
561 struct Library *nch_MUIBase; /* MUI master base */
562 struct Library *nch_PsdBase; /* Poseidon base */
563 struct Library *nch_IntBase; /* Intuition base (GUI task) */
564 struct Library *nch_KeyBase; /* Keymap base */
565 struct Task *nch_GUITask; /* GUI Task */
566 LONG nch_TrackingSignal;
568 BOOL nch_HasInItems; /* do we need to read requests at all? */
569 UWORD nch_WacomMode; /* Use Wacom stuff */
570 struct NepHidCollection *nch_WacomColl; /* Wacom items */
572 BOOL nch_IOStarted; /* IO Running */
573 BOOL nch_Running; /* Not suspended */
575 struct Hook nch_USBKeyListDisplayHook;
576 struct Hook nch_ReportListDisplayHook;
577 struct Hook nch_ItemListDisplayHook;
578 struct Hook nch_ActionListDisplayHook;
580 struct List nch_GUIItems;
581 struct List nch_GUIOutItems;
583 struct NepHidCollection *nch_GUICurrentColl;
584 struct NepHidGItem *nch_GUICurrentItem;
585 struct NepHidAction *nch_GUICurrentAction;
586 BOOL nch_SilentActionUpdate;
588 struct MUI_CustomClass *nch_ActionClass;
590 Object *nch_App;
591 Object *nch_MainWindow;
592 Object *nch_ActionObj;
593 Object *nch_ConWindowObj;
594 Object *nch_ShellStackObj;
595 Object *nch_EnableKBResetObj;
596 Object *nch_EnableRHObj;
597 Object *nch_ResetDelayObj;
598 Object *nch_TurboMouseObj;
600 Object *nch_HIDCtrlAutoObj;
601 Object *nch_HIDCtrlOpenObj;
602 Object *nch_HIDCtrlRexxObj;
603 Object *nch_HIDCtrlTitleObj;
605 Object *nch_LLPortModeObj[4];
606 Object *nch_LLRumblePortObj;
608 Object *nch_USBKeymapLVObj;
609 Object *nch_RawKeymapLVObj;
610 Object *nch_RestoreDefKeymapObj;
611 Object *nch_TrackKeyEventsObj;
613 Object *nch_ActionPageObj;
614 Object *nch_ActionSelectorObj;
615 Object *nch_ActionTriggerObj;
617 Object *nch_ReportLVObj;
618 Object *nch_FillDefObj;
619 Object *nch_ClearActionsObj;
620 Object *nch_TrackEventsObj;
621 Object *nch_DisableActionsObj;
622 Object *nch_ReportValuesObj;
624 Object *nch_ItemLVObj;
626 Object *nch_ActionLVObj;
627 Object *nch_ActionNewObj;
628 Object *nch_ActionCopyObj;
629 Object *nch_ActionDelObj;
630 Object *nch_ActionUpObj;
631 Object *nch_ActionDownObj;
633 Object *nch_ActionAbsToRelObj;
634 Object *nch_ActionClipEnableObj;
635 Object *nch_ActionScaleEnableObj;
636 Object *nch_ActionCCEnableObj;
637 Object *nch_ActionValEnableObj;
639 Object *nch_A_ClipGroupObj;
640 Object *nch_A_ClipMinObj;
641 Object *nch_A_ClipMaxObj;
642 Object *nch_A_ClipStretchObj;
644 Object *nch_A_ScaleGroupObj;
645 Object *nch_A_ScaleMinObj;
646 Object *nch_A_ScaleMaxObj;
648 Object *nch_A_CCGroupObj;
649 Object *nch_A_CCVar1Obj;
650 Object *nch_A_CCCondObj;
651 Object *nch_A_CCVar2Obj;
652 Object *nch_A_CCConst1Obj;
653 Object *nch_A_CCConst2Obj;
655 Object *nch_A_ValGroupObj;
656 Object *nch_A_ValVarObj;
657 Object *nch_A_ValConstObj;
659 Object *nch_ActionAreaObj;
661 Object *nch_A_KeyQualOpObj;
662 Object *nch_A_KeyQualObj;
663 Object *nch_A_RawKeyObj;
664 Object *nch_A_RawKeyUpObj;
665 Object *nch_A_VanillaStrObj;
666 Object *nch_A_KeyStringObj;
667 Object *nch_A_MousePosOpObj;
668 Object *nch_A_MouseButOpObj;
669 Object *nch_A_MouseButObj;
670 Object *nch_A_TabletAxisObj;
671 Object *nch_A_JoypadOpObj;
672 Object *nch_A_JoypadFeatObj;
673 Object *nch_A_JoypadPortObj;
674 Object *nch_A_APadFeatObj;
675 Object *nch_A_APadPortObj;
676 Object *nch_A_WheelOpObj;
677 Object *nch_A_WheelDistObj;
678 Object *nch_A_SoundFileObj;
679 Object *nch_A_SoundVolObj;
680 Object *nch_A_ShellComObj;
681 Object *nch_A_ShellAsyncObj;
682 Object *nch_A_MiscOpObj;
683 Object *nch_A_TarVarObj;
684 Object *nch_A_TarVarOpObj;
686 Object *nch_A_OutItemLVObj;
687 Object *nch_A_OutArrayObj;
688 Object *nch_A_OutOpObj;
689 Object *nch_A_FeatItemLVObj;
690 Object *nch_A_FeatArrayObj;
691 Object *nch_A_FeatOpObj;
692 Object *nch_A_ExtRawKeyObj;
693 Object *nch_A_ExtRawKeyUpObj;
695 Object *nch_UseObj;
696 Object *nch_SetDefaultObj;
697 Object *nch_CloseObj;
699 Object *nch_AboutMI;
700 Object *nch_UseMI;
701 Object *nch_SetDefaultMI;
702 Object *nch_MUIPrefsMI;
703 Object *nch_SwapLMBRMBMI;
704 Object *nch_MouseAccel100MI;
705 Object *nch_MouseAccel150MI;
706 Object *nch_MouseAccel200MI;
707 Object *nch_JoyPort0MI;
708 Object *nch_JoyPort1MI;
709 Object *nch_JoyPort2MI;
710 Object *nch_JoyPort3MI;
711 Object *nch_JoyAutofireMI;
712 Object *nch_DebugReportMI;
714 BOOL nch_QuitGUI;
716 struct KeymapCfg nch_KeymapCfg;
717 char nch_TmpStrBuf0[128];
718 char nch_TmpStrBufReport[128];
719 char nch_TmpStrBufItem[128];
720 char nch_TmpStrBufAction[128];
721 struct HidUsageIDMap *nch_USBKeyArray[257]; /* Pointer to array of all USB Keymap strings */
722 STRPTR nch_RawKeyArray[129]; /* Pointer to array of all converted ANSI strings */
723 STRPTR nch_ExtRawKeyArray[129]; /* Pointer to array of all converted ANSI strings */
725 struct Library *nch_HCMUIBase; /* MUI master base */
726 struct Library *nch_HCPsdBase; /* Poseidon base */
727 struct Library *nch_HCIntBase; /* Intuition base (GUI task) */
728 struct Task *nch_HCGUITask; /* GUI Task */
730 struct List nch_HCGUIItems;
732 struct MUI_CustomClass *nch_HCActionClass;
734 Object *nch_HCApp;
735 Object *nch_HCMainWindow;
736 Object *nch_HCActionObj;
737 Object *nch_HCGroupObj;
738 Object *nch_HCCloseObj;
740 Object *nch_HCAboutMI;
741 Object *nch_HCCloseMI;
742 Object *nch_HCMUIPrefsMI;
745 struct NepHidBase
747 struct Library nh_Library; /* standard */
748 UWORD nh_Flags; /* various flags */
750 struct Library *nh_UtilityBase; /* Utility base */
752 struct Task *nh_DispatcherTask; /* external task to do all the dirty stuff */
753 struct Task *nh_ReadySigTask; /* task to respond to */
754 ULONG nh_ReadySignal; /* signal to use */
756 struct Library *nh_DOSBase;
757 struct IntuitionBase *nh_IntBase;
758 struct Library *nh_DTBase;
759 struct Library *nh_CxBase;
760 struct Library *nh_LayersBase;
761 struct Library *nh_LowLevelBase; /* lowlevel library base for patching */
762 struct MsgPort *nh_DTaskMsgPort;
763 struct MsgPort *nh_InpMsgPort; /* input.device MsgPort */
764 struct IOStdReq *nh_InpIOReq; /* input.device IORequest */
765 struct InputEvent nh_FakeEvent; /* Input Event */
767 APTR nh_LLOldReadJoyPort; /* old vector */
768 APTR nh_LLOldSetJoyPortAttrsA; /* old vector */
769 BOOL nh_LLAnalogueOverride[4]; /* override prefs */
770 BOOL nh_OS4Hack; /* Use ADDEVENT when possible */
772 struct List nh_Sounds;
774 struct List nh_Interfaces; /* list of interfaces */
776 LONG nh_GlobalVars[8]; /* global variables */
777 ULONG *nh_IntFuncTable;
779 struct NepClassHid nh_DummyNCH; /* Dummy NCH for default config */
781 LONG nh_Seed; /* seed variable for random numbers */
784 #define WACOM_HASTILT 1
785 #define WACOM_HASWHEEL 2
786 #define WACOM_HASBUTTONS 4
788 #define WACOM_PENPARTNER 1
789 #define WACOM_GRAPHIRE 2
790 #define WACOM_GRAPHIRE4 3
791 #define WACOM_CINTIQ 4
792 #define WACOM_INTUOS 5
793 #define WACOM_INTUOS3 6
794 #define WACOM_PL 7
795 #define WACOM_PL2 8
796 #define WACOM_PLX 9
798 struct WacomCaps
800 UWORD wc_ProdID;
801 UWORD wc_Type;
802 ULONG wc_ResX;
803 ULONG wc_ResY;
804 UWORD wc_PressBits;
805 STRPTR wc_Name;
808 struct WacomReport
810 ULONG wr_PosX;
811 ULONG wr_PosY;
812 UWORD wr_Pressure;
813 UBYTE wr_Buttons;
814 UBYTE wr_InProximity;
815 UBYTE wr_TiltX;
816 UBYTE wr_TiltY;
817 BYTE wr_Wheel;
818 UBYTE wr_PadButtons;
821 struct UsbToPs2Map
823 ULONG utp_UsageID;
824 UWORD utp_ExtCode;
827 struct NepHidSound
829 struct Node nhs_Node;
830 Object *nhs_DTHandle;
833 struct ActionMsg
835 struct Message am_Msg;
836 struct NepClassHid *am_NCH;
837 struct NepHidAction *am_Action;
840 struct ActionData
842 struct NepClassHid *ad_NCH;
845 #define TAGBASE_Action (TAG_USER | 23<<16)
846 #define MUIM_Action_About (TAGBASE_Action | 0x0001)
847 #define MUIM_Action_StoreConfig (TAGBASE_Action | 0x0002)
848 #define MUIM_Action_DefaultConfig (TAGBASE_Action | 0x0003)
849 #define MUIM_Action_UseConfig (TAGBASE_Action | 0x0004)
850 #define MUIM_Action_UpdateDevPrefs (TAGBASE_Action | 0x0008)
851 #define MUIM_Action_SelectReport (TAGBASE_Action | 0x0010)
852 #define MUIM_Action_FillDefReport (TAGBASE_Action | 0x0011)
853 #define MUIM_Action_ClearReport (TAGBASE_Action | 0x0012)
854 #define MUIM_Action_SetTracking (TAGBASE_Action | 0x0013)
855 #define MUIM_Action_SelectItem (TAGBASE_Action | 0x0018)
856 #define MUIM_Action_SelectAction (TAGBASE_Action | 0x0020)
857 #define MUIM_Action_NewAction (TAGBASE_Action | 0x0021)
858 #define MUIM_Action_CopyAction (TAGBASE_Action | 0x0022)
859 #define MUIM_Action_DelAction (TAGBASE_Action | 0x0023)
860 #define MUIM_Action_MoveActionUp (TAGBASE_Action | 0x0024)
861 #define MUIM_Action_MoveActionDown (TAGBASE_Action | 0x0025)
862 #define MUIM_Action_UpdateAction (TAGBASE_Action | 0x0026)
863 #define MUIM_Action_SetActionType (TAGBASE_Action | 0x0027)
864 #define MUIM_Action_UpdateAOptions (TAGBASE_Action | 0x0028)
865 #define MUIM_Action_KeymapSelectUSB (TAGBASE_Action | 0x0030)
866 #define MUIM_Action_KeymapSelectRaw (TAGBASE_Action | 0x0031)
867 #define MUIM_Action_RestDefKeymap (TAGBASE_Action | 0x0032)
869 #define MUIM_Action_SwapLMBRMB (TAGBASE_Action | 0x0050)
870 #define MUIM_Action_SetMouseAccel (TAGBASE_Action | 0x0051)
871 #define MUIM_Action_SetJoyPort (TAGBASE_Action | 0x0052)
872 #define MUIM_Action_AddAutofire (TAGBASE_Action | 0x0053)
874 #define MUIM_Action_DebugReport (TAGBASE_Action | 0x0060)
876 #define MUIM_Action_ShowHIDControl (TAGBASE_Action | 0x0040)
877 #define MUIM_Action_HideHIDControl (TAGBASE_Action | 0x0041)
878 #define MUIM_Action_UpdateHIDCtrl (TAGBASE_Action | 0x0042)
880 #endif /* HID_H */