Lemur DefaultMouseListener pick no isPressed event with Checkbox

Wait wait wait… just realized you are using the click() method of the default listener.

click means that an down + up was received. So click will only ever be called on release.

Edit: sorry I so badly misunderstood the first post. Feel dumb.

Heh, I thought it was expected behavior. I miss things myself reading so many posts.

I couldn’t figure out how it wasn’t getting a down press.

So for standard gui things click, special needs, MouseButtonEvent.

Thanks for clearing it up.

Yeah, click() is for when you want to know if a user just clicked a location. I shouldn’t trigger if they click, drag some distance, and release. Just if they click and release in about the same location.

It’s for convenience.

But for a button, there are better ways of being notified about clicks anyway… because a Button click is different than a DefaultMouseListener.click(). (A Button will click as long as the user was over the Button when released.)

Edit: see:

Way to late for me to look at this.

I can read it but I will go over it in morning so I can understand it.

x and y = screen location is as far as i got.

Yes, basically for DefaultMouseListener, click() won’t be triggered unless the down and up happen within xClickThreshold and yClickThreshold pixels of one another.

For a Button.ButtonAction.Click, it only needs to be a down+up over the button. (Pressing the button but dragging off and releasing cancels the click.)

I see, but that will lead to more questions since I see that checkbox returns nothing for x and y so I better stop for now.

Here’s where I feel inclined to ask what you are actually trying to do.

Well, code wise nothing. I stumbled across the isPressed by accident when exploring things. It was bugging the crap out of me that I didn’t know why there wasn’t a isPressed for click but there was for MouseButtonEvent since I was writing the code for the click method.

Edit: I failed to read the MouseButtonEvent code properly is what it boils down to.

Edit: To many things going on at once. Sorry for wasting your time.

Ok, now I think i get it.

First click (press) sets these vars so that is why click doesnt fire. This is the current position of the button on screen.

Second click (release)

is checked for position,

if the button has not moved more than 3 pixels, fire the click event, otherwise this is a drag event.