When I run code that uses this library, I get the following error and the sketch/window does not open.
INSTANCE.absAxesIDs is only 63 long, so 63 not contained
dd.pde:14:0:14:0: ArrayIndexOutOfBoundsException: 63
The processing IDE highlights this line as causing the error:
control = ControlIO.getInstance(this);
This occurred on both computers I have tested it on, running Arch Linux and Ubuntu 14.10 respectively.
It occurs in your examples as well as my program.
I explored the source code, and I am thinking that the problem is occuring in src/net/java/games/input/LinuxNativeTypesMap.java on line 756.
The program attempts to set a value in array (I'm not sure what it really is?) absAxesIDs even when it is known that absAxesIDs is not large enough to contain it.
I dont really know what I am doing though, could you please have a look and try to figure this out?
If not could you provide some way of compiling the source code, I cant seem to find a build script anywhere?
Thankyou! :)
Have just discovered that this bug is also in the original project from which this is forked, procontroll.
Edit:
Turns out I was mistaken and there is no issue on ubuntu, (thrown off by issues with lack of libjinput-linux64.so). I shall investigate what difference between the 2 systems is causing this issue. I just need that build script so I can test my changes.
Last edit: rukai 2015-02-28
The problem you highlighted applies to all three get???AxisID(int) methods in the LinuxNativeTypesMap class. I have modified the methods to avoid the exception and they now return null if nativeID is out of range.
I have also added the build.xml and build.properties files (resources folder).
I do not have a Linux machine so I can't test it so please keep me informed of how you get on.
Hi, thankyou for the quick response.
From inside the resources folder I have tried running, "ant", "ant build", "ant run" etc. but they all throw this error at the end.
Ok got the build working.
Problem was:
Missing files such as ant-contrib jar file and library.properties I found these here https://github.com/processing/processing-library-template
Code compiles and runs I shall let you know if I come across more problems.
Thank you very much! :D
Even if you don't have problems or if you make any other changes please let me know. I can then make a new release version.
No more problems because I fixed them all! :D Please take a look at the merge request.
Thanks for this fantastic library!
Last edit: rukai 2015-03-01
Fixed in V1.0.2
Sadly the issue is not fixed, as you have not addressed all the changes in my fork.
Please solve this by merging my changes (Sourceforge should have a button for it)
My fork that I have requested be merged, fixes more then just the 32/64bit selection.
It also includes the libjinput-linux64.so file, without this GameControlPlus will NOT run on Linux 64bit.
It also copies over some default config files from the Processing Library template
This allows the project to be built by anyone who downloads the sourcecode. (After some quick configuration)
I have also included a readme which explains how to use the software, build it, etc. This means that new contributors like me, or anyone who wants to build from source, will not have to spend hours figuring out how to build it.
There are two problems which you may have with my changes which I shall address:
Issue 1
The libjinput-linux64.so may pose a security risk as it is a binary with who knows what in it.
I could find very little documentation from the jinput library and so could find no way to build this from source.
Instead I have taken this file from the lwjgl project a very commonly used Java game library.
I consider this a reasonable source, and therefore free from any malware.
Don't just take my word for it, run a checksum on the libjinput-linux64.so at the link I provided and the libjinput-linux64.so in my fork.
Issue 2
The README.md file may not accurately describe your project.
I feel like this should be obvious, but just in case, you can edit this file to describe your project however you want.
Still no luck. I can add you as a Developer to this project if it would help.
Sure! I should be able to do it that way.
Ok, I've been added as a developer however sourceforge really doesn't like us.
I cant get it to merge the patches at all.
I've been uploading my patches to github, I recommend we continue from there, make an account and I'll add you to the project. I can even transfer full ownership!
You will need to add the github repository to your eclipse project to pull and push your changes.
Once setup I think you'll find they have really fantastic service.
I realise you are quite invested in sourceforge though.
So the alternative is to continue using sourceforge but learn terminal basics and then enter in those git commands. (I think you use a mac?)
Last edit: rukai 2015-03-28
If I can I would like to stick with SourceForge because all my other projects are here and I don't want to be using 2 different code repositories.
I have used the Terminal application that comes with OSX so I am not a complete novice there. What I am not comfortable with is using git.
So as a first step I would like to try entering the git commands manually.
On my Mac I have the following file structure.
--git
--game-contoller-lib
--Game Control Devices
This last folder is my Eclipse project and has all the usual folders inside it e.g. src, data, distribution, examples etc.
I assume that in the Terminal application I change the current directory (cd) to the Games Control Devices folder then run each of the three git commands in sequence. This should merge the changes into the local copy on my machine which I can then commit and push into SourceForge.
Am I correct?
BTW I really appreciate your help with this :)
No worries, yep, that is correct.
Just run the commands given by the latest merge request I gave you.
Here are some handy commands for showing what git is up to:
Here's a quick explanation of each line in the commands sourceforge gave you.
Ensure that we are in the correct branch. (changes git's current branch, like the command cd changes directory)
Grabs my git repo from sourceforge.
Merges a specific commit (f92df305e47081e67406ba0c343075d198f6658c) with the current branch. Type git log to see a list of commits, you can see that they all have unique identifier like that.
I have found this resource to be super useful for learning git, I always refer back to it when I cant wrap my head around something.
Considering that sourceforge could not automatically merge it I am almost certain that you will need to do some extra work after running git merge. If so you will need to follow the instructions that it gives you.
Git is easy to mess up so Copy/paste the folder containing the .git folder so that you can try again if you mess up.
When you merge it should look like this, where foo, bar and baz are of course placeholders.
Git then changes all the files that have conflicts to look something like this
You then need to make changes in your trusty text editor.
When you are finished editing it should be the desired end product.
Now run git add on the files that were modified
Now commit the changes
If you have any questions just ask :)
Merge request no 5 'A new request' has been merged. The conflict was caused because I had untracked files which it wanted to overwrite.
Hopefully everything is OK now but before I close this ticket I would appreciate if you would make sure I have done it properly and the repository files are correct.
Thanks for your help with this, it is much appreciated. :)
I have tested on Ubuntu 14.04 and Arch Linux. It successfully compiles and runs. Other changes like the readme.md file have also made it in. Thanks!
Thanks for all your help. I will close this ticket now :)