guiInputCtrl.cpp
Engine/source/gui/utility/guiInputCtrl.cpp
Public Functions
ConsoleDocClass(GuiInputCtrl , "@brief A <a href="/coding/file/guieditctrl_8cpp/#guieditctrl_8cpp_1abb04e3738c4c5a96b3ade6fa47013a6c">control</a> that locks the mouse and reports all keyboard input events <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">script.\n\n</a>" "This is useful <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> implementing custom keyboard handling code, and most commonly " "used in Torque <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> menu that allows <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> user <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> remap their in-game <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">controls\n\n</a> " " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "<a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> <a href="/coding/class/classguiinputctrl/">GuiInputCtrl</a>(OptRemapInputCtrl)\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "{\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " lockMouse=\"0\";\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " position = \"0 0\";\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " extent = \"64 64\";\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " minExtent = \"8 8\";\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " horizSizing = \"center\";\n" " vertSizing = \"bottom\";\n" " profile = \"GuiInputCtrlProfile\";\n" " visible = \"1\";\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " active = \"1\";\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " tooltipProfile = \"GuiToolTipProfile\";\n" " hovertime = \"1000\";\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " isContainer = \"0\";\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " canSave = \"1\";\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " canSaveDynamicFields = \"0\";\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "};\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n\n</a>" "@see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">GuiMouseEventCtrl\n</a>" "@ingroup <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">GuiUtil\n</a>" )
IMPLEMENT_CALLBACK(GuiInputCtrl , onAxisEvent , void , (const char *device, const char *action, F32 axisValue) , (device, action, axisValue) , "@brief <a href="/coding/file/sqliteobject_8cpp/#sqliteobject_8cpp_1a858cd1af41f1e4420d94dfe65b6a56a4">Callback</a> that occurs when an axis event is triggered on this <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">control\n\n</a>" "@param device The device type triggering the input, such as mouse, joystick , gamepad , <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">etc\n</a>" " @param action The <a href="/coding/class/classactionmap/">ActionMap</a> code <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">axis\n</a>" " @param axisValue The current <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a> of the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">axis\n\n</a>" )
IMPLEMENT_CALLBACK(GuiInputCtrl , onInputEvent , void , (const char *device, const char *action, bool state) , (device, action, state) , "@brief <a href="/coding/file/sqliteobject_8cpp/#sqliteobject_8cpp_1a858cd1af41f1e4420d94dfe65b6a56a4">Callback</a> that occurs when an input is triggered on this <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">control\n\n</a>" "@param device The device type triggering the input, such as keyboard, mouse , <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">etc\n</a>" " @param action The actual event occuring, such as <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> key or <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">button\n</a>" " @param state True <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> the action is being pressed, false <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> it is being <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">release\n\n</a>" )
bool
isModifierKey(U16 keyCode)
Detailed Description
Public Functions
ConsoleDocClass(GuiInputCtrl , "@brief A <a href="/coding/file/guieditctrl_8cpp/#guieditctrl_8cpp_1abb04e3738c4c5a96b3ade6fa47013a6c">control</a> that locks the mouse and reports all keyboard input events <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">script.\n\n</a>" "This is useful <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> implementing custom keyboard handling code, and most commonly " "used in Torque <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> menu that allows <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> user <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> remap their in-game <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">controls\n\n</a> " " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "<a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> <a href="/coding/class/classguiinputctrl/">GuiInputCtrl</a>(OptRemapInputCtrl)\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "{\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " lockMouse=\"0\";\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " position = \"0 0\";\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " extent = \"64 64\";\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " minExtent = \"8 8\";\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " horizSizing = \"center\";\n" " vertSizing = \"bottom\";\n" " profile = \"GuiInputCtrlProfile\";\n" " visible = \"1\";\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " active = \"1\";\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " tooltipProfile = \"GuiToolTipProfile\";\n" " hovertime = \"1000\";\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " isContainer = \"0\";\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " canSave = \"1\";\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " canSaveDynamicFields = \"0\";\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "};\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n\n</a>" "@see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">GuiMouseEventCtrl\n</a>" "@ingroup <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">GuiUtil\n</a>" )
IMPLEMENT_CALLBACK(GuiInputCtrl , onAxisEvent , void , (const char *device, const char *action, F32 axisValue) , (device, action, axisValue) , "@brief <a href="/coding/file/sqliteobject_8cpp/#sqliteobject_8cpp_1a858cd1af41f1e4420d94dfe65b6a56a4">Callback</a> that occurs when an axis event is triggered on this <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">control\n\n</a>" "@param device The device type triggering the input, such as mouse, joystick , gamepad , <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">etc\n</a>" " @param action The <a href="/coding/class/classactionmap/">ActionMap</a> code <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">axis\n</a>" " @param axisValue The current <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a> of the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">axis\n\n</a>" )
IMPLEMENT_CALLBACK(GuiInputCtrl , onInputEvent , void , (const char *device, const char *action, bool state) , (device, action, state) , "@brief <a href="/coding/file/sqliteobject_8cpp/#sqliteobject_8cpp_1a858cd1af41f1e4420d94dfe65b6a56a4">Callback</a> that occurs when an input is triggered on this <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">control\n\n</a>" "@param device The device type triggering the input, such as keyboard, mouse , <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">etc\n</a>" " @param action The actual event occuring, such as <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> key or <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">button\n</a>" " @param state True <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> the action is being pressed, false <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> it is being <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">release\n\n</a>" )
IMPLEMENT_CONOBJECT(GuiInputCtrl )
isModifierKey(U16 keyCode)
1 2//----------------------------------------------------------------------------- 3// Copyright (c) 2012 GarageGames, LLC 4// 5// Permission is hereby granted, free of charge, to any person obtaining a copy 6// of this software and associated documentation files (the "Software"), to 7// deal in the Software without restriction, including without limitation the 8// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 9// sell copies of the Software, and to permit persons to whom the Software is 10// furnished to do so, subject to the following conditions: 11// 12// The above copyright notice and this permission notice shall be included in 13// all copies or substantial portions of the Software. 14// 15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 21// IN THE SOFTWARE. 22//----------------------------------------------------------------------------- 23 24#include "gui/utility/guiInputCtrl.h" 25#include "sim/actionMap.h" 26#include "console/engineAPI.h" 27 28IMPLEMENT_CONOBJECT(GuiInputCtrl); 29 30ConsoleDocClass( GuiInputCtrl, 31 "@brief A control that locks the mouse and reports all keyboard input events to script.\n\n" 32 33 "This is useful for implementing custom keyboard handling code, and most commonly " 34 "used in Torque for a menu that allows a user to remap their in-game controls\n\n " 35 36 "@tsexample\n" 37 "new GuiInputCtrl(OptRemapInputCtrl)\n" 38 "{\n" 39 " lockMouse = \"0\";\n" 40 " position = \"0 0\";\n" 41 " extent = \"64 64\";\n" 42 " minExtent = \"8 8\";\n" 43 " horizSizing = \"center\";\n" 44 " vertSizing = \"bottom\";\n" 45 " profile = \"GuiInputCtrlProfile\";\n" 46 " visible = \"1\";\n" 47 " active = \"1\";\n" 48 " tooltipProfile = \"GuiToolTipProfile\";\n" 49 " hovertime = \"1000\";\n" 50 " isContainer = \"0\";\n" 51 " canSave = \"1\";\n" 52 " canSaveDynamicFields = \"0\";\n" 53 "};\n" 54 "@endtsexample\n\n" 55 56 "@see GuiMouseEventCtrl\n" 57 58 "@ingroup GuiUtil\n"); 59 60//------------------------------------------------------------------------------ 61 62GuiInputCtrl::GuiInputCtrl() 63 : mSendAxisEvents(false), 64 mSendBreakEvents(false), 65 mSendModifierEvents(false) 66{ 67} 68 69//------------------------------------------------------------------------------ 70 71void GuiInputCtrl::initPersistFields() 72{ 73 addGroup("GuiInputCtrl"); 74 addField("sendAxisEvents", TypeBool, Offset(mSendAxisEvents, GuiInputCtrl), 75 "If true, onAxisEvent callbacks will be sent for SI_AXIS Move events (Default false)."); 76 addField("sendBreakEvents", TypeBool, Offset(mSendBreakEvents, GuiInputCtrl), 77 "If true, break events for all devices will generate callbacks (Default false)."); 78 addField("sendModifierEvents", TypeBool, Offset(mSendModifierEvents, GuiInputCtrl), 79 "If true, Make events will be sent for modifier keys (Default false)."); 80 endGroup("GuiInputCtrl"); 81 82 Parent::initPersistFields(); 83} 84 85//------------------------------------------------------------------------------ 86 87bool GuiInputCtrl::onWake() 88{ 89 // Set the default profile on start-up: 90 if( !mProfile ) 91 { 92 GuiControlProfile* profile; 93 Sim::findObject( "GuiInputCtrlProfile", profile); 94 if( profile ) 95 setControlProfile( profile ); 96 } 97 98 if ( !Parent::onWake() ) 99 return( false ); 100 101 if( !smDesignTime ) 102 mouseLock(); 103 104 setFirstResponder(); 105 106 return( true ); 107} 108 109 110//------------------------------------------------------------------------------ 111void GuiInputCtrl::onSleep() 112{ 113 Parent::onSleep(); 114 mouseUnlock(); 115 clearFirstResponder(); 116} 117 118 119//------------------------------------------------------------------------------ 120static bool isModifierKey( U16 keyCode ) 121{ 122 switch ( keyCode ) 123 { 124 case KEY_LCONTROL: 125 case KEY_RCONTROL: 126 case KEY_LALT: 127 case KEY_RALT: 128 case KEY_LSHIFT: 129 case KEY_RSHIFT: 130 case KEY_MAC_LOPT: 131 case KEY_MAC_ROPT: 132 return( true ); 133 } 134 135 return( false ); 136} 137 138IMPLEMENT_CALLBACK( GuiInputCtrl, onInputEvent, void, (const char* device, const char* action, bool state ), 139 ( device, action, state), 140 "@brief Callback that occurs when an input is triggered on this control\n\n" 141 "@param device The device type triggering the input, such as keyboard, mouse, etc\n" 142 "@param action The actual event occuring, such as a key or button\n" 143 "@param state True if the action is being pressed, false if it is being release\n\n"); 144 145IMPLEMENT_CALLBACK(GuiInputCtrl, onAxisEvent, void, (const char* device, const char* action, F32 axisValue), 146 (device, action, axisValue), 147 "@brief Callback that occurs when an axis event is triggered on this control\n\n" 148 "@param device The device type triggering the input, such as mouse, joystick, gamepad, etc\n" 149 "@param action The ActionMap code for the axis\n" 150 "@param axisValue The current value of the axis\n\n"); 151 152//------------------------------------------------------------------------------ 153bool GuiInputCtrl::onInputEvent( const InputEventInfo &event ) 154{ 155 char deviceString[32]; 156 if ( event.action == SI_MAKE ) 157 { 158 if ( event.objType == SI_BUTTON 159 || event.objType == SI_POV 160 || event.objType == SI_KEY ) 161 { 162 if ( !ActionMap::getDeviceName( event.deviceType, event.deviceInst, deviceString ) ) 163 return false; 164 165 if ((event.objType == SI_KEY) && isModifierKey(event.objInst)) 166 { 167 if (!mSendModifierEvents) 168 return false; 169 170 char keyString[32]; 171 if (!ActionMap::getKeyString(event.objInst, keyString)) 172 return false; 173 174 onInputEvent_callback(deviceString, keyString, 1); 175 } 176 else 177 { 178 const char* actionString = ActionMap::buildActionString(&event); 179 onInputEvent_callback(deviceString, actionString, 1); 180 } 181 return true; 182 } 183 } 184 else if ( event.action == SI_BREAK ) 185 { 186 if ( ( event.objType == SI_KEY ) && isModifierKey( event.objInst ) ) 187 { 188 char keyString[32]; 189 if ( !ActionMap::getKeyString( event.objInst, keyString ) ) 190 return false; 191 192 onInputEvent_callback("keyboard", keyString, 0); 193 return true; 194 } 195 else if (mSendBreakEvents) 196 { 197 if (!ActionMap::getDeviceName(event.deviceType, event.deviceInst, deviceString)) 198 return false; 199 200 const char* actionString = ActionMap::buildActionString(&event); 201 202 onInputEvent_callback(deviceString, actionString, 0); 203 return true; 204 } 205 } 206 else if (mSendAxisEvents && ((event.objType == SI_AXIS) || (event.objType == SI_INT) || (event.objType == SI_FLOAT))) 207 { 208 F32 fValue = event.fValue; 209 if (event.objType == SI_INT) 210 fValue = (F32)event.iValue; 211 212 if (!ActionMap::getDeviceName(event.deviceType, event.deviceInst, deviceString)) 213 return false; 214 215 const char* actionString = ActionMap::buildActionString(&event); 216 217 onAxisEvent_callback(deviceString, actionString, fValue); 218 return (event.deviceType != MouseDeviceType); // Don't consume mouse move events 219 } 220 221 return false; 222} 223