Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. IT & Infrastructure
  4. Direct Input problem

Direct Input problem

Scheduled Pinned Locked Moved IT & Infrastructure
questionbeta-testingregexhelptutorial
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Z Offline
    Z Offline
    z33z
    wrote on last edited by
    #1

    I don't know if this is correct forum..? I'm writing a plugin to an application to support force feedback. The original application doesn't use dinput, but windows winmm.lib functions to read the joystick. Here's the problem: How can I "match" a joystick ID from Winmm to use the same with DInput? If I in the original application call joyGetPosEx(JOYSTICKID1, ...) to poll it, then I want to call my plugin to create a force feedback effect on the same joystick. Now I do something like: // Enumerate all joysticks using windows MM and add to a list ... if (joyGetDevCaps(i, &jc, sizeof(JOYCAPS)) == JOYERR_NOERROR) { dwJoystickList[i] = MAKELONG(jc.wMid, jc.wPid); // Save product ID } ... and when enumerating using direct input: ... if (pJoysticks[i] == pdidInstance->guidProduct.Data1) { (*it) = tJI; // Save the interface at same position } ... This works if all joysticks are different, i.e. product ID is different. Then I can call my function CreateFFEffect(joystick number 1, ...). But how to solve the problem to separate many joysticks of same brand? Direct input has an instance ID, but is there any way to get the same from windows multimedia functions? Thanks for any tips!

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups