Hi We breifly touched on this subject before, but I'm nearing done on the linux version so I was hopeing for some clarification. Currently the windows version returns -1 to +1 for ball movement on the mouse, the problem with this is it is digital, imagine it used for mouselook (quake style) you would get very strange movemtn, you would be moving or not, no speed changes with change of mouse speed, it needs to be more analog, they way I have done this for the linux version is to add up all the values from the events at the native level and return that, this often ends up with much more variable values based on the speed the mouse is moved. I currently have this disabled so the linux version behaves the same as the windows one (whats the point in a port of an API if they play differently). I don't know if its possible under direct input as I don't know much about it, but it seems to me to make sense. What do others think?

Hi Let us know when you've done the windows version and I can flip the code over in the linux one, means the two version will remain consistant . As for the values to return, with the wheel on my mouse I can feel it almost click round to positions, and i'm wondering if one position = +/-1 to the value in the next event that gets fired. I'm wondering if internally to the hardware there is something similar for the x and y axes. Most games that use the mouse have a mouse speed adjustment, which I suspect is because the different mice and different platforms return different values, I'm not sure how we could scale it anyway, what exactly *is* the maximum value from a mouse?

Cheers

Endolf

P.S. whilst your at it, there are 5 buttons on my mouse, any ideas how to get the extra two to show up in the win32 jinput? Mouse.Buttons has room for them

Hi exactly, that was my point, I have no idea how we can arrange a set of values to return from the different platforms when we have no idea what values are min and max? , I suggest we return what the native side gives us and suggest that games writers have a mouse sensitivity setting in their config somewhere that allows the user to change it, just like quake/half-life/unreal/.../...

Yes, something like that. I honestly don't know what sort of numbers you would get back on each platform... but if that makes sense then sure. If platform specific defaults are set so that it looks approximately the same for Joe Coder regardless of the platform his code is running on that would be great.

Yeah, you'll be able to do that with the OSX variant. I've spent some extra time to bring back *everything* from the OSX native HID libraries so that these adjustments/changes can be done in Java without me needing to go back into the native HID core since I feel so dirty after writing so much C (not even C++) code.

Hi I think it should be part of the MouseBall coreAPI class, there is no point putting in plugin dependant things, no-one should use them as you then end up with different things happening on different platforms. I thought the whole point was to get something common across the platforms.

Normalizing mouse input is certainly something that can be cross platform and put in the core mouse API. A standard mouse under OSX has axis values that range from +/- 32767 as opposed to 0-1 so we just need to normalize on something and then we can scale the values from there.

Hi The linux plugin an't be normalised as it works at the moment, if queues all the underlying events up, that means if your framerate drops cause of gc or whatever, you will still see a full mouse movement, that means that there is *no* maximum value for mouse movements under linux, it depends on how far you moved it and how long it's been since you last polled.

Unfortunately I don't believe I can do that with the way the OSX HID system works. Every value that comes back from HID is pretty much listed in rawMin/rawMax, scaledMin/scaledMax and all I can do is give you whatever value is there. I can queue it up, but that's kinda pointless for axis movement as it generates so many events that it doesn't make sense to queue up several hundred of them. Button clicks however are another story. I queue up all keystrokes and button clicks because they are digital actions and I can't lose those.

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org