Tuesday, September 22, 2009

Delphi 2010 - Touch and Pen added to TShiftState

While we were researching adding Touch and Gesturing to VCL we quickly realized it was important to detect what type of input produced the mouse messages. So we introduced some new elements to TShiftState: ssTouch and ssPen:


TShiftState = set of (ssShift, ssAlt, ssCtrl,
ssLeft, ssRight, ssMiddle, ssDouble, ssTouch, ssPen);

One of the key reasons this is so important is when handling WM_TOUCH messages the mouse messages are also fired. Chances are you only want to handle one of them. On a non-touch machine you want to handle the mouse. So this allows input to be filtered and handled independently.

1 comment:

L said...

I have seen somewhere in project that it is allowed to cast TShiftState to Word... but generally TShiftState can be cast to Byte (becouse it was prevously only 7 different values).

Post a Comment