[FIXED] Mouse.isbuttondown not updating correctly

Started by Mickelukas, May 21, 2009, 10:07:28

Previous topic - Next topic

Mickelukas

Quote from: Matzon on May 27, 2009, 13:12:52
well, it seems that there are some issues still - so need to look at bit on that - not sure if I have time tonight tho...
lwjgl 2.2 will happen eventually - but the certificate stuff is out of my hands, and moving at an invisible snails pace.

So it might be moving quite quick as it is invisible eh? :P

Well, I'm fine with the certificate question while developing the game but it would be cool to have it fixed once I launch a beta :)

Mickelukas

Had the time to look into the windows issue?

kappa

Matzon has found and fixed the mouse issue on windows, patch is in svn.

You can find a working example of it in action here

Mickelukas

It's working wonderfully :) Thanks a bunch!

Mickelukas

I had to download the nightly build for another problem so ended up testing this on my own application.

I have a problem that might not be easily fixed. When I hold down the mouse and move it to a negative X or Y (outside the applet below or to the left of it), the Mouse.getX() and Mouse.getY() never goes below 0 so I don't know if it is just outside the corner or a kilometer outside.

Any ideas?

Mickelukas

I tried to work around it myself but I guess it needs to be changed within LWJGL (preferably before 2.2.0 :)). Is something difficult to fix or can you easily pass negative numbers?


Matzon


Mickelukas

Quote from: Matzon on September 22, 2009, 09:37:58
fixed in nightly I think

You're my hero Matzon! I'll download the nightly later today or on Monday to check it out :)

Mickelukas

Work got in-between... I tried it out now and I get the same behavior as before. When moving the mouse to where I'd expect a negative x or y value it just returns 0.

Matzon

oh, forgot this:
/doc/lwjgl_hidden_switches.text - added a new allowNegativeMouseCoords

otherwise we might risk breaking things that rely on non-negative value

http://java-game-lib.svn.sourceforge.net/viewvc/java-game-lib/trunk/LWJGL/doc/lwjgl_hidden_switches.text?r1=3241&r2=3240&pathrev=3241

Mickelukas

Works like a charm in Eclipse but not in the browser.

I get following error during startup:
Fatal error occured (8): access denied (java.util.PropertyPermission org.lwjgl.input.Mouse.allowNegativeMouseCoords write)
java.security.AccessControlException: access denied (java.util.PropertyPermission org.lwjgl.input.Mouse.allowNegativeMouseCoords write)
	at java.security.AccessControlContext.checkPermission(Unknown Source)
	at java.security.AccessController.checkPermission(Unknown Source)
	at java.lang.SecurityManager.checkPermission(Unknown Source)
	at java.lang.System.setProperty(Unknown Source)
	at dreamlandz.Main.init(Main.java:83)
	at org.lwjgl.util.applet.AppletLoader.switchApplet(AppletLoader.java:765)
	at org.lwjgl.util.applet.AppletLoader.run(AppletLoader.java:643)
	at java.lang.Thread.run(Unknown Source)


Do I need to sign the whole package with the same certificate to make it work as that would not be very appreciated. Would it not be possible to make a setter and getter for the value within the Mouse.java file instead of reading the "secret" value.

I had to figure out how to set it but if someone wants to do it and reads this just edit the initiation part of your program and add this:

System.setProperty("org.lwjgl.input.Mouse.allowNegativeMouseCoords", "true");

Mickelukas

I first wrote that it worked because I had only tested it in Eclipse and then I updated the post. You were online at the time Matzon so I'm no sure you saw the update. Therefore this post.

kappa

you could try using -Dorg.lwjgl.input.Mouse.allowNegativeMouseCoords=true as a java vm argument.

for an applet that'd be <param name="java_arguments" value="-Dorg.lwjgl.input.Mouse.allowNegativeMouseCoords=true">

not tried it but it might work.

Mickelukas

I added it to my arguments list making it look like this:

<param name="java_arguments" value="-Dsun.awt.noerasebackground=true -Dsun.java2d.noddraw=true -Dorg.lwjgl.input.Mouse.allowNegativeMouseCoords=true -Dsun.java2d.opengl=false -Dsun.java2d.pmoffscreen=false -Dsun.java2d.d3d=false">


Then the applet does load but I don't get any negative mouse coords.