To me, the problem boils down to understanding the difference between:
- A "click", intended to rotate the piece
- A "press, drag, release" intended to move the piece, but not rotate it.
Since the drag operation will, ultimately, trigger both a press and release of the button (just like a click), you need to somehow differentiate the two operations.
It seems you could do that in at least a few obvious ways.
- Calculate the time between the press and release of the button. With a "fast" time being interpreted as a click (so, rotate) and a slow time being interpreted as a drag (so, move the piece).
- The distance the mouse is moved between press and release events. With a "short" distance being interpreted as a click (so, rotate) and a "long" distance being interpreted as a drag.
- Some combination of both time and distance...
I'd guess that 2nd thing probably feels better in actual use, but you could try them all.
In all cases, you'd simply need to wire both the press and release event of the mouse. In the press event, you'd record either current time or the current position (depending on the method you choose).
Then, in the release event, you'd compare that recorded value to its current value (time or location).
Finally, you'd just need to calculate a delta between the two values and decide which side of the threshold it lies on (click or drag).