I added a keydown event to the skin selector control. Some very odd behavior is occurring.
Pressing Alt key shows in TShiftState as ssAlt which is correct.
Pressing Ctrl or Shift key shows in TShiftState as ssLeft which is wrong. ssLeft is left mouse button.
Pressing any alphanumeric key shows in TShiftState as ssLeft which is wrong again. In fact the act of just pressing any alphanumeric key without a shift, alt or ctrl should show TShiftState as nothing or [].
I can duplicate this on your demo.
1. Set KeyPreview = True.
2. Add this line of code to sSkinSelector1KeyDown event >>> Self.FormKeyDown(Self, Key, Shift);
3. Add FormKeyPreview event
case Key of
Word(ORD('U')):
if (Shift = [ssShift, ssCtrl, ssAlt]) then
ShowMessage('Shift, Ctrl, Alt pressed')
else if (Shift = [ssCtrl, ssAlt]) then
ShowMessage('Ctrl, Alt pressed')
else if (Shift = [ssShift, ssAlt]) then
ShowMessage('Shift, Alt pressed')
else if (Shift = [ssCtrl, ssShift]) then
ShowMessage('Shift, Ctrl pressed')
else if (Shift = [ssCtrl]) then
ShowMessage('Ctrl pressed')
else if (Shift = [ssAlt]) then
ShowMessage('Alt pressed')
else if (Shift = [ssShift]) then
ShowMessage('Shift pressed');
end;
When skin selector does NOT have focus all of the control key combinations show the right message.
When skin selector does have focus only the “Shift, Alt” and “Alt” show the message. And a double message is shown. For “Shift, Alt” it shows (1) “Shift, Alt pressed” followed by (2) “Alt pressed”.