Mouse x-y__________________


#1

One of my students is creating an app that needs to capture the x-y mouse position when the mouse is clicked. I thought there would be an event handler for this built into app lab, but I’m not having any luck finding this. Any advice how to do this? He is trying to make a basketball shot chart tracker that shows where shots were taken from…


#2

Hi Sean,
I think what you are looking for is built into App Lab. This example app reports to the console the X and Y coordinates of the mouse pointer when “screen1” is clicked.


Does this help?
Mike


#3

WOW! You’re a prince!


#4

This might be a dumb question, but how did you find this?


#5

@sean.boston

The documentation for event.x and event.y is located with the documentation for the onEvent block. Hover over the block and click ‘see examples’.

Andrea


#6

I see. It really was there the whole time! Got it. Thanks.