Hello Guest

[FIXED] Mouse.isbuttondown not updating correctly

  • 56 Replies
  • 82606 Views
Re: Mouse.isbuttondown not updating correctly
« Reply #15 on: May 27, 2009, 13:31:53 »
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 :)

Re: Mouse.isbuttondown not updating correctly
« Reply #16 on: June 07, 2009, 13:00:54 »
Had the time to look into the windows issue?

*

Offline kappa

  • *****
  • 1319
Re: Mouse.isbuttondown not updating correctly
« Reply #17 on: June 07, 2009, 13:16:02 »
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

Re: Mouse.isbuttondown not updating correctly
« Reply #18 on: June 07, 2009, 17:32:54 »
It's working wonderfully :) Thanks a bunch!

Re: Mouse.isbuttondown not updating correctly
« Reply #19 on: September 07, 2009, 12:44:35 »
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?

Re: Mouse.isbuttondown not updating correctly
« Reply #20 on: September 09, 2009, 12:26:25 »
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?

Re: Mouse.isbuttondown not updating correctly
« Reply #21 on: September 22, 2009, 09:03:05 »
No ideas about this?

*

Offline Matzon

  • *****
  • 2242
Re: Mouse.isbuttondown not updating correctly
« Reply #22 on: September 22, 2009, 09:37:58 »
fixed in nightly I think

Re: Mouse.isbuttondown not updating correctly
« Reply #23 on: September 25, 2009, 08:29:03 »
fixed in nightly I think

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

Re: Mouse.isbuttondown not updating correctly
« Reply #24 on: October 12, 2009, 09:29:30 »
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.

*

Offline Matzon

  • *****
  • 2242
Re: Mouse.isbuttondown not updating correctly
« Reply #25 on: October 12, 2009, 13:51:53 »
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

Re: Mouse.isbuttondown not updating correctly
« Reply #26 on: October 12, 2009, 14:38:46 »
Works like a charm in Eclipse but not in the browser.

I get following error during startup:
Code: [Select]
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:

Code: [Select]
System.setProperty("org.lwjgl.input.Mouse.allowNegativeMouseCoords", "true");
« Last Edit: October 12, 2009, 14:45:47 by Mickelukas »

Re: Mouse.isbuttondown not updating correctly
« Reply #27 on: October 13, 2009, 07:58:55 »
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.

*

Offline kappa

  • *****
  • 1319
Re: Mouse.isbuttondown not updating correctly
« Reply #28 on: October 13, 2009, 08:14:28 »
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.

Re: Mouse.isbuttondown not updating correctly
« Reply #29 on: October 13, 2009, 11:30:39 »
I added it to my arguments list making it look like this:

Code: [Select]
<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.