There was apparently MouseInput.get.setCursorPoisiton froma topic from 2007, but that doesn’t work.
There is also this
http://hub.jmonkeyengine.org/forum/topic/set-the-cursor-location/
Which says to use Java.awt.Robot’s mouseMove(int x, int y), but only works on fullscreen(which I am using for now, but int he future might change).
In this topic http://hub.jmonkeyengine.org/forum/topic/set-mouse-location/
They talk abut “hardware” and “absolute mouse” which I’m not sure what eitehr of those are, and since iti s the 2007 topic, it probably is some old old code.
As for moving my mouse, I originally wasn’t going to do it, but with 1 of my commands I’m switching from no mouse to the mouse drag, and I need to use that to click on a mini map, otherwise there isn’t a cursor. I wanted to bring the mouse to my icon on the mini map, and only allow the mouse bounds to be within the mini-map…
If this is a bad idea then I wont do it, but I figure that it wont impact my users, so why not?
Thanks!
Well I was super tired last night and realized now that I could check out inputManager.getCursorPosition() further, and sure enough I found .set(x, y);
Trying it out now will update with results.
EDIT: Booo…? Didn’t work… I also tried to update the inputManager, but that just got weird.
I will check out the robotics, but I’m trying to see if there is a better way…
[java] public void onMouseMotionEvent(MouseMotionEvent evt) {
if (!eventsPermitted) {
throw new UnsupportedOperationException(“MouseInput has raised an event at an illegal time.”);
}
cursorPos.set(evt.getX(), evt.getY());
inputQueue.add(evt);
}[/java]
This is from InputManager, cursorPos.set(evt.getX(), evt.getY()); is what we want from the looks of it.
using “getCursorPositon” returns “cursorPos” which is the Vector2f, and this is one of the only places it’s used otherwise.
goes deep…
EDIT: So after adding robot in I start up do what I normally do and nothign, except I couldn’t turn off my mouse anymore. After Trying to alt + tab and a bunch of other issues I came back in and it worked… Except when you move away “fasT” it snaps back the mouse to the original position. Slow cursor movement will alow you to move away, but once it’s move quickly again you’re sol…
Oh wells…