From 12bcea28612a361f9763b6a8dd501df7b90286c9 Mon Sep 17 00:00:00 2001 From: James Turner Date: Wed, 6 Mar 2013 14:24:29 +0000 Subject: [PATCH 1/1] Make Ctrl+axis bindings explicit (and work). Thanks to Clement/F-JJTH for the fix. --- src/Input/FGMouseInput.cxx | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/Input/FGMouseInput.cxx b/src/Input/FGMouseInput.cxx index eee13d6f6..926173c53 100644 --- a/src/Input/FGMouseInput.cxx +++ b/src/Input/FGMouseInput.cxx @@ -304,7 +304,7 @@ void FGMouseInput::init() m.mouse_button_nodes[j]->setBoolValue(false); } - // Read all the modes + // Read all the modes m.nModes = mouse_node->getIntValue("mode-count", 1); m.modes = new mouse_mode[m.nModes]; @@ -315,11 +315,11 @@ void FGMouseInput::init() // Read the mouse cursor for this mode m.modes[j].cursor = FGMouseCursor::cursorFromString(mode_node->getStringValue("cursor", "inherit")); - // Read other properties for this mode + // Read other properties for this mode m.modes[j].constrained = mode_node->getBoolValue("constrained", false); m.modes[j].pass_through = mode_node->getBoolValue("pass-through", false); - // Read the button bindings for this mode + // Read the button bindings for this mode m.modes[j].buttons = new FGButton[MAX_MOUSE_BUTTONS]; std::ostringstream buf; for (k = 0; k < MAX_MOUSE_BUTTONS; k++) { @@ -328,10 +328,18 @@ void FGMouseInput::init() m.modes[j].buttons[k].init( mode_node->getChild("button", k), buf.str(), module ); } - // Read the axis bindings for this mode + // Read the axis bindings for this mode read_bindings(mode_node->getChild("x-axis", 0, true), m.modes[j].x_bindings, KEYMOD_NONE, module ); read_bindings(mode_node->getChild("y-axis", 0, true), m.modes[j].y_bindings, KEYMOD_NONE, module ); - } + + if (mode_node->hasChild("x-axis-ctrl")) { + read_bindings(mode_node->getChild("x-axis-ctrl"), m.modes[j].x_bindings, KEYMOD_CTRL, module ); + } + + if (mode_node->hasChild("y-axis-ctrl")) { + read_bindings(mode_node->getChild("y-axis-ctrl"), m.modes[j].y_bindings, KEYMOD_CTRL, module ); + } + } // of modes iteration } fgRegisterMouseClickHandler(mouseClickHandler); -- 2.39.2