From 2f0fcba1ebf49e79483f12b36f663f0c7a19ebc0 Mon Sep 17 00:00:00 2001 From: Sam Gondelman Date: Fri, 26 Jun 2015 17:28:02 -0700 Subject: [PATCH 1/3] key binding fixes as suggested by ctrlaltdavid, start in 3rd person if crashed in independent mode --- examples/mouseLook.js | 2 +- interface/src/Application.cpp | 5 +++++ interface/src/devices/KeyboardMouseDevice.cpp | 12 ++++++------ 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/examples/mouseLook.js b/examples/mouseLook.js index bf48a51c79..e095870ce6 100644 --- a/examples/mouseLook.js +++ b/examples/mouseLook.js @@ -38,7 +38,7 @@ var mouseLook = (function () { keyboardID = 0; function onKeyPressEvent(event) { - if (event.text == 'm' && event.isMeta) { + if (event.text == 'M') { active = !active; updateMapping(); } diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index a6b2a71c40..730fc007dd 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -604,6 +604,11 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : _settingsTimer.setSingleShot(false); _settingsTimer.setInterval(SAVE_SETTINGS_INTERVAL); _settingsThread.start(); + + if (Menu::getInstance()->isOptionChecked(MenuOption::IndependentMode)) { + Menu::getInstance()->setIsOptionChecked(MenuOption::ThirdPerson, true); + cameraMenuChanged(); + } _trayIcon->show(); diff --git a/interface/src/devices/KeyboardMouseDevice.cpp b/interface/src/devices/KeyboardMouseDevice.cpp index e04c27ae88..dd8de00bc7 100755 --- a/interface/src/devices/KeyboardMouseDevice.cpp +++ b/interface/src/devices/KeyboardMouseDevice.cpp @@ -225,14 +225,14 @@ void KeyboardMouseDevice::assignDefaultInputMapping(UserInputMapper& mapper) { mapper.addInputChannel(UserInputMapper::VERTICAL_DOWN, makeInput(Qt::Key_C), BUTTON_MOVE_SPEED); mapper.addInputChannel(UserInputMapper::VERTICAL_UP, makeInput(Qt::Key_E), BUTTON_MOVE_SPEED); - mapper.addInputChannel(UserInputMapper::BOOM_IN, makeInput(Qt::Key_W), makeInput(Qt::Key_Shift), BUTTON_BOOM_SPEED); - mapper.addInputChannel(UserInputMapper::BOOM_OUT, makeInput(Qt::Key_S), makeInput(Qt::Key_Shift), BUTTON_BOOM_SPEED); + mapper.addInputChannel(UserInputMapper::BOOM_IN, makeInput(Qt::Key_E), makeInput(Qt::Key_Shift), BUTTON_BOOM_SPEED); + mapper.addInputChannel(UserInputMapper::BOOM_OUT, makeInput(Qt::Key_C), makeInput(Qt::Key_Shift), BUTTON_BOOM_SPEED); mapper.addInputChannel(UserInputMapper::LATERAL_LEFT, makeInput(Qt::Key_A), makeInput(Qt::RightButton), BUTTON_YAW_SPEED); mapper.addInputChannel(UserInputMapper::LATERAL_RIGHT, makeInput(Qt::Key_D), makeInput(Qt::RightButton), BUTTON_YAW_SPEED); mapper.addInputChannel(UserInputMapper::LATERAL_LEFT, makeInput(Qt::Key_A), makeInput(Qt::Key_Shift), BUTTON_YAW_SPEED); mapper.addInputChannel(UserInputMapper::LATERAL_RIGHT, makeInput(Qt::Key_D), makeInput(Qt::Key_Shift), BUTTON_YAW_SPEED); - mapper.addInputChannel(UserInputMapper::PITCH_DOWN, makeInput(Qt::Key_C), makeInput(Qt::Key_Shift), BUTTON_PITCH_SPEED); - mapper.addInputChannel(UserInputMapper::PITCH_UP, makeInput(Qt::Key_E), makeInput(Qt::Key_Shift), BUTTON_PITCH_SPEED); + mapper.addInputChannel(UserInputMapper::PITCH_DOWN, makeInput(Qt::Key_S), makeInput(Qt::Key_Shift), BUTTON_PITCH_SPEED); + mapper.addInputChannel(UserInputMapper::PITCH_UP, makeInput(Qt::Key_W), makeInput(Qt::Key_Shift), BUTTON_PITCH_SPEED); // Arrow keys mapping mapper.addInputChannel(UserInputMapper::LONGITUDINAL_BACKWARD, makeInput(Qt::Key_Down), BUTTON_MOVE_SPEED); @@ -270,8 +270,8 @@ void KeyboardMouseDevice::assignDefaultInputMapping(UserInputMapper& mapper) { mapper.addInputChannel(UserInputMapper::YAW_RIGHT, makeInput(TOUCH_AXIS_X_POS), TOUCH_YAW_SPEED); // Wheel move - mapper.addInputChannel(UserInputMapper::BOOM_IN, makeInput(MOUSE_AXIS_WHEEL_Y_NEG), BUTTON_BOOM_SPEED); - mapper.addInputChannel(UserInputMapper::BOOM_OUT, makeInput(MOUSE_AXIS_WHEEL_Y_POS), BUTTON_BOOM_SPEED); + mapper.addInputChannel(UserInputMapper::BOOM_IN, makeInput(MOUSE_AXIS_WHEEL_Y_POS), BUTTON_BOOM_SPEED); + mapper.addInputChannel(UserInputMapper::BOOM_OUT, makeInput(MOUSE_AXIS_WHEEL_Y_NEG), BUTTON_BOOM_SPEED); mapper.addInputChannel(UserInputMapper::LATERAL_LEFT, makeInput(MOUSE_AXIS_WHEEL_X_NEG), BUTTON_YAW_SPEED); mapper.addInputChannel(UserInputMapper::LATERAL_RIGHT, makeInput(MOUSE_AXIS_WHEEL_X_POS), BUTTON_YAW_SPEED); From 3b987c1e7313aa3b85e605ddf1b9b13ed94fca2a Mon Sep 17 00:00:00 2001 From: Brad Davis Date: Fri, 26 Jun 2015 18:14:31 -0700 Subject: [PATCH 2/3] Fixing always-on link cursor --- interface/src/ui/ApplicationCompositor.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/interface/src/ui/ApplicationCompositor.cpp b/interface/src/ui/ApplicationCompositor.cpp index 98da0bfa2f..339b174791 100644 --- a/interface/src/ui/ApplicationCompositor.cpp +++ b/interface/src/ui/ApplicationCompositor.cpp @@ -132,19 +132,18 @@ ApplicationCompositor::ApplicationCompositor() { // check the format of this href string before we parse it QString hrefString = properties.getHref(); - if (!hrefString.startsWith("hifi:")) { - hrefString.prepend("hifi://"); - } - - // parse out a QUrl from the hrefString - QUrl href = QUrl(hrefString); - - _hoverItemTitle = href.host(); - _hoverItemDescription = properties.getDescription(); auto cursor = Cursor::Manager::instance().getCursor(); + if (!hrefString.isEmpty()) { + if (!hrefString.startsWith("hifi:")) { + hrefString.prepend("hifi://"); + } - if (!href.isEmpty()) { + // parse out a QUrl from the hrefString + QUrl href = QUrl(hrefString); + + _hoverItemTitle = href.host(); + _hoverItemDescription = properties.getDescription(); cursor->setIcon(Cursor::Icon::LINK); } else { cursor->setIcon(Cursor::Icon::DEFAULT); From e6fade8c13d2c48f29d92d03fb9caf51b84b9ee7 Mon Sep 17 00:00:00 2001 From: Brad Davis Date: Fri, 26 Jun 2015 18:16:56 -0700 Subject: [PATCH 3/3] Prevent tooltips from appearing with stale data --- interface/src/ui/ApplicationCompositor.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/interface/src/ui/ApplicationCompositor.cpp b/interface/src/ui/ApplicationCompositor.cpp index 339b174791..6cdf690d99 100644 --- a/interface/src/ui/ApplicationCompositor.cpp +++ b/interface/src/ui/ApplicationCompositor.cpp @@ -146,6 +146,8 @@ ApplicationCompositor::ApplicationCompositor() { _hoverItemDescription = properties.getDescription(); cursor->setIcon(Cursor::Icon::LINK); } else { + _hoverItemTitle.clear(); + _hoverItemDescription.clear(); cursor->setIcon(Cursor::Icon::DEFAULT); } }