Explorar o código

Changes per review

Jay Sistar %!s(int64=9) %!d(string=hai) anos
pai
achega
e30fdef6f6

+ 3 - 0
Script/Packages/Atomic/UI.json

@@ -12,6 +12,9 @@
 								"UIScrollContainer", "UISeparator", "UIDimmer", "UISelectDropdown", "UISlider",
 								"UIOffscreenView"],
 	"overloads" : {
+		"UIOffscreenView": {
+			"SavePNG": ["String"]
+		}
 	},
 	"typescript_decl" : {
 

+ 6 - 2
Source/Atomic/UI/UI.cpp

@@ -995,9 +995,13 @@ SystemUI::MessageBox* UI::ShowSystemMessageBox(const String& title, const String
 UIWidget* UI::GetWidgetAt(int x, int y, bool include_children)
 {
     IntVector2 viewPos;
-    tb::TBWidget* widget = GetInternalWidgetAndProjectedPositionFor(IntVector2(x, y), viewPos);
+    tb::TBWidget* root = GetInternalWidgetProjectedPosition(IntVector2(x, y), viewPos);
+    tb::TBWidget* widget = root->GetWidgetAt(viewPos.x_, viewPos.y_, include_children);
 
-    return WrapWidget(widget->GetWidgetAt(viewPos.x_, viewPos.y_, include_children));
+    if (!widget)
+        return nullptr;
+
+    return WrapWidget(widget);
 }
 
 bool UI::OnWidgetInvokeEvent(tb::TBWidget *widget, const tb::TBWidgetEvent &ev)

+ 5 - 4
Source/Atomic/UI/UI.h

@@ -55,7 +55,7 @@ public:
     virtual ~UI();
 
     tb::TBWidget* GetRootWidget() { return rootWidget_; }
-    HashSet<UIOffscreenView*>* GetOffscreenViews() { return &offscreenViews_; }
+    HashSet<UIOffscreenView*>& GetOffscreenViews() { return offscreenViews_; }
     bool LoadResourceFile(tb::TBWidget* widget, const String& filename);
 
     void SetKeyboardDisabled(bool disabled) {keyboardDisabled_ = disabled; }
@@ -120,9 +120,8 @@ public:
 
     UIWidget* GetHoveredWidget();
 
-    UIOffscreenView* FindOffscreenViewAtScreenPosition(const IntVector2& screenPos, IntVector2& viewPos);
-
-    tb::TBWidget* GetInternalWidgetAndProjectedPositionFor(const IntVector2& screenPos, IntVector2& viewPos);
+    /// Give the screen position, and get back a view. viewPos is the projected positiion in the returned view's space.
+    UIOffscreenView* GetOffscreenViewAtScreenPosition(const IntVector2& screenPos, IntVector2& viewPos);
 
     // Debugging
     static void DebugShowSettingsWindow(UIWidget* parent);
@@ -133,6 +132,8 @@ private:
     static void TBFileReader(const char* filename, void** data, unsigned* length);
     static void TBIDRegisterStringCallback(unsigned id, const char* value);
 
+    tb::TBWidget* GetInternalWidgetProjectedPosition(const IntVector2& screenPos, IntVector2& viewPos);
+
     void HandleRenderUpdate(StringHash eventType, VariantMap& eventData);
     void HandleExitRequested(StringHash eventType, VariantMap& eventData);
 

+ 106 - 96
Source/Atomic/UI/UIInput.cpp

@@ -37,7 +37,7 @@ using namespace tb;
 namespace Atomic
 {
 
-static inline MODIFIER_KEYS GetModifierKeys(int qualifiers, bool superKey)
+MODIFIER_KEYS GetModifierKeys(int qualifiers, bool superKey)
 {
     MODIFIER_KEYS code = TB_MODIFIER_NONE;
     if (qualifiers & QUAL_ALT)   code |= TB_ALT;
@@ -47,6 +47,100 @@ static inline MODIFIER_KEYS GetModifierKeys(int qualifiers, bool superKey)
     return code;
 }
 
+SPECIAL_KEY GetSpecialKey(int keycode)
+{
+    SPECIAL_KEY specialKey;
+
+    switch (keycode)
+    {
+    case KEY_RETURN:
+    case KEY_RETURN2:
+    case KEY_KP_ENTER:
+        specialKey = TB_KEY_ENTER;
+        break;
+    case KEY_F1:
+        specialKey = TB_KEY_F1;
+        break;
+    case KEY_F2:
+        specialKey = TB_KEY_F2;
+        break;
+    case KEY_F3:
+        specialKey = TB_KEY_F3;
+        break;
+    case KEY_F4:
+        specialKey = TB_KEY_F4;
+        break;
+    case KEY_F5:
+        specialKey = TB_KEY_F5;
+        break;
+    case KEY_F6:
+        specialKey = TB_KEY_F6;
+        break;
+    case KEY_F7:
+        specialKey = TB_KEY_F7;
+        break;
+    case KEY_F8:
+        specialKey = TB_KEY_F8;
+        break;
+    case KEY_F9:
+        specialKey = TB_KEY_F9;
+        break;
+    case KEY_F10:
+        specialKey = TB_KEY_F10;
+        break;
+    case KEY_F11:
+        specialKey = TB_KEY_F11;
+        break;
+    case KEY_F12:
+        specialKey = TB_KEY_F12;
+        break;
+    case KEY_LEFT:
+        specialKey = TB_KEY_LEFT;
+        break;
+    case KEY_UP:
+        specialKey = TB_KEY_UP;
+        break;
+    case KEY_RIGHT:
+        specialKey = TB_KEY_RIGHT;
+        break;
+    case KEY_DOWN:
+        specialKey = TB_KEY_DOWN;
+        break;
+    case KEY_PAGEUP:
+        specialKey = TB_KEY_PAGE_UP;
+        break;
+    case KEY_PAGEDOWN:
+        specialKey = TB_KEY_PAGE_DOWN;
+        break;
+    case KEY_HOME:
+        specialKey = TB_KEY_HOME;
+        break;
+    case KEY_END:
+        specialKey = TB_KEY_END;
+        break;
+    case KEY_INSERT:
+        specialKey = TB_KEY_INSERT;
+        break;
+    case KEY_TAB:
+        specialKey = TB_KEY_TAB;
+        break;
+    case KEY_DELETE:
+        specialKey = TB_KEY_DELETE;
+        break;
+    case KEY_BACKSPACE:
+        specialKey = TB_KEY_BACKSPACE;
+        break;
+    case KEY_ESCAPE:
+        specialKey = TB_KEY_ESC;
+        break;
+    default:
+        specialKey = TB_KEY_UNDEFINED;
+        break;
+    }
+
+    return specialKey;
+}
+
 
 // @return Return the upper case of a ascii charcter. Only for shortcut handling.
 static int toupr_ascii(int ascii)
@@ -56,7 +150,7 @@ static int toupr_ascii(int ascii)
     return ascii;
 }
 
-UIOffscreenView* UI::FindOffscreenViewAtScreenPosition(const IntVector2& screenPos, IntVector2& viewPos)
+UIOffscreenView* UI::GetOffscreenViewAtScreenPosition(const IntVector2& screenPos, IntVector2& viewPos)
 {
     for (HashSet<UIOffscreenView*>::Iterator it = offscreenViews_.Begin(); it != offscreenViews_.End(); ++it)
     {
@@ -96,9 +190,9 @@ UIOffscreenView* UI::FindOffscreenViewAtScreenPosition(const IntVector2& screenP
     return nullptr;
 }
 
-tb::TBWidget* UI::GetInternalWidgetAndProjectedPositionFor(const IntVector2& screenPos, IntVector2& viewPos)
+tb::TBWidget* UI::GetInternalWidgetProjectedPosition(const IntVector2& screenPos, IntVector2& viewPos)
 {
-    UIOffscreenView* osView = FindOffscreenViewAtScreenPosition(screenPos, viewPos);
+    UIOffscreenView* osView = GetOffscreenViewAtScreenPosition(screenPos, viewPos);
     if (osView)
         return osView->GetInternalWidget();
 
@@ -144,7 +238,7 @@ void UI::HandleMouseButtonDown(StringHash eventType, VariantMap& eventData)
 
 
     IntVector2 viewPos;
-    tb::TBWidget* widget = UI::GetInternalWidgetAndProjectedPositionFor(pos, viewPos);
+    tb::TBWidget* widget = UI::GetInternalWidgetProjectedPosition(pos, viewPos);
 
     if (button == MOUSEB_RIGHT)
         widget->InvokeRightPointerDown(viewPos.x_, viewPos.y_, counter, mod);
@@ -177,7 +271,7 @@ void UI::HandleMouseButtonUp(StringHash eventType, VariantMap& eventData)
 
 
     IntVector2 viewPos;
-    tb::TBWidget* widget = UI::GetInternalWidgetAndProjectedPositionFor(pos, viewPos);
+    tb::TBWidget* widget = UI::GetInternalWidgetProjectedPosition(pos, viewPos);
 
     if (button == MOUSEB_RIGHT)
         widget->InvokeRightPointerUp(viewPos.x_, viewPos.y_, mod);
@@ -199,7 +293,7 @@ void UI::HandleMouseMove(StringHash eventType, VariantMap& eventData)
 
 
     IntVector2 viewPos;
-    tb::TBWidget* widget = UI::GetInternalWidgetAndProjectedPositionFor(pos, viewPos);
+    tb::TBWidget* widget = UI::GetInternalWidgetProjectedPosition(pos, viewPos);
 
     widget->InvokePointerMove(viewPos.x_, viewPos.y_, tb::TB_MODIFIER_NONE, false);
 
@@ -220,7 +314,7 @@ void UI::HandleMouseWheel(StringHash eventType, VariantMap& eventData)
 
 
     IntVector2 viewPos;
-    tb::TBWidget* widget = UI::GetInternalWidgetAndProjectedPositionFor(pos, viewPos);
+    tb::TBWidget* widget = UI::GetInternalWidgetProjectedPosition(pos, viewPos);
 
     widget->InvokeWheel(viewPos.x_, viewPos.y_, 0, -delta, tb::TB_MODIFIER_NONE);
 }
@@ -251,7 +345,7 @@ void UI::HandleTouchBegin(StringHash eventType, VariantMap& eventData)
 
 
     IntVector2 viewPos;
-    tb::TBWidget* widget = UI::GetInternalWidgetAndProjectedPositionFor(pos, viewPos);
+    tb::TBWidget* widget = UI::GetInternalWidgetProjectedPosition(pos, viewPos);
 
     widget->InvokePointerDown(viewPos.x_, viewPos.y_, counter, TB_MODIFIER_NONE, true, touchId);
 }
@@ -268,7 +362,7 @@ void UI::HandleTouchMove(StringHash eventType, VariantMap& eventData)
 
 
     IntVector2 viewPos;
-    tb::TBWidget* widget = UI::GetInternalWidgetAndProjectedPositionFor(pos, viewPos);
+    tb::TBWidget* widget = UI::GetInternalWidgetProjectedPosition(pos, viewPos);
 
     widget->InvokePointerMove(viewPos.x_, viewPos.y_, TB_MODIFIER_NONE, true, touchId);
 }
@@ -285,7 +379,7 @@ void UI::HandleTouchEnd(StringHash eventType, VariantMap& eventData)
 
 
     IntVector2 viewPos;
-    tb::TBWidget* widget = UI::GetInternalWidgetAndProjectedPositionFor(pos, viewPos);
+    tb::TBWidget* widget = UI::GetInternalWidgetProjectedPosition(pos, viewPos);
 
     widget->InvokePointerUp(viewPos.x_, viewPos.y_, TB_MODIFIER_NONE, true, touchId);
 }
@@ -424,91 +518,7 @@ void UI::HandleKey(bool keydown, int keycode, int scancode)
 #endif
     MODIFIER_KEYS mod = GetModifierKeys(qualifiers, superdown);
 
-    SPECIAL_KEY specialKey = TB_KEY_UNDEFINED;
-
-    switch (keycode)
-    {
-    case KEY_RETURN:
-    case KEY_RETURN2:
-    case KEY_KP_ENTER:
-        specialKey =  TB_KEY_ENTER;
-        break;
-    case KEY_F1:
-        specialKey = TB_KEY_F1;
-        break;
-    case KEY_F2:
-        specialKey = TB_KEY_F2;
-        break;
-    case KEY_F3:
-        specialKey = TB_KEY_F3;
-        break;
-    case KEY_F4:
-        specialKey = TB_KEY_F4;
-        break;
-    case KEY_F5:
-        specialKey = TB_KEY_F5;
-        break;
-    case KEY_F6:
-        specialKey = TB_KEY_F6;
-        break;
-    case KEY_F7:
-        specialKey = TB_KEY_F7;
-        break;
-    case KEY_F8:
-        specialKey = TB_KEY_F8;
-        break;
-    case KEY_F9:
-        specialKey = TB_KEY_F9;
-        break;
-    case KEY_F10:
-        specialKey = TB_KEY_F10;
-        break;
-    case KEY_F11:
-        specialKey = TB_KEY_F11;
-        break;
-    case KEY_F12:
-        specialKey = TB_KEY_F12;
-        break;
-    case KEY_LEFT:
-        specialKey = TB_KEY_LEFT;
-        break;
-    case KEY_UP:
-        specialKey = TB_KEY_UP;
-        break;
-    case KEY_RIGHT:
-        specialKey = TB_KEY_RIGHT;
-        break;
-    case KEY_DOWN:
-        specialKey = TB_KEY_DOWN;
-        break;
-    case KEY_PAGEUP:
-        specialKey = TB_KEY_PAGE_UP;
-        break;
-    case KEY_PAGEDOWN:
-        specialKey = TB_KEY_PAGE_DOWN;
-        break;
-    case KEY_HOME:
-        specialKey = TB_KEY_HOME;
-        break;
-    case KEY_END:
-        specialKey = TB_KEY_END;
-        break;
-    case KEY_INSERT:
-        specialKey = TB_KEY_INSERT;
-        break;
-    case KEY_TAB:
-        specialKey = TB_KEY_TAB;
-        break;
-    case KEY_DELETE:
-        specialKey = TB_KEY_DELETE;
-        break;
-    case KEY_BACKSPACE:
-        specialKey = TB_KEY_BACKSPACE;
-        break;
-    case KEY_ESCAPE:
-        specialKey =  TB_KEY_ESC;
-        break;
-    }
+    SPECIAL_KEY specialKey = GetSpecialKey(keycode);
 
     if (specialKey == TB_KEY_UNDEFINED)
     {

+ 22 - 123
Source/Atomic/UI/UIOffscreenView.cpp

@@ -33,6 +33,9 @@ using namespace tb;
 namespace Atomic
 {
 
+MODIFIER_KEYS GetModifierKeys(int qualifiers, bool superKey);
+SPECIAL_KEY GetSpecialKey(int keycode);
+
 UIOffscreenView::UIOffscreenView(Context* context) : UIWidget(context, false)
 {
     widget_ = new TBWidget();
@@ -53,7 +56,7 @@ UIOffscreenView::UIOffscreenView(Context* context) : UIWidget(context, false)
     GetTexture2D()->SetFilterMode(Atomic::FILTER_BILINEAR);
 
     // Add our self to the ui subsystem.
-    ui->GetOffscreenViews()->Insert(this);
+    ui->GetOffscreenViews().Insert(this);
 }
 
 UIOffscreenView::~UIOffscreenView()
@@ -62,7 +65,7 @@ UIOffscreenView::~UIOffscreenView()
 
     // Remove our self from the ui subsystem, if it's still around.
     if (ui)
-        ui->GetOffscreenViews()->Erase(this);
+        ui->GetOffscreenViews().Erase(this);
 }
 
 void UIOffscreenView::SetSize(int width, int height)
@@ -101,14 +104,14 @@ void UIOffscreenView::UnregisterInput()
     inputRect_ = IntRect::ZERO;
 }
 
-bool UIOffscreenView::SavePNGTo(Serializer& serializer) const
+bool UIOffscreenView::SavePNG(Serializer& dest) const
 {
     Image image(context_);
     if (!image.SetSize(GetWidth(), GetHeight(), 4))
         return false;
     if (!GetTexture2D()->GetData(0, image.GetData()))
         return false;
-    if (!image.Save(serializer))
+    if (!image.Save(dest))
         return false;
     return true;
 }
@@ -118,146 +121,42 @@ bool UIOffscreenView::SavePNG(const String& fileName) const
     File outFile(context_, fileName, FILE_WRITE);
     if (!outFile.IsOpen())
         return false;
-    return SavePNGTo(outFile);
-}
-
-static inline MODIFIER_KEYS GetModifierKeys(int qualifiers, bool superKey)
-{
-    MODIFIER_KEYS code = TB_MODIFIER_NONE;
-    if (qualifiers & QUAL_ALT)   code |= TB_ALT;
-    if (qualifiers & QUAL_CTRL)  code |= TB_CTRL;
-    if (qualifiers & QUAL_SHIFT) code |= TB_SHIFT;
-    if (superKey)                code |= TB_SUPER;
-    return code;
-}
-
-static inline SPECIAL_KEY GetSpecialKey(int keycode)
-{
-    SPECIAL_KEY specialKey;
-
-    switch (keycode)
-    {
-    case KEY_RETURN:
-    case KEY_RETURN2:
-    case KEY_KP_ENTER:
-        specialKey = TB_KEY_ENTER;
-        break;
-    case KEY_F1:
-        specialKey = TB_KEY_F1;
-        break;
-    case KEY_F2:
-        specialKey = TB_KEY_F2;
-        break;
-    case KEY_F3:
-        specialKey = TB_KEY_F3;
-        break;
-    case KEY_F4:
-        specialKey = TB_KEY_F4;
-        break;
-    case KEY_F5:
-        specialKey = TB_KEY_F5;
-        break;
-    case KEY_F6:
-        specialKey = TB_KEY_F6;
-        break;
-    case KEY_F7:
-        specialKey = TB_KEY_F7;
-        break;
-    case KEY_F8:
-        specialKey = TB_KEY_F8;
-        break;
-    case KEY_F9:
-        specialKey = TB_KEY_F9;
-        break;
-    case KEY_F10:
-        specialKey = TB_KEY_F10;
-        break;
-    case KEY_F11:
-        specialKey = TB_KEY_F11;
-        break;
-    case KEY_F12:
-        specialKey = TB_KEY_F12;
-        break;
-    case KEY_LEFT:
-        specialKey = TB_KEY_LEFT;
-        break;
-    case KEY_UP:
-        specialKey = TB_KEY_UP;
-        break;
-    case KEY_RIGHT:
-        specialKey = TB_KEY_RIGHT;
-        break;
-    case KEY_DOWN:
-        specialKey = TB_KEY_DOWN;
-        break;
-    case KEY_PAGEUP:
-        specialKey = TB_KEY_PAGE_UP;
-        break;
-    case KEY_PAGEDOWN:
-        specialKey = TB_KEY_PAGE_DOWN;
-        break;
-    case KEY_HOME:
-        specialKey = TB_KEY_HOME;
-        break;
-    case KEY_END:
-        specialKey = TB_KEY_END;
-        break;
-    case KEY_INSERT:
-        specialKey = TB_KEY_INSERT;
-        break;
-    case KEY_TAB:
-        specialKey = TB_KEY_TAB;
-        break;
-    case KEY_DELETE:
-        specialKey = TB_KEY_DELETE;
-        break;
-    case KEY_BACKSPACE:
-        specialKey = TB_KEY_BACKSPACE;
-        break;
-    case KEY_ESCAPE:
-        specialKey = TB_KEY_ESC;
-        break;
-    default:
-        specialKey = TB_KEY_UNDEFINED;
-        break;
-    }
-
-    return specialKey;
+    return SavePNG(outFile);
 }
 
-void UIOffscreenView::InvokeRightPointerDown(int x, int y, int click_count, int qualifiers, bool superDown)
+void UIOffscreenView::InvokeRightPointerDown(int x, int y, int click_count, int qualifiers, bool superKeyDown)
 {
-    widget_->InvokeRightPointerDown(x, y, click_count, GetModifierKeys(qualifiers, superDown));
+    widget_->InvokeRightPointerDown(x, y, click_count, GetModifierKeys(qualifiers, superKeyDown));
 }
 
-void UIOffscreenView::InvokeRightPointerUp(int x, int y, int qualifiers, bool superDown)
+void UIOffscreenView::InvokeRightPointerUp(int x, int y, int qualifiers, bool superKeyDown)
 {
-    widget_->InvokeRightPointerUp(x, y, GetModifierKeys(qualifiers, superDown));
+    widget_->InvokeRightPointerUp(x, y, GetModifierKeys(qualifiers, superKeyDown));
 }
 
-void UIOffscreenView::InvokePointerDown(int x, int y, int click_count, int qualifiers, bool touch, int touchId, bool superDown)
+void UIOffscreenView::InvokePointerDown(int x, int y, int click_count, int qualifiers, bool touch, int touchId, bool superKeyDown)
 {
-    widget_->InvokePointerDown(x, y, click_count, GetModifierKeys(qualifiers, superDown), touch, touchId);
+    widget_->InvokePointerDown(x, y, click_count, GetModifierKeys(qualifiers, superKeyDown), touch, touchId);
 }
 
-void UIOffscreenView::InvokePointerUp(int x, int y, int qualifiers, bool touch, int touchId, bool superDown)
+void UIOffscreenView::InvokePointerUp(int x, int y, int qualifiers, bool touch, int touchId, bool superKeyDown)
 {
-    widget_->InvokePointerUp(x, y, GetModifierKeys(qualifiers, superDown), touch, touchId);
+    widget_->InvokePointerUp(x, y, GetModifierKeys(qualifiers, superKeyDown), touch, touchId);
 }
 
-void UIOffscreenView::InvokePointerMove(int x, int y, int qualifiers, bool touch, int touchId, bool superDown)
+void UIOffscreenView::InvokePointerMove(int x, int y, int qualifiers, bool touch, int touchId, bool superKeyDown)
 {
-    widget_->InvokePointerMove(x, y, GetModifierKeys(qualifiers, superDown), touch, touchId);
+    widget_->InvokePointerMove(x, y, GetModifierKeys(qualifiers, superKeyDown), touch, touchId);
 }
 
-void UIOffscreenView::InvokeWheel(int x, int y, int delta_x, int delta_y, int qualifiers, bool superDown)
+void UIOffscreenView::InvokeWheel(int x, int y, int delta_x, int delta_y, int qualifiers, bool superKeyDown)
 {
-    widget_->InvokeWheel(x, y, delta_x, delta_y, GetModifierKeys(qualifiers, superDown));
+    widget_->InvokeWheel(x, y, delta_x, delta_y, GetModifierKeys(qualifiers, superKeyDown));
 }
 
-bool UIOffscreenView::InvokeKey(int key, int keycode, bool down, int qualifiers, bool superDown)
+bool UIOffscreenView::InvokeKey(int key, int keycode, bool down, int qualifiers, bool superKeyDown)
 {
-    return widget_->InvokeKey(key, GetSpecialKey(keycode), GetModifierKeys(qualifiers, superDown), down);
+    return widget_->InvokeKey(key, GetSpecialKey(keycode), GetModifierKeys(qualifiers, superKeyDown), down);
 }
 
 }

+ 8 - 8
Source/Atomic/UI/UIOffscreenView.h

@@ -73,17 +73,17 @@ public:
     /// Set wether to clear the render target each frame.
     void SetClearRenderTargetEachFrame(bool clear) { clearRenderTargetEachFrame_ = clear; }
     /// Save PNG to a serializer.
-    bool SavePNGTo(Serializer& dest) const;
+    bool SavePNG(Serializer& dest) const;
     /// Save PNG to a file.
     bool SavePNG(const String& fileName) const;
 
-    void InvokeRightPointerDown(int x, int y, int click_count, int qualifiers, bool superDown = false);
-    void InvokeRightPointerUp(int x, int y, int qualifiers, bool superDown = false);
-    void InvokePointerDown(int x, int y, int click_count, int qualifiers, bool touch, int touchId, bool superDown = false);
-    void InvokePointerUp(int x, int y, int qualifiers, bool touch, int touchId, bool superDown = false);
-    void InvokePointerMove(int x, int y, int qualifiers, bool touch, int touchId, bool superDown = false);
-    void InvokeWheel(int x, int y, int delta_x, int delta_y, int qualifiers, bool superDown = false);
-    bool InvokeKey(int key, int keycode, bool down, int qualifiers, bool superDown = false);
+    void InvokeRightPointerDown(int x, int y, int click_count, int qualifiers, bool superKeyDown = false);
+    void InvokeRightPointerUp(int x, int y, int qualifiers, bool superKeyDown = false);
+    void InvokePointerDown(int x, int y, int click_count, int qualifiers, bool touch, int touchId, bool superKeyDown = false);
+    void InvokePointerUp(int x, int y, int qualifiers, bool touch, int touchId, bool superKeyDown = false);
+    void InvokePointerMove(int x, int y, int qualifiers, bool touch, int touchId, bool superKeyDown = false);
+    void InvokeWheel(int x, int y, int delta_x, int delta_y, int qualifiers, bool superKeyDown = false);
+    bool InvokeKey(int key, int keycode, bool down, int qualifiers, bool superKeyDown = false);
 
 protected: