Y yzhshi Unregistered / Unconfirmed GUEST, unregistred user! 2002-09-10 #2 {其实就是使用GetKeyboardState} function CtrlDown: Boolean; var State: TKeyboardState; begin GetKeyboardState(State); Result := ((State[VK_CONTROL] and 128) <> 0); end; function ShiftDown: Boolean; var State: TKeyboardState; begin GetKeyboardState(State); Result := ((State[VK_SHIFT] and 128) <> 0); end; function AltDown: Boolean; var State: TKeyboardState; begin GetKeyboardState(State); Result := ((State[VK_MENU] and 128) <> 0); end;
{其实就是使用GetKeyboardState} function CtrlDown: Boolean; var State: TKeyboardState; begin GetKeyboardState(State); Result := ((State[VK_CONTROL] and 128) <> 0); end; function ShiftDown: Boolean; var State: TKeyboardState; begin GetKeyboardState(State); Result := ((State[VK_SHIFT] and 128) <> 0); end; function AltDown: Boolean; var State: TKeyboardState; begin GetKeyboardState(State); Result := ((State[VK_MENU] and 128) <> 0); end;
S shenloqi Unregistered / Unconfirmed GUEST, unregistred user! 2002-09-10 #3 在OnShortCut中处理 var Shift: TShiftState; begin Shift := KeyDataToShiftState(Msg.KeyData); 不就可以了:)
Y yueer Unregistered / Unconfirmed GUEST, unregistred user! 2002-09-10 #4 procedure TForm1.FormKeyDown( Sender: TObject;var Key:Word, Shift:TShiftState ); begin if key = VK_MENU then begin ................ end; end;
procedure TForm1.FormKeyDown( Sender: TObject;var Key:Word, Shift:TShiftState ); begin if key = VK_MENU then begin ................ end; end;
C coldew Unregistered / Unconfirmed GUEST, unregistred user! 2002-09-10 #5 procedure TfrmEng.ToolButton7MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin if Shift = ssAlt then 。。。 end;
procedure TfrmEng.ToolButton7MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin if Shift = ssAlt then 。。。 end;
B bronzestar Unregistered / Unconfirmed GUEST, unregistred user! 2002-09-10 #6 procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); begin if key = 18 then begin ...处理过程 end; end;
procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); begin if key = 18 then begin ...处理过程 end; end;