0
\$\begingroup\$

I want to use a DualShock 4 controller in a computer program I'm developing.

Do I only need to use a library? Or do I need some other things too?

I don't have any code yet, I'm just starting to look at it. I'll be using Eclipse if it has any relevance.

\$\endgroup\$
2
  • 2
    \$\begingroup\$ When I've investigated this in the past with Unity and C#, I needed to hook into OS-level Human Interface Device handling (like Kernel32.dll on Windows). Then again, I was trying to get at motion sensor data, which is not exposed well in many existing libraries/tools. If you just need button and analog stick/trigger inputs, you may be able to get those from more generic gamepad methods. \$\endgroup\$
    – DMGregory
    Commented Apr 21, 2017 at 17:21
  • \$\begingroup\$ gamepad4j claims to have out of the box support for DualShock 4. A casual peek at the code agrees with @DMGregory - it hooks into lower level OS specific code. \$\endgroup\$
    – Pikalek
    Commented Apr 25, 2017 at 19:24

1 Answer 1

2
\$\begingroup\$

LibGDX is a Java-based engine that has support for Controllers. However, you would have to do some research on what Input ID is used for the DualShock 4.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ This answer could be even better if it included a rough outline of how to read DualShock 4 input with this library. \$\endgroup\$
    – DMGregory
    Commented Nov 12, 2017 at 15:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .