you didnt follow the one button rule, since you also used mouse position for input.
I could be wrong but isn't mouse position not considered a button as well?
It is not considered a button, and even if it was you use both mouse position and left click, which would break the one button rule anyway.