JXInput icon indicating copy to clipboard operation
JXInput copied to clipboard

Is it possible to get this to run under Mac Os and Linux?

Open BSVogler opened this issue 10 years ago • 7 comments

BSVogler avatar Jun 04 '15 18:06 BSVogler

It should be possible. You need to generate the JNI headers for the XInputNatives and XInputNatives14 classes, implement the methods in C/C++, compile the code into dynamic libraries for x86 and x86-64 architectures and place the resulting files under src/main/resources/lib/native/<platform>-<arch>, where <platform> is linux for Linux and mac for Mac OS and <arch> is either x86 or x64. See the NativeLibraryHelper JavaDoc for details.

StrikerX3 avatar Jun 05 '15 19:06 StrikerX3

+1 for Linux and Mac

saulrussell avatar Dec 22 '17 17:12 saulrussell

+1 for Linux and Mac

I have no idea how to make those libs

Akoot-zz avatar Feb 12 '18 14:02 Akoot-zz

Any guidance on how to do this in Linux?

cafeTechne avatar Oct 28 '18 07:10 cafeTechne

You'll need a library that can communicate with Xbox controllers. As described above, generate the JNI headers for those two classes and implement them. Note that they're basically XInput wrappers, so you'll need to mimic that library's behavior.

StrikerX3 avatar Oct 28 '18 11:10 StrikerX3

+1 for Linux and Mac JNI is out of my ability.

XenoAmess avatar Jun 17 '19 20:06 XenoAmess

Is there anything under Linux or Mac OS X that provides functionality and an API equivalent to Microsoft's XInput? A quick research on the subject of Xbox controller support on those platforms reveals that a custom driver is needed for Mac OS X (like this one), while Linux seems to support Xbox controllers right out of the box (which can be used like this). Neither are XInput-like. There might exist better solutions out there.

As the main goal of JXInput (to wrap the Windows-only XInput API) is already accomplished, I'll leave this task to anyone feeling adventurous. Follow this guide to learn JNI, then implement the wrappers for your favorite platforms according to the instructions in one of my previous comments.

StrikerX3 avatar Jun 17 '19 22:06 StrikerX3