1
0
mirror of https://github.com/salvadordf/CEF4Delphi.git synced 2025-06-12 22:07:39 +02:00

Update to CEF 81.2.22

- Added CefKeyEventLog and CefMouseEventLog to the uCEFMiscFunctions unit
This commit is contained in:
Salvador Díaz Fau
2020-04-23 11:11:53 +02:00
parent 5335268296
commit fd50565420
5 changed files with 52 additions and 7 deletions

View File

@ -199,6 +199,8 @@ procedure CefSetCrashKeyValue(const aKey, aValue : ustring);
procedure CefLog(const aFile : string; aLine, aSeverity : integer; const aMessage : string);
procedure CefDebugLog(const aMessage : string; aSeverity : integer = CEF_LOG_SEVERITY_ERROR);
procedure CefKeyEventLog(const aEvent : TCefKeyEvent);
procedure CefMouseEventLog(const aEvent : TCefMouseEvent);
procedure OutputDebugMessage(const aMessage : string);
function CustomExceptionHandler(const aFunctionName : string; const aException : exception) : boolean;
@ -842,6 +844,49 @@ begin
end;
end;
procedure CefKeyEventLog(const aEvent : TCefKeyEvent);
const
DEFAULT_LINE = 1;
var
TempString : string;
begin
if (GlobalCEFApp <> nil) and GlobalCEFApp.LibLoaded then
begin
case aEvent.kind of
KEYEVENT_RAWKEYDOWN : TempString := 'kind: KEYEVENT_RAWKEYDOWN';
KEYEVENT_KEYDOWN : TempString := 'kind: KEYEVENT_KEYDOWN';
KEYEVENT_KEYUP : TempString := 'kind: KEYEVENT_KEYUP';
KEYEVENT_CHAR : TempString := 'kind: KEYEVENT_CHAR';
end;
TempString := TempString + ', modifiers: $' + inttohex(aEvent.modifiers, SizeOf(aEvent.modifiers) * 2);
TempString := TempString + ', windows_key_code: $' + inttohex(aEvent.windows_key_code, SizeOf(aEvent.windows_key_code) * 2);
TempString := TempString + ', native_key_code: $' + inttohex(aEvent.native_key_code, SizeOf(aEvent.native_key_code) * 2);
TempString := TempString + ', is_system_key: ' + BoolToStr((aEvent.is_system_key <> 0), true);
TempString := TempString + ', character: $' + inttohex(ord(aEvent.character), SizeOf(aEvent.character) * 2);
TempString := TempString + ', unmodified_character: $' + inttohex(ord(aEvent.unmodified_character), SizeOf(aEvent.unmodified_character) * 2);
TempString := TempString + ', focus_on_editable_field: ' + BoolToStr((aEvent.focus_on_editable_field <> 0), true);;
CefLog('CEF4Delphi', DEFAULT_LINE, CEF_LOG_SEVERITY_INFO, TempString);
end;
end;
procedure CefMouseEventLog(const aEvent : TCefMouseEvent);
const
DEFAULT_LINE = 1;
var
TempString : string;
begin
if (GlobalCEFApp <> nil) and GlobalCEFApp.LibLoaded then
begin
TempString := TempString + ', x: $' + inttohex(aEvent.x, SizeOf(aEvent.x) * 2);
TempString := TempString + ', y: $' + inttohex(aEvent.y, SizeOf(aEvent.y) * 2);
TempString := TempString + ', modifiers: $' + inttohex(aEvent.modifiers, SizeOf(aEvent.modifiers) * 2);
CefLog('CEF4Delphi', DEFAULT_LINE, CEF_LOG_SEVERITY_INFO, TempString);
end;
end;
procedure OutputDebugMessage(const aMessage : string);
const
DEFAULT_LINE = 1;