[JAVA] Robot clicking right click when not being called on
3 replies, posted
Hey Guys,
I am currently writing a key mapper for my XBOX controller in Java, to make it control the mouse with left and right click.
Left click and move work fine, but the right click is beyond weird.
Here is the code
[CODE] if (buttons.lShoulder){
print("Left");
rbt.mousePress(InputEvent.BUTTON1_MASK);
//LMB = true;
} else {
rbt.mouseRelease(InputEvent.BUTTON1_MASK);
//LMB = false;
}
if (buttons.rShoulder){
print("Right.");
rbt.mousePress(InputEvent.BUTTON3_MASK); //because mask 2 is frikin mouse wheel!
//RMB = true;
} else {
rbt.mouseRelease(InputEvent.BUTTON3_MASK);
}[/CODE]
The left works fine, but the right executes even when the right shoulder is not being pressed.
I thought it was glitching, but not even the console outputs "Right.", it just spams right click. No apps interfering.
Please help! Anyone know why, or have any work-arounds?
Thanks.
[editline]6th September 2015[/editline]
Any ideas ?
Seriously, why is this happening? I could ask Stack Overflow but they aren't ever as nice as Facepunch. I could dedicate a whole rant to why I hate asking questions on Stack Overflow. Great site, just if it's someone else's question.
Nothing immediately obvious there. You said it doesn't spam "Right.", it just does the click seemingly on it's own, leading me ot think you have something somewhere else. Can we see the rest of the source in that case?
[QUOTE=Trumple;48633512]Nothing immediately obvious there. You said it doesn't spam "Right.", it just does the click seemingly on it's own, leading me ot think you have something somewhere else. Can we see the rest of the source in that case?[/QUOTE]
I'll try, let me export it to GitHub.
EDIT: Actually, it donned on me earlier what might be happening. I have a hacky work around, but I'm going to try something different for now.
I think that I need to add some more booleans. :D
I'll keep you posted. But thanks for answering me.
EDIT: Also, I kind of ripped out all the code last night at 2:00 AM when I was frustrated, so I have to rebuild it. ¯\_(ツ)_/¯
Sorry, you need to Log In to post a reply to this thread.