What is the OSX version of DirectInput?

HelloKitty
Unregistered
 
Post: #1
What is the OSX equavalent to DirectInput

I think InputSprockets is only for macos9, so that not it.


using the window to capture mouse+keyboard is not as fast. It is also subject to the users repeat setting, which would affect gameplay.

Anyone know what Q3 on mac is doing for userinput?

Thanks
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #2
Q3A uses the standard event mechanism.

There's no reason to make input depend on key repeat rate.

The HID manager is the equivalent of DirectInput. It's quite difficult to use, though.
Quote this message in a reply
Member
Posts: 57
Joined: 2002.04
Post: #3
Assuming you're using Carbon, the best choice for keyboard and mouse input would probably be to use Carbon Events to get the key up/key down events and mouse deltas; if you want to support other game controllers, you'll need to use the HID Manager, which is OS X only and is woefully undocumented. (The HID manager also can be used for keyboard and mouse input on OS X 10.2 and later.)
Quote this message in a reply
Member
Posts: 304
Joined: 2002.04
Post: #4
Quote this message in a reply
Nibbie
Posts: 1
Joined: 2010.01
Post: #5
Everything you need is in the HID Utilities at:

<http://developer.apple.com/samplecode/Sa...dware/HID_
Manager/HID_Utilities_Source.htm>.

The "interesting" API's are:

HIDBuildDeviceList - This creates a list of all the HID devices.
HIDReleaseDeviceList - call this when you're done with the list.
HIDGetFirst/NextDevice - used to iterate the devices
HIDGetFirst/NextDeviceElement - used to iterate elements of a device.
HIDGetElementNameFromVendorProduct[Cookie|Usage] - Get text name of an
element.

HIDQueueDevice - Add all device elements to event queue
HIDDequeueDevice - remove device from event queue
HIDQueueElement - Add element to event queue
HIDDequeueElement - remove element from event queue
HIDGetEvent - poll queue for events

You may incorporate the entire HID Utilities into your project as-is or cut
& paste the pieces that you need.
Quote this message in a reply
Member
Posts: 204
Joined: 2002.09
Post: #6
Greetings,

When the source code for this year's uDevGame is released, you can check out how it is done in Pirate Isle... it wrappers HID utilities directly in order to provide a single, cross-platform input solution. At the very least it will give you some sample code to learn from.

Cheers,
Rocco
Quote this message in a reply
Member
Posts: 28
Joined: 2003.10
Post: #7
Quote:Originally posted by KittyMac
When the source code for this year's uDevGame is released, you can check out how it is done in Pirate Isle... it wrappers HID utilities directly in order to provide a single, cross-platform input solution

That's excellent news, I look forward to seeing your work!

-- Giles Williams
Oolite - retro space-sim agogo
Quote this message in a reply
Member
Posts: 204
Joined: 2002.09
Post: #8
Quote:Originally posted by aegidian
That's excellent news, I look forward to seeing your work!

I forgot to mention that do to the short development schedual for uDevGame the feature set I implemented is limited. Basically, it allows for simple button presses only (since PI only needed gamepad and button support), but it does properly "virtualize" axis movement to make them into buttons (special thanks to the Gravis Gamepad for only giving joystick values for it's pad Rasp ). Just a warning that this won't be a plug-n-play solution, simply another piece of sample code to learn from.

Cheers,
Rocco
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Detecting OS and Mac version xiotex 2 3,139 Nov 14, 2009 03:02 PM
Last Post: xiotex
  Mac version of getch(); Jamie W 2 3,539 Jun 29, 2009 05:33 AM
Last Post: fbronner
  Mac version of ... Jamie W 0 1,964 Mar 23, 2009 10:22 AM
Last Post: Jamie W
  FMOD - MAC Version Himiona 5 3,676 Apr 25, 2003 08:04 PM
Last Post: Mars_999