|
@@ -31,6 +31,7 @@
|
|
|
#include "CmProfiler.h"
|
|
#include "CmProfiler.h"
|
|
|
#include "CmMeshHeap.h"
|
|
#include "CmMeshHeap.h"
|
|
|
#include "CmTransientMesh.h"
|
|
#include "CmTransientMesh.h"
|
|
|
|
|
+#include "BsVirtualInput.h"
|
|
|
|
|
|
|
|
using namespace CamelotFramework;
|
|
using namespace CamelotFramework;
|
|
|
namespace BansheeEngine
|
|
namespace BansheeEngine
|
|
@@ -72,6 +73,7 @@ namespace BansheeEngine
|
|
|
mOnCursorDoubleClick = gInput().onDoubleClick.connect(boost::bind(&GUIManager::onCursorDoubleClick, this, _1));
|
|
mOnCursorDoubleClick = gInput().onDoubleClick.connect(boost::bind(&GUIManager::onCursorDoubleClick, this, _1));
|
|
|
mOnTextInputConn = gInput().onCharInput.connect(boost::bind(&GUIManager::onTextInput, this, _1));
|
|
mOnTextInputConn = gInput().onCharInput.connect(boost::bind(&GUIManager::onTextInput, this, _1));
|
|
|
mOnInputCommandConn = gInput().onInputCommand.connect(boost::bind(&GUIManager::onInputCommandEntered, this, _1));
|
|
mOnInputCommandConn = gInput().onInputCommand.connect(boost::bind(&GUIManager::onInputCommandEntered, this, _1));
|
|
|
|
|
+ mOnVirtualButtonDown = VirtualInput::instance().onButtonDown.connect(boost::bind(&GUIManager::onVirtualButtonDown, this, _1));
|
|
|
|
|
|
|
|
mWindowGainedFocusConn = RenderWindowManager::instance().onFocusGained.connect(boost::bind(&GUIManager::onWindowFocusGained, this, _1));
|
|
mWindowGainedFocusConn = RenderWindowManager::instance().onFocusGained.connect(boost::bind(&GUIManager::onWindowFocusGained, this, _1));
|
|
|
mWindowLostFocusConn = RenderWindowManager::instance().onFocusLost.connect(boost::bind(&GUIManager::onWindowFocusLost, this, _1));
|
|
mWindowLostFocusConn = RenderWindowManager::instance().onFocusLost.connect(boost::bind(&GUIManager::onWindowFocusLost, this, _1));
|
|
@@ -114,6 +116,7 @@ namespace BansheeEngine
|
|
|
mOnCursorDoubleClick.disconnect();
|
|
mOnCursorDoubleClick.disconnect();
|
|
|
mOnTextInputConn.disconnect();
|
|
mOnTextInputConn.disconnect();
|
|
|
mOnInputCommandConn.disconnect();
|
|
mOnInputCommandConn.disconnect();
|
|
|
|
|
+ mOnVirtualButtonDown.disconnect();
|
|
|
|
|
|
|
|
mDragEndedConn.disconnect();
|
|
mDragEndedConn.disconnect();
|
|
|
|
|
|
|
@@ -951,36 +954,12 @@ namespace BansheeEngine
|
|
|
case InputCommandType::Delete:
|
|
case InputCommandType::Delete:
|
|
|
mCommandEvent.setType(GUICommandEventType::Delete);
|
|
mCommandEvent.setType(GUICommandEventType::Delete);
|
|
|
break;
|
|
break;
|
|
|
- case InputCommandType::Copy:
|
|
|
|
|
- mCommandEvent.setType(GUICommandEventType::Copy);
|
|
|
|
|
- break;
|
|
|
|
|
- case InputCommandType::Cut:
|
|
|
|
|
- mCommandEvent.setType(GUICommandEventType::Cut);
|
|
|
|
|
- break;
|
|
|
|
|
- case InputCommandType::Paste:
|
|
|
|
|
- mCommandEvent.setType(GUICommandEventType::Paste);
|
|
|
|
|
- break;
|
|
|
|
|
- case InputCommandType::Undo:
|
|
|
|
|
- mCommandEvent.setType(GUICommandEventType::Undo);
|
|
|
|
|
- break;
|
|
|
|
|
- case InputCommandType::Redo:
|
|
|
|
|
- mCommandEvent.setType(GUICommandEventType::Redo);
|
|
|
|
|
- break;
|
|
|
|
|
case InputCommandType::Return:
|
|
case InputCommandType::Return:
|
|
|
mCommandEvent.setType(GUICommandEventType::Return);
|
|
mCommandEvent.setType(GUICommandEventType::Return);
|
|
|
break;
|
|
break;
|
|
|
case InputCommandType::Escape:
|
|
case InputCommandType::Escape:
|
|
|
mCommandEvent.setType(GUICommandEventType::Escape);
|
|
mCommandEvent.setType(GUICommandEventType::Escape);
|
|
|
break;
|
|
break;
|
|
|
- case InputCommandType::Tab:
|
|
|
|
|
- mCommandEvent.setType(GUICommandEventType::Tab);
|
|
|
|
|
- break;
|
|
|
|
|
- case InputCommandType::Rename:
|
|
|
|
|
- mCommandEvent.setType(GUICommandEventType::Rename);
|
|
|
|
|
- break;
|
|
|
|
|
- case InputCommandType::SelectAll:
|
|
|
|
|
- mCommandEvent.setType(GUICommandEventType::SelectAll);
|
|
|
|
|
- break;
|
|
|
|
|
case InputCommandType::CursorMoveLeft:
|
|
case InputCommandType::CursorMoveLeft:
|
|
|
mCommandEvent.setType(GUICommandEventType::CursorMoveLeft);
|
|
mCommandEvent.setType(GUICommandEventType::CursorMoveLeft);
|
|
|
break;
|
|
break;
|
|
@@ -1013,6 +992,19 @@ namespace BansheeEngine
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ void GUIManager::onVirtualButtonDown(const VirtualButton& button)
|
|
|
|
|
+ {
|
|
|
|
|
+ mVirtualButtonEvent.setButton(button);
|
|
|
|
|
+
|
|
|
|
|
+ for(auto& elementInFocus : mElementsInFocus)
|
|
|
|
|
+ {
|
|
|
|
|
+ bool processed = sendVirtualButtonEvent(elementInFocus.widget, elementInFocus.element, mVirtualButtonEvent);
|
|
|
|
|
+
|
|
|
|
|
+ if(processed)
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
bool GUIManager::findElementUnderCursor(const CM::Vector2I& cursorScreenPos, bool buttonStates[3], bool shift, bool control, bool alt)
|
|
bool GUIManager::findElementUnderCursor(const CM::Vector2I& cursorScreenPos, bool buttonStates[3], bool shift, bool control, bool alt)
|
|
|
{
|
|
{
|
|
|
Vector<const RenderWindow*>::type widgetWindows;
|
|
Vector<const RenderWindow*>::type widgetWindows;
|
|
@@ -1385,6 +1377,11 @@ namespace BansheeEngine
|
|
|
return widget->_commandEvent(element, event);
|
|
return widget->_commandEvent(element, event);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ bool GUIManager::sendVirtualButtonEvent(GUIWidget* widget, GUIElement* element, const GUIVirtualButtonEvent& event)
|
|
|
|
|
+ {
|
|
|
|
|
+ return widget->_virtualButtonEvent(element, event);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
GUIManager& gGUIManager()
|
|
GUIManager& gGUIManager()
|
|
|
{
|
|
{
|
|
|
return GUIManager::instance();
|
|
return GUIManager::instance();
|