Are you using a tablet or phone to work in the blocks editor ?
The block also needs to be in a canvas event like canvas dragged in order to get the x/y from the event.
To select a local variable, you must drag the whole block into the event first.