Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Jan 2, 2013, 02:30 PM   #1
digory
macrumors newbie
 
Join Date: Jan 2013
Gamepads / IOHID: Analogous values for RT, LT?

Hi there!

I'm implementing a class that listens to gamepads using Apple's IOHID API. Currently, the following works: When I plug in a gamepad, the class recognizes it. A, B, X and Y buttons are read as booleans, while joystick values XY and PO are read as doubles. (For the latter, I fetch min and max for the element and scale the integer value so it always stays between -1..+1.)

So far, so clear. The problem is that the two lower back buttons (RT, LT) always return either minimum or maximum values, i.e. bools, but they really should be analogous, i.e. doubles like XY and PO.

I've googled a bit and learnt that this is where XInput comes in. There is a switch at the back of my Logitech Gamepad F310 that lets me choose between XInput and DirectInput. Mac OS X does not seem to be able to deal with XInput enabled, so I always leave the switch to DirectInput.

-> Is it possible to read the analogous values of RT, LT with DirectInput switch enabled?
-> If not, is it possible to set up a IOHID dictionary that recognizes the device when XInput is enabled?
-> Is there any other trick I could try?

Thanks for any replies!
digory is offline   0 Reply With Quote
Old Jan 2, 2013, 03:02 PM   #2
ytk
macrumors regular
 
Join Date: Jul 2010
I can't help you directly with your problem, but you might want to give ControllerMate a try, just to see if it can read the values you're looking for. That would at least tell you there's some way to do it. If ControllerMate can see the gamepad but can't read the data, there's a good chance it's not readable at all.
ytk is offline   0 Reply With Quote
Old Jan 2, 2013, 03:41 PM   #3
digory
Thread Starter
macrumors newbie
 
Join Date: Jan 2013
Thanks for your reply. I've just tried ControllerMate. Apparently, it can't access the device either when it's in Xinput mode (although it would show up in System Profiler). When it's in DirectInput mode, it reads LT and RT as boolean values, not analogous values.

That's very bad! No wonder there's so few games for the Mac if even this simple thing doesn't work...

Well, there's still a chance: I'm still using OS X 10.6. Maybe Mountain Lion supports Xinput?
digory is offline   0 Reply With Quote
Old Jan 2, 2013, 04:31 PM   #4
ytk
macrumors regular
 
Join Date: Jul 2010
Bummer. I wouldn't hold out much hope for getting this to work, then.

Just out of curiosity, what device are you using?
ytk is offline   0 Reply With Quote
Old Jan 3, 2013, 03:34 AM   #5
digory
Thread Starter
macrumors newbie
 
Join Date: Jan 2013
A Logitech F310.

This is even worse: DirectInput mode seems to be restricted to 16 elements, thus the up/down/left/right cursor buttons won't work. Unless you press the [mode] button on the device; then these buttons send values for the analogous joystick, while the joystick will stop sending values.

So that's what the [mode] button is for, after all.

I need to find a Mac OS X driver for Xinput then. Or write one.
digory is offline   0 Reply With Quote
Old Jan 16, 2013, 04:32 PM   #6
JordanTrana
macrumors newbie
 
Join Date: Jan 2013
Quote:
Originally Posted by digory View Post
A Logitech F310.
I've been writing a GamePadManager for my company for the last two weeks. I actually own my very own set of two Logitech F310s.

I got Bad News, the boolean input your getting isn't by fault of Mac's IOHIDManager. Instead it's because the F310 Triggers only FEEL like triggers and are really just buttons disguised as triggers. I've played games with them before (Rayman Origins, GTA4) and I'm pretty sure it's just a button in the trigger. It's possible the F710 from Logitech is better in this regard, alas we do not have that controller and I do not know if it's triggers are legit.

Try an XBox 360 Controller for Windows. Of all the controllers I've been testing here at the office, it's the only one that has triggers. The Driver for Mac works fantastically. It's also the most sensitive Controller I've tested on top of being the best laid out when it comes to the CookieIDs!


Further Note on F310:
the 'Mode' Button is used to swap the Left Analog Stick input with the HatSwitch input from the D-Pad. Your Input being switched between a 0-37000(or some big number like that) and a number between 0 - 315 (with 360 being the 'no buttons pressed' mode for the HatSwitch which is your D-Pad). So when these numbers are switched with the Analog Stick, that's probably why your values are so low. the HatSwitch is returning a Decimal Number between 0-360 to represent the direction your D-Pad is being set too. This can be switched with the Analog Stick. Why they are setting up the GamePad that way? That makes little sense to me.

Last edited by JordanTrana; Jan 16, 2013 at 04:42 PM. Reason: Better Grammar and More Info
JordanTrana is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
OS X: FlatOut 2 (Mac App Store) - do gamepads still work? nagromme Mac and PC Games 3 Jun 3, 2014 07:37 AM
Resale values. Southernboyj MacBook Pro 24 Oct 3, 2013 03:05 PM
5S Instant Re-sale Values rockitdog iPhone 63 Sep 17, 2013 10:25 PM
MacBook Pro Retina & Gamepads (specifically, Logitech Dual Action/F310) muotim MacBook Pro 4 Sep 18, 2012 04:23 PM

Forum Jump

All times are GMT -5. The time now is 12:27 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC