lopezloo

Untitled

May 26th, 2023
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.08 KB | None | 0 0
  1. bool CGUIWebBrowser_Impl::Event_MouseButtonDown(const CEGUI::EventArgs& e)
  2. {
  3. const CEGUI::MouseEventArgs& args = reinterpret_cast<const CEGUI::MouseEventArgs&>(e);
  4.  
  5. if (args.button == CEGUI::MouseButton::LeftButton)
  6. {
  7. m_pWebView->ExecuteJavascript("console.log('CGUIWebBrowser_Impl::Event_MouseButtonDown BROWSER_MOUSEBUTTON_LEFT');");
  8. m_pWebView->InjectMouseDown(eWebBrowserMouseButton::BROWSER_MOUSEBUTTON_LEFT);
  9. }
  10. else if (args.button == CEGUI::MouseButton::MiddleButton)
  11. {
  12. m_pWebView->ExecuteJavascript("console.log('CGUIWebBrowser_Impl::Event_MouseButtonDown BROWSER_MOUSEBUTTON_MIDDLE');");
  13. m_pWebView->InjectMouseDown(eWebBrowserMouseButton::BROWSER_MOUSEBUTTON_MIDDLE);
  14. }
  15. else if (args.button == CEGUI::MouseButton::RightButton)
  16. {
  17. m_pWebView->ExecuteJavascript("console.log('CGUIWebBrowser_Impl::Event_MouseButtonDown BROWSER_MOUSEBUTTON_RIGHT');");
  18. m_pWebView->InjectMouseDown(eWebBrowserMouseButton::BROWSER_MOUSEBUTTON_RIGHT);
  19. }
  20.  
  21. return true;
  22. }
  23.  
  24. bool CGUIWebBrowser_Impl::Event_MouseButtonUp(const CEGUI::EventArgs& e)
  25. {
  26. const CEGUI::MouseEventArgs& args = reinterpret_cast<const CEGUI::MouseEventArgs&>(e);
  27.  
  28. if (args.button == CEGUI::MouseButton::LeftButton)
  29. {
  30. m_pWebView->ExecuteJavascript("console.log('CGUIWebBrowser_Impl::Event_MouseButtonUp BROWSER_MOUSEBUTTON_LEFT');");
  31. m_pWebView->InjectMouseUp(eWebBrowserMouseButton::BROWSER_MOUSEBUTTON_LEFT);
  32. }
  33. else if (args.button == CEGUI::MouseButton::MiddleButton)
  34. {
  35. m_pWebView->ExecuteJavascript("console.log('CGUIWebBrowser_Impl::Event_MouseButtonUp BROWSER_MOUSEBUTTON_MIDDLE');");
  36. m_pWebView->InjectMouseUp(eWebBrowserMouseButton::BROWSER_MOUSEBUTTON_MIDDLE);
  37. }
  38. else if (args.button == CEGUI::MouseButton::RightButton)
  39. {
  40. m_pWebView->ExecuteJavascript("console.log('CGUIWebBrowser_Impl::Event_MouseButtonUp BROWSER_MOUSEBUTTON_RIGHT');");
  41. m_pWebView->InjectMouseUp(eWebBrowserMouseButton::BROWSER_MOUSEBUTTON_RIGHT);
  42. }
  43.  
  44. return true;
  45. }
Advertisement
Add Comment
Please, Sign In to add comment