Using Raw Input for joysticks, multiple axes, and deadzones
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6

Thread: Using Raw Input for joysticks, multiple axes, and deadzones

  1. #1
    Join Date
    Aug 2012
    Posts
    4

    Using Raw Input for joysticks, multiple axes, and deadzones

    I'm currently using Raw Input to get joypad/stick information. At the beginning of my application I cache all of these devices, and the number of axes they each have (using HidP_GetValueCaps(), HidP_GetUsageValue() e.t.c). For each axis my game engine can apply a deadzone, however this means that if we have 2 axes on one analog stick then we get a squared deadzone. In order to calculate a circular deadzone we must know which axes lie on a single stick (e.g. axes 0 and 1 on an XBox 360 controller belong to the left analog stick) before using some simple trig to work it out. Is there anything in Raw Input that tells us this?

  2. #2
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Posts
    12,127

    Re: Using Raw Input for joysticks, multiple axes, and deadzones

    Quote Originally Posted by Rajveer86 View Post
    I'm currently using Raw Input to get joypad/stick information. At the beginning of my application I cache all of these devices, and the number of axes they each have (using HidP_GetValueCaps(), HidP_GetUsageValue() e.t.c). For each axis my game engine can apply a deadzone, however this means that if we have 2 axes on one analog stick then we get a squared deadzone. In order to calculate a circular deadzone we must know which axes lie on a single stick (e.g. axes 0 and 1 on an XBox 360 controller belong to the left analog stick) before using some simple trig to work it out. Is there anything in Raw Input that tells us this?
    What's your Visual C++ question?

  3. #3
    Join Date
    Aug 2012
    Posts
    4

    Re: Using Raw Input for joysticks, multiple axes, and deadzones

    Sorry, wrong forum. Can a mod move this to "C++ and WinAPI" (I think that's the appropriate forum)?

  4. #4
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Wallisellen (ZH), Switzerland
    Posts
    17,471

    Re: Using Raw Input for joysticks, multiple axes, and deadzones

    Quote Originally Posted by Rajveer86 View Post
    Sorry, wrong forum. Can a mod move this to "C++ and WinAPI" (I think that's the appropriate forum)?
    Rather than "think" or guess you should have just better read what is which Forum is for!
    For example:
    Forum: Visual C++ Programming
    Ask questions about Windows programming with Visual C++ and help others by answering their questions.
    .....
    Forum: C++ and WinAPI
    Discuss Windows API related issues using C++ (and Visual C++). This is a non-MFC forum.
    So both Forums are to duscuss the programming issues using or related to C++ (and Visual C++).

    Then I would repeat the question GCDEF already asked:
    What's your (Visual) C++ question?
    Victor Nijegorodov

  5. #5
    Join Date
    Aug 2012
    Posts
    4

    Re: Using Raw Input for joysticks, multiple axes, and deadzones

    Ok it seems to be the linkCollection variable belonging to the HIDP_VALUE_CAPS struct. The problem now is that during testing, only the XBox 360 controller conformed to separating it's axes into different link collections (both axes on the left stick are part of collection 1, the right stick part of collection 2 e.t.c). My Saitek X52 has all axes as part of collection 1, and a few others controllers I tried do this too.

  6. #6
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Wallisellen (ZH), Switzerland
    Posts
    17,471

    Re: Using Raw Input for joysticks, multiple axes, and deadzones

    Well, both HidP_GetValueCaps() function and HIDP_VALUE_CAPS struct belong to Windows Drivers section in MSDN.
    Perhaps, you should ask in the Driver Development forum?
    Victor Nijegorodov

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center