First time here? Check out the FAQ!
x

mousePressed

+1 vote
348 views
hello everybody,

How do I get the pressure of the Left Button of the Mouse into a View/GraphicsContext in a Tool?

I would like to get the the 'controller sensor cursorPoint' only when the button is pressed.

thanks.

d
asked Sep 8, 2020 in Capytalk & Smalltalk by domenico-cipriani (Master) (3,110 points)
edited Sep 9, 2020 by domenico-cipriani

1 Answer

0 votes
with a little bit of philological work I found a solution that work but I don't know if it is the better solution :)

so

| myposition mousePressed myView |

x := 0@0.

myView := View new

mousePressed := MyView controller sensor redButtonPressed.

(mousePressed) ifTrue: [x := MyView controller sensor cursorPoint] ifFalse: []
answered Sep 9, 2020 by domenico-cipriani (Master) (3,110 points)
...