Turns out I did things a bit wrong with respect to the new nifty mouse even queue....
I called stuff that was meant to be internal to nifty. That's fixed now. Also had to replace the nifty examples jar with a new version. This version os BIG (15Mb). Void is working on a smaller one, but at least with this big one, things work as expected. git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7117 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
55d75c7b68
commit
5ae44319ea
Binary file not shown.
@ -56,6 +56,7 @@ public class InputSystemJme implements InputSystem, RawInputListener {
|
|||||||
private InputManager inputManager;
|
private InputManager inputManager;
|
||||||
|
|
||||||
private boolean pressed = false;
|
private boolean pressed = false;
|
||||||
|
private int buttonIndex;
|
||||||
private int x, y;
|
private int x, y;
|
||||||
private int height;
|
private int height;
|
||||||
|
|
||||||
@ -64,6 +65,7 @@ public class InputSystemJme implements InputSystem, RawInputListener {
|
|||||||
|
|
||||||
private Nifty nifty;
|
private Nifty nifty;
|
||||||
|
|
||||||
|
|
||||||
public InputSystemJme(InputManager inputManager){
|
public InputSystemJme(InputManager inputManager){
|
||||||
this.inputManager = inputManager;
|
this.inputManager = inputManager;
|
||||||
}
|
}
|
||||||
@ -101,13 +103,7 @@ public class InputSystemJme implements InputSystem, RawInputListener {
|
|||||||
private void onMouseMotionEventQueued(MouseMotionEvent evt, NiftyInputConsumer nic) {
|
private void onMouseMotionEventQueued(MouseMotionEvent evt, NiftyInputConsumer nic) {
|
||||||
x = evt.getX();
|
x = evt.getX();
|
||||||
y = height - evt.getY();
|
y = height - evt.getY();
|
||||||
MouseInputEventQueue niftyEvtQueue = nifty.getMouseInputEventQueue();
|
nic.processMouseEvent(x, y, evt.getDeltaWheel(), buttonIndex, pressed);
|
||||||
NiftyMouseInputEvent niftyEvt = new NiftyMouseInputEvent();
|
|
||||||
if (niftyEvtQueue.hasLastMouseDownEvent()) {
|
|
||||||
niftyEvt = niftyEvtQueue.getLastMouseDownEvent();
|
|
||||||
}
|
|
||||||
niftyEvt.initialize(x, y, evt.getDeltaWheel(), niftyEvt.isButton0Down(), niftyEvt.isButton1Down(), niftyEvt.isButton2Down());
|
|
||||||
niftyEvtQueue.process(niftyEvt);
|
|
||||||
//MouseInputEvent niftyEvt = new MouseInputEvent(x, y, pressed);
|
//MouseInputEvent niftyEvt = new MouseInputEvent(x, y, pressed);
|
||||||
// if (nic.processMouseEvent(niftyEvt) /*|| nifty.getCurrentScreen().isMouseOverElement()*/){
|
// if (nic.processMouseEvent(niftyEvt) /*|| nifty.getCurrentScreen().isMouseOverElement()*/){
|
||||||
// Do not consume motion events
|
// Do not consume motion events
|
||||||
@ -126,16 +122,9 @@ public class InputSystemJme implements InputSystem, RawInputListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void onMouseButtonEventQueued(MouseButtonEvent evt, NiftyInputConsumer nic) {
|
private void onMouseButtonEventQueued(MouseButtonEvent evt, NiftyInputConsumer nic) {
|
||||||
|
buttonIndex = evt.getButtonIndex();
|
||||||
pressed = evt.isPressed();
|
pressed = evt.isPressed();
|
||||||
MouseInputEventQueue niftyEvtQueue = nifty.getMouseInputEventQueue();
|
nic.processMouseEvent(x, y, 0, buttonIndex, pressed);
|
||||||
NiftyMouseInputEvent niftyEvt = new NiftyMouseInputEvent();
|
|
||||||
if (niftyEvtQueue.hasLastMouseDownEvent()) {
|
|
||||||
niftyEvt = niftyEvtQueue.getLastMouseDownEvent();
|
|
||||||
}
|
|
||||||
niftyEvt.initialize(x, y, 0, evt.getButtonIndex() == 0 && evt.isPressed(), evt.getButtonIndex() == 1
|
|
||||||
&& evt.isPressed(), evt.getButtonIndex() == 2 && evt.isPressed());
|
|
||||||
niftyEvtQueue.process(niftyEvt);
|
|
||||||
|
|
||||||
// MouseInputEvent niftyEvt = new MouseInputEvent(x, y, pressed);
|
// MouseInputEvent niftyEvt = new MouseInputEvent(x, y, pressed);
|
||||||
// if (nic.processMouseEvent(niftyEvt) /*|| nifty.getCurrentScreen().isMouseOverElement()*/){
|
// if (nic.processMouseEvent(niftyEvt) /*|| nifty.getCurrentScreen().isMouseOverElement()*/){
|
||||||
evt.setConsumed();
|
evt.setConsumed();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user