2 * Copyright 2009, Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
10 #include <SupportDefs.h>
15 class _BJoystickTweaker
;
17 struct _extended_joystick
;
18 struct _joystick_info
;
26 status_t
Open(const char* portName
);
27 status_t
Open(const char* portName
, bool enhanced
);
31 status_t
SetMaxLatency(bigtime_t maxLatency
);
41 status_t
GetDeviceName(int32 index
, char* name
,
42 size_t bufSize
= B_OS_NAME_LENGTH
);
44 status_t
RescanDevices();
45 // Haiku extension. Updates the list of devices
46 // as enumerated by CountDevices() and
47 // GetDeviceName() with possibly newly plugged
50 bool EnterEnhancedMode(const entry_ref
* ref
= NULL
);
55 status_t
GetAxisValues(int16
* outValues
,
57 status_t
GetAxisNameAt(int32 index
,
61 status_t
GetHatValues(uint8
* outHats
,
63 status_t
GetHatNameAt(int32 index
, BString
* outName
);
66 uint32
ButtonValues(int32 forStick
= 0);
67 // Allows access to the first 32 buttons where
68 // each set bit indicates a pressed button.
69 status_t
GetButtonValues(bool* outButtons
,
71 // Haiku extension. Allows to retrieve the state
72 // of an arbitrary count of buttons. The
73 // outButtons argument is an array of boolean
74 // values with at least CountButtons() elements.
75 // True means the button is pressed and false
76 // means it is released.
77 status_t
GetButtonNameAt(int32 index
,
80 status_t
GetControllerModule(BString
* outName
);
81 status_t
GetControllerName(BString
* outName
);
83 bool IsCalibrationEnabled();
84 status_t
EnableCalibration(bool calibrates
= true);
87 virtual void Calibrate(struct _extended_joystick
*);
90 friend class _BJoystickTweaker
;
92 void ScanDevices(bool useDisabled
= false);
94 void _ReservedJoystick1();
95 virtual void _ReservedJoystick2();
96 virtual void _ReservedJoystick3();
97 virtual status_t
_Reserved_Joystick_4(void *, ...);
98 virtual status_t
_Reserved_Joystick_5(void *, ...);
99 virtual status_t
_Reserved_Joystick_6(void *, ...);
105 _joystick_info
* fJoystickInfo
;
106 BList
* fJoystickData
;
108 uint32 _reserved_Joystick_
[10];
111 #endif // _JOYSTICK_H