D-Pad on Game Controller?

Hi, please excuse me if I've posted to the wrong forum.

I'm trying to use Game Control Plus with a Logitech F310 game controller. It is similar to an XBox 360 controller and I believe they use the same driver.

I am on Windows XP, with Processing 2.2.1.

I've been attempting to follow the API overview here, using the OS values and without a configuration file, but when I get to the "hat part" (the D-pad), Processing throws a Null Pointer Exception. I'm relatively new to Processing, but I take this to mean that Game Control Plus has not found the D-pad (aka hat) on the controller. I've tried using the buttons and they do work with out any problem.

I'm perplexed because I seem to be using the right name for the D-pad on my controller (it's listed as "Hat Switch" via a Game Control Plus utility sketch).

I have been able to run the example sketches that come with the library without any problem. However now that I mention it, I don't remember using the D-pad for any of them.

Tagged:

Answers

  • Answer ✓

    On the XBox 360 controller the D pad is treated as 4 separate buttons not a hat control. I suggest that you look at the first video guide on my website it explains the different types of input types and explains why the same device is treated differently on different OSs

    Use the configurator example to get device and input names for your gamepad.

  • edited June 2014

    Hey Quark, wow it's you!

    First, thanks for creating such awesome software (referring to all your libraries and sketches)! I feel very empowered using Processing with your libraries.

    Second, I actually figured it out early this morning/late last night. About a few hours after I first posted my question I wrote this all up and forgot to hit send... kinda embarrassing, sorta.

    Well anyway, I ended up loading one of the examples (gamepad, I think) and I noticed that the configurator called the hat switch "cooliehat: Hat Switch" instead of just "Hat Switch" like the active devices sketch dump gave me. I suppose I should always use the configurator for more details.

    It's actually a Logitech Gamepad F310, and not a XBox 360 controller. So the XBox 360 doesn't have a hat switch? Interesting.

    Thanks again Quark! This has been a great learning experience for me!

    PS: Your video guides were great, and your "Q" logo is super cool!

  • The Q logo was created with Processing and my Shapes3D library then recorded using Camtasia on OSX

    Glad you like my libraries and that you have solved your problem.

Sign In or Register to comment.