mirror of
https://github.com/cefsharp/CefSharp.git
synced 2026-12-06 12:09:40 +00:00
Pass in the IntPtr as lParam and then based on IntPtr Size (32bit == 4 and 64bit == 8) convert the IntPtr to either 32bit or 64bit
This commit is contained in:
@@ -175,7 +175,7 @@ namespace CefSharp
|
||||
}
|
||||
}
|
||||
|
||||
bool SendKeyEvent(int message, int wParam, int64 lParam)
|
||||
bool SendKeyEvent(int message, int wParam, IntPtr lParamIntPtr)
|
||||
{
|
||||
auto browser = _clientAdapter->GetCefBrowser();
|
||||
|
||||
@@ -184,6 +184,8 @@ namespace CefSharp
|
||||
return false;
|
||||
}
|
||||
|
||||
LPARAM lParam = IntPtr::Size == 8 ? lParamIntPtr.ToInt64() : lParamIntPtr.ToInt32();
|
||||
|
||||
CefKeyEvent keyEvent;
|
||||
keyEvent.windows_key_code = wParam;
|
||||
keyEvent.native_key_code = lParam;
|
||||
|
||||
@@ -625,7 +625,7 @@ namespace CefSharp.Wpf
|
||||
return IntPtr.Zero;
|
||||
}
|
||||
|
||||
handled = managedCefBrowserAdapter.SendKeyEvent(message, wParam.ToInt32(), lParam.ToInt64());
|
||||
handled = managedCefBrowserAdapter.SendKeyEvent(message, wParam.ToInt32(), lParam);
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -898,7 +898,7 @@ namespace CefSharp.Wpf
|
||||
var message = (int)(e.IsDown ? WM.KEYDOWN : WM.KEYUP);
|
||||
var virtualKey = KeyInterop.VirtualKeyFromKey(e.Key);
|
||||
|
||||
e.Handled = managedCefBrowserAdapter.SendKeyEvent(message, virtualKey, (Int64)modifiers);
|
||||
e.Handled = managedCefBrowserAdapter.SendKeyEvent(message, virtualKey, new IntPtr((int)modifiers));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user