Results 1 to 5 of 5
Thread: Robot
- 12-05-2010, 09:47 PM #1
Member
- Join Date
- Mar 2009
- Posts
- 70
- Rep Power
- 0
-
I am only familiar ways to get the Robot class to click the first through third mouse buttons, but not any more. My guess is that you'll have to step outside of Java for this such as by using JNI, JNA or linking your Java program with an OS-knowledgeable program such as AutoIt. Question: does your mouse come with its own drivers and programmable buttons? Did it come with any Jar files?
- 12-05-2010, 10:41 PM #3
Member
- Join Date
- Mar 2009
- Posts
- 70
- Rep Power
- 0
I am on linux (default drivers), but I will see if there are any jars. Thanks.
- 12-06-2010, 06:06 AM #4
Since very few people have a 10-button mouse, I'm guessing that portability isn't a concern. You could write a small program with a MouseListener#mousePressed(...) that echoes the int value of MouseEvents#getButton() to the console or a GUI element such as a JLabel (or even add each value to a JList) and observe the value generated when button 10 is pressed. Then use that value in your code.
Be aware that any change (using a different mouse, updating the mouse driver software ...) may cause your program to break.
Also note that automated play is banned in most online games.
db
- 12-07-2010, 12:58 AM #5
Member
- Join Date
- Mar 2009
- Posts
- 70
- Rep Power
- 0
Thanks for the reply. At this point, I have no concern about portability. This is not for any online game :)
I am working on my own vision based gesture system, and in an attempt to avoid re-inventing the wheel, I am using another program, Easystroke. This progam, when mouse button 10 is clicked and dragged, draws on the screen. When finished, It matches to some pre-configured gestures, and performs the action. I am simply trying to transfer control from the mouse to hand via image processing.
I tried the thing with the mouse event, and Buttons 1-3 returned the button number, e.g. Left click = 1. Every other "extra" button simply returns 0. However, robot takes InputEvent.BUTTON1_MASK, which returns 16. Mouse event is giving the button number, and InputEvent is some other ID.
Similar Threads
-
Robot
By PhQ in forum AWT / SwingReplies: 13Last Post: 08-26-2010, 12:10 AM -
Robot class
By coltragon in forum New To JavaReplies: 6Last Post: 07-12-2010, 05:54 PM -
Robot Game
By yanipao in forum New To JavaReplies: 1Last Post: 03-24-2010, 10:51 AM -
Robot Game
By Galore in forum New To JavaReplies: 7Last Post: 03-21-2010, 06:14 PM -
Robot Class
By jfredrickson in forum New To JavaReplies: 2Last Post: 07-11-2007, 09:00 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks