Here is my code :
procedure PreKeyEvent(Sender: TObject; const browser: ICefBrowser;
const event: PCefKeyEvent; osEvent: PMsg;
out isKeyboardShortcut, Result: Boolean);
begin
if (event.windows_key_code = VK_CONTROL) or
(event.windows_key_code = VK_RMENU) or (event.windows_key_code = VK_LMENU) then
begin
event.windows_key_code := 0;
end;
end;
The IF
block works fine. But this line [event.windows_key_code := 0;
] won't ignore the specified keys. How can I disable some keys using the event PreKeyEvent
?
Edit :
I have also tried to set Result
parameter to true
. still does not work.