I want to capture the sequence of key combination Alt + Character,
where "Character" can be any valid character key from the keyboard, like 'A', 'B', etc.
So far I have this code:
The first 'if' succeeds on detecting Alt key but the second 'if' does not succeed.
Any help will be appreciated.
where "Character" can be any valid character key from the keyboard, like 'A', 'B', etc.
So far I have this code:
Code:
procedure Tform1.FormKeyDown (Sender: tObject; var Key: Word; var KeyChar: Char; Shift: tShiftState);
begin
if ssAlt in Shift then begin
IsKeyAltDown := True;
Key := 0;
end;
if KeyAltDown then begin
IsKeyAltDown := False;
if KeyChar = 'c' then
DoSomething;
end;
end;
The first 'if' succeeds on detecting Alt key but the second 'if' does not succeed.
Any help will be appreciated.
Last edited: