Jump to content

clicks resulting in multiple mouse events?


strabe30

Recommended Posts

think I'm doing something wrong, if somebody can help me out..

 

public class Example extends Script {
    @Override
    public void onStart() {
        bot.addMouseListener(listener);
    }
    @Override
    public void onExit() {
        bot.removeMouseListener(listener);
    }

    @Override
    public int onLoop() {
        return 200;
    }

    @Override
    public void onPaint(Graphics2D g) {

    }

    BotMouseListener listener = new BotMouseListener() {
        @Override
        public void checkMouseEvent(MouseEvent e) {
            log(e.getPoint());
        }
    };
}

two clicks results in this from the log

[INFO][Bot #1][11/03 06:37:10 PM]: java.awt.Point[x=29,y=40]
[INFO][Bot #1][11/03 06:37:10 PM]: java.awt.Point[x=29,y=40]
[INFO][Bot #1][11/03 06:37:10 PM]: java.awt.Point[x=29,y=40]
[INFO][Bot #1][11/03 06:37:12 PM]: java.awt.Point[x=64,y=29]
[INFO][Bot #1][11/03 06:37:12 PM]: java.awt.Point[x=64,y=29]
[INFO][Bot #1][11/03 06:37:12 PM]: java.awt.Point[x=64,y=29]

I'd just ignore it if it wasn't causing occasionally weird behavior

i tried searching the forums for it, as far as i can tell based on previous tutorials I'm using the mouse listener properly. I appreciate your time :)

Edited by strabe30
Link to comment
Share on other sites

2 hours ago, strabe30 said:

immediately after posting this I'm realizing that one is the left click down, another is left click up, and i'm not sure what the third is.

 

But all I care about is catching the mouse click down. :) Answered my own question. This thread now documents my shame

Middle mouse probably :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...