i want to record the mouses x and y values once it is the right button on the mouse is clicked. any ideas?
Offline
Scratch can't distinguish between the left and right mouse buttons, sadly However it is possible to record the position of the mouse using the "mouse x" and "mouse y" blocks in "Sensing":
when Sprite1 clicked set [x v] to (mouse x) set [y v] to (mouse y)
Offline
I have an idea but it ask the user whether it is left or right.
when gf clicked forever if <mouse down?> ask [Right or Left?] and wait set [x v] to (mouse x) set [y v] to (mouse y) if <<(answer) = [right]> or <(answer) = [r]>> say [Code for Right Click] for (2) secs else endThe downside is for every time you click you get a question.
when [r v] key pressed if <mouse down?> set [x v] to (mouse x) set [y v] to (mouse y) say [Code for Right Click] for (2) secs endIf you need help to tweak this more to your needs let me know I'll look into it.
Offline
Or you could simply check whether the user is pressing another key - similarly to how one would Ctrl or Shift-click something.
when gf clicked forever if <mouse down?> if <key [z v] pressed?> //"right click" - actually, Z-click set [x v] to (mouse x) set [y v] to (mouse y) else //normal, left click say [do stuff] end end end
Offline