I can't figure out how to capture the 'any key'(except for CTRL) + 'Deletekey'
press. I found out how to validate if CTRL + 'Deletekey'
.
The reason is because I need to make 2 actions:
- if 'CTRL' + 'Deletekey' is pressed. (Already achieved this one)
- ONLY if
'Deletekey'
is pressed. (Got problems with it, because I can combine'any key'(except for CTRL) + Deletekey
and it keeps making action 2), but I need to make this action IF AND ONLY IF'Deletekey'
is pressed.
Thanks
EDIT: Thank for your replies, I will show how I accomplished the point 1:
Context first: I have an event called DPaint1KeyUp, what it should do? remove graphically a painted element (if DELETE is pressed) or remove graphically and from the database if CTRL + DELETE pressed Simultaneously.
procedure TfMyClass.DPaint1KeyUp(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
inherited;
if (Shift = [ssctrl]) and (key = VK_DELETE) then
//Going to delete graphically and from database
if (Shift = []) and (key = VK_DELETE) then
//Going to delete just Graphically
end;
If I press simultaneosly CTRL + DELETE it works perfectly (Delete graphically and from Database.
BUT, if I press simultaneosly whichever combination with DELETE (except for CTRL), it deletes Graphically, WRONG, because if I only need to delete graphically I just need to press DELETE, not any other combination
For example:
@fpiette "A key and DeleteKey simultaneously pressed"