// Set parameters are used for many mouse and keyboard events: Shift: tshiftstate; tshiftstate = set of (ssshift, ssalt, ssctrl, ssleft, ssright, ssmiddle, ssdouble, sstouch, sspen ); {determine whether the ctrl key is pressed: method 1} procedure tform1.formmousemove (Sender: tobject; shift: tshiftstate; X, Y: integer); begin text: = ''; if ssctrl in shift then text: = 'ctrl '; // contains end; {judge whether the ctrl key is pressed: method 2} procedure tform1.formmousemove (Sender: tobject; shift: tshiftstate; x, Y: integer); begin text: = ''; if [ssctrl] = shift then text: = 'ctrl '; // only end; {determine whether CTRL and shift keys are simultaneously pressed: method 1} procedure tform1.formmousemove (Sender: tobject; shift: tshiftstate; X, Y: integer); begin text: = ''; if (ssctrl in shift) and (ssshift in shift) then text: = 'ctrl, shift '; // contains end; {judge whether CTRL and shift keys are simultaneously pressed: method 2} procedure tform1.formmousemove (Sender: tobject; shift: tshiftstate; X, Y: integer); begin text: = ''; if [ssctrl, ssshift] = shift then text: = 'ctrl, shift '; // only end; {determine if both CTRL and shift keys are pressed: method 3} procedure tform1.formmousemove (Sender: tobject; shift: tshiftstate; X, y: integer); begin text: = ''; if [ssctrl, ssshift]