Merge branch 'master' into feature/hdrOS

This commit is contained in:
Jonathas Costa
2019-02-15 13:48:12 -05:00
15 changed files with 50 additions and 30 deletions
+1 -1
View File
@@ -205,7 +205,7 @@ ImGUIModule::ImGUIModule() : OpenSpaceModule(Name) {
);
global::callback::mouseButton.emplace_back(
[&](MouseButton button, MouseAction action) -> bool {
[&](MouseButton button, MouseAction action, KeyModifier) -> bool {
// A list of all the windows that can show up by themselves
if (gui.isEnabled() || gui._performance.isEnabled() ||
gui._sceneProperty.isEnabled())
+2 -2
View File
@@ -62,7 +62,7 @@ public:
void detachBrowser();
private:
bool mouseButtonCallback(MouseButton button, MouseAction action);
bool mouseButtonCallback(MouseButton button, MouseAction action, KeyModifier mods);
bool mousePositionCallback(double x, double y);
bool mouseWheelCallback(glm::ivec2 delta);
bool charCallback(unsigned int charCode, KeyModifier modifier);
@@ -82,7 +82,7 @@ private:
*
* \return
*/
CefMouseEvent mouseEvent();
CefMouseEvent mouseEvent(KeyModifier mods = KeyModifier::NoModifier);
/**
* Find the CEF key event to use for a given action.
+9 -5
View File
@@ -125,9 +125,9 @@ void EventHandler::initialize() {
}
);
global::callback::mouseButton.emplace_back(
[this](MouseButton button, MouseAction action) -> bool {
[this](MouseButton button, MouseAction action, KeyModifier mods) -> bool {
if (_browserInstance) {
return mouseButtonCallback(button, action);
return mouseButtonCallback(button, action, mods);
}
return false;
}
@@ -143,7 +143,10 @@ void EventHandler::initialize() {
);
}
bool EventHandler::mouseButtonCallback(MouseButton button, MouseAction action) {
bool EventHandler::mouseButtonCallback(MouseButton button,
MouseAction action,
KeyModifier mods)
{
if (button != MouseButton::Left && button != MouseButton::Right) {
return false;
}
@@ -167,7 +170,7 @@ bool EventHandler::mouseButtonCallback(MouseButton button, MouseAction action) {
}
return _browserInstance->sendMouseClickEvent(
mouseEvent(),
mouseEvent(mods),
(button == MouseButton::Left) ? MBT_LEFT : MBT_RIGHT,
!state.down,
clickCount
@@ -250,7 +253,7 @@ cef_key_event_type_t EventHandler::keyEventType(KeyAction action) {
}
}
CefMouseEvent EventHandler::mouseEvent() {
CefMouseEvent EventHandler::mouseEvent(KeyModifier mods) {
CefMouseEvent event;
event.x = static_cast<int>(_mousePosition.x);
event.y = static_cast<int>(_mousePosition.y);
@@ -263,6 +266,7 @@ CefMouseEvent EventHandler::mouseEvent() {
event.modifiers = EVENTFLAG_RIGHT_MOUSE_BUTTON;
}
event.modifiers |= static_cast<uint32_t>(mapToCefModifiers(mods));
return event;
}
+2 -2
View File
@@ -158,8 +158,8 @@ void WebGuiModule::startProcess() {
#endif
const std::string command = "\"" + nodePath + "\" "
+ "\"" + _entryPoint.value() + "\"" +
" --directory \"" + _webDirectory.value() + "\"" +
+ "\"" + absPath(_entryPoint.value()) + "\"" +
" --directory \"" + absPath(_webDirectory.value()) + "\"" +
" --http-port \"" + std::to_string(_port.value()) + "\" " +
" --ws-address \"" + _address.value() + "\"" +
" --ws-port \"" + std::to_string(webSocketPort) + "\"" +