Merge branch 'master' into core

This commit is contained in:
Bradley Austin Davis 2015-08-03 22:18:38 -07:00
commit ed5f70039f
8 changed files with 122 additions and 137 deletions

View file

@ -0,0 +1,40 @@
#
# Find3DConnexionClient.cmake
#
# Once done this will define
# 3DCONNEXIONCLIENT_FOUND - system found 3DConnexion
# 3DCONNEXIONCLIENT_INCLUDE_DIRS - the 3DConnexion include directory
# 3DCONNEXIONCLIENT_LIBRARY - Link this to use 3DConnexion
#
# Created on 10/06/2015 by Marcel Verhagen
# Copyright 2015 High Fidelity, Inc.
#
# Distributed under the Apache License, Version 2.0.
# See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
#
include("${MACRO_DIR}/HifiLibrarySearchHints.cmake")
hifi_library_search_hints("connexionclient")
if (APPLE)
find_library(3DConnexionClient 3DConnexionClient)
if(EXISTS ${3DConnexionClient})
set(3DCONNEXIONCLIENT_FOUND true)
set(3DCONNEXIONCLIENT_INCLUDE_DIRS ${3DConnexionClient})
set(3DCONNEXIONCLIENT_LIBRARY ${3DConnexionClient})
message(STATUS "Found 3DConnexion at " ${3DConnexionClient})
mark_as_advanced(3DCONNEXIONCLIENT_INCLUDE_DIR CONNEXIONCLIENT_LIBRARY)
else ()
message(STATUS "Could NOT find 3DConnexionClient")
endif()
endif()
if (WIN32)
find_path(3DCONNEXIONCLIENT_INCLUDE_DIRS I3dMouseParams.h PATH_SUFFIXES Inc HINTS ${CONNEXIONCLIENT_SEARCH_DIRS})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(3DConnexionClient DEFAULT_MSG 3DCONNEXIONCLIENT_INCLUDE_DIRS)
mark_as_advanced(3DCONNEXIONCLIENT_INCLUDE_DIRS 3DCONNEXIONCLIENT_SEARCH_DIRS)
endif()

View file

@ -1,38 +0,0 @@
#
# FindconnexionClient.cmake
#
# Once done this will define
#
# 3DCONNEXIONCLIENT_INCLUDE_DIRS
#
# Created on 10/06/2015 by Marcel Verhagen
# Copyright 2015 High Fidelity, Inc.
#
# Distributed under the Apache License, Version 2.0.
# See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
#
# setup hints for 3DCONNEXIONCLIENT search
include("${MACRO_DIR}/HifiLibrarySearchHints.cmake")
hifi_library_search_hints("connexionclient")
if (APPLE)
find_library(3DconnexionClient 3DconnexionClient)
if(EXISTS ${3DconnexionClient})
set(CONNEXIONCLIENT_FOUND true)
set(CONNEXIONCLIENT_INCLUDE_DIR ${3DconnexionClient})
set(CONNEXIONCLIENT_LIBRARY ${3DconnexionClient})
set_target_properties(${TARGET_NAME} PROPERTIES LINK_FLAGS "-weak_framework 3DconnexionClient")
message(STATUS "Found 3Dconnexion")
mark_as_advanced(CONNEXIONCLIENT_INCLUDE_DIR CONNEXIONCLIENT_LIBRARY)
endif()
endif()
if (WIN32)
find_path(CONNEXIONCLIENT_INCLUDE_DIRS I3dMouseParams.h PATH_SUFFIXES Inc HINTS ${CONNEXIONCLIENT_SEARCH_DIRS})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(connexionClient DEFAULT_MSG CONNEXIONCLIENT_INCLUDE_DIRS)
mark_as_advanced(CONNEXIONCLIENT_INCLUDE_DIRS CONNEXIONCLIENT_SEARCH_DIRS)
endif()

View file

@ -2,7 +2,7 @@ set(TARGET_NAME interface)
project(${TARGET_NAME}) project(${TARGET_NAME})
# set a default root dir for each of our optional externals if it was not passed # set a default root dir for each of our optional externals if it was not passed
set(OPTIONAL_EXTERNALS "Faceshift" "Sixense" "LeapMotion" "RtMidi" "SDL2" "RSSDK" "connexionClient") set(OPTIONAL_EXTERNALS "Faceshift" "Sixense" "LeapMotion" "RtMidi" "SDL2" "RSSDK" "3DConnexionClient")
foreach(EXTERNAL ${OPTIONAL_EXTERNALS}) foreach(EXTERNAL ${OPTIONAL_EXTERNALS})
string(TOUPPER ${EXTERNAL} ${EXTERNAL}_UPPERCASE) string(TOUPPER ${EXTERNAL} ${EXTERNAL}_UPPERCASE)
if (NOT ${${EXTERNAL}_UPPERCASE}_ROOT_DIR) if (NOT ${${EXTERNAL}_UPPERCASE}_ROOT_DIR)

View file

@ -1,4 +1,3 @@
The mac version does not require any files here. 3D connexion should be installed from The Mac version does not require any files. The 3D Connexion driver should be installed from http://www.3dconnexion.eu/service/drivers.html
http://www.3dconnexion.eu/service/drivers.html
For windows a header file is required Inc/I3dMouseParams.h For Windows the provided header file is required: Inc/I3dMouseParams.h

View file

@ -115,7 +115,7 @@
#include "devices/MIDIManager.h" #include "devices/MIDIManager.h"
#include "devices/OculusManager.h" #include "devices/OculusManager.h"
#include "devices/TV3DManager.h" #include "devices/TV3DManager.h"
#include "devices/3Dconnexion.h" #include "devices/3DConnexionClient.h"
#include "scripting/AccountScriptingInterface.h" #include "scripting/AccountScriptingInterface.h"
#include "scripting/AudioDeviceScriptingInterface.h" #include "scripting/AudioDeviceScriptingInterface.h"

View file

@ -29,7 +29,7 @@
#include "devices/Faceshift.h" #include "devices/Faceshift.h"
#include "devices/RealSense.h" #include "devices/RealSense.h"
#include "devices/SixenseManager.h" #include "devices/SixenseManager.h"
#include "devices/3Dconnexion.h" #include "devices/3DConnexionClient.h"
#include "MainWindow.h" #include "MainWindow.h"
#include "scripting/MenuScriptingInterface.h" #include "scripting/MenuScriptingInterface.h"
#if defined(Q_OS_MAC) || defined(Q_OS_WIN) #if defined(Q_OS_MAC) || defined(Q_OS_WIN)

View file

@ -1,6 +1,6 @@
// //
// 3DConnexion.cpp // 3DConnexionClient.cpp
// hifi // interface/src/devices
// //
// Created by MarcelEdward Verhagen on 09-06-15. // Created by MarcelEdward Verhagen on 09-06-15.
// Copyright 2015 High Fidelity, Inc. // Copyright 2015 High Fidelity, Inc.
@ -9,7 +9,7 @@
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
// //
#include "3Dconnexion.h" #include "3DConnexionClient.h"
#include "UserActivityLogger.h" #include "UserActivityLogger.h"
const float MAX_AXIS = 75.0f; // max forward = 2x speed const float MAX_AXIS = 75.0f; // max forward = 2x speed
@ -28,7 +28,6 @@ ConnexionData::ConnexionData() {
} }
void ConnexionData::handleAxisEvent() { void ConnexionData::handleAxisEvent() {
//qCWarning(interfaceapp) << "pos state x = " << cc_position.x << " y = " << cc_position.y << " z = " << cc_position.z << " Rotation x = " << cc_rotation.x << " y = " << cc_rotation.y << " z = " << cc_rotation.z;
_axisStateMap[makeInput(ROTATION_AXIS_Y_POS).getChannel()] = (cc_rotation.y > 0.0f) ? cc_rotation.y / MAX_AXIS : 0.0f; _axisStateMap[makeInput(ROTATION_AXIS_Y_POS).getChannel()] = (cc_rotation.y > 0.0f) ? cc_rotation.y / MAX_AXIS : 0.0f;
_axisStateMap[makeInput(ROTATION_AXIS_Y_NEG).getChannel()] = (cc_rotation.y < 0.0f) ? -cc_rotation.y / MAX_AXIS : 0.0f; _axisStateMap[makeInput(ROTATION_AXIS_Y_NEG).getChannel()] = (cc_rotation.y < 0.0f) ? -cc_rotation.y / MAX_AXIS : 0.0f;
_axisStateMap[makeInput(POSITION_AXIS_X_POS).getChannel()] = (cc_position.x > 0.0f) ? cc_position.x / MAX_AXIS : 0.0f; _axisStateMap[makeInput(POSITION_AXIS_X_POS).getChannel()] = (cc_position.x > 0.0f) ? cc_position.x / MAX_AXIS : 0.0f;
@ -148,7 +147,7 @@ UserInputMapper::Input ConnexionData::makeInput(ConnexionData::PositionChannel a
void ConnexionData::update() { void ConnexionData::update() {
// the update is done in the ConnexionClient class. // the update is done in the ConnexionClient class.
// for windows in the nativeEventFilter the inputmapper is connected or registed or removed when an 3Dconnnexion device is attached or deteched // for windows in the nativeEventFilter the inputmapper is connected or registed or removed when an 3Dconnnexion device is attached or detached
// for osx the api will call DeviceAddedHandler or DeviceRemoveHandler when a 3Dconnexion device is attached or detached // for osx the api will call DeviceAddedHandler or DeviceRemoveHandler when a 3Dconnexion device is attached or detached
} }
@ -157,14 +156,13 @@ ConnexionClient& ConnexionClient::getInstance() {
return sharedInstance; return sharedInstance;
} }
#ifdef HAVE_CONNEXIONCLIENT #ifdef HAVE_3DCONNEXIONCLIENT
#ifdef _WIN32 #ifdef _WIN32
static ConnexionClient* gMouseInput = 0; static ConnexionClient* gMouseInput = 0;
void ConnexionClient::toggleConnexion(bool shouldEnable) void ConnexionClient::toggleConnexion(bool shouldEnable) {
{
ConnexionData& connexiondata = ConnexionData::getInstance(); ConnexionData& connexiondata = ConnexionData::getInstance();
if (shouldEnable && connexiondata.getDeviceID() == 0) { if (shouldEnable && connexiondata.getDeviceID() == 0) {
ConnexionClient::init(); ConnexionClient::init();
@ -177,20 +175,18 @@ void ConnexionClient::toggleConnexion(bool shouldEnable)
void ConnexionClient::init() { void ConnexionClient::init() {
if (Menu::getInstance()->isOptionChecked(MenuOption::Connexion)) { if (Menu::getInstance()->isOptionChecked(MenuOption::Connexion)) {
ConnexionClient& cclient = ConnexionClient::getInstance(); fLast3dmouseInputTime = 0;
cclient.fLast3dmouseInputTime = 0;
cclient.InitializeRawInput(GetActiveWindow()); InitializeRawInput(GetActiveWindow());
gMouseInput = &cclient; gMouseInput = &this;
QAbstractEventDispatcher::instance()->installNativeEventFilter(&cclient); QAbstractEventDispatcher::instance()->installNativeEventFilter(&cclient);
} }
} }
void ConnexionClient::destroy() { void ConnexionClient::destroy() {
ConnexionClient& cclient = ConnexionClient::getInstance(); QAbstractEventDispatcher::instance()->removeNativeEventFilter(&this);
QAbstractEventDispatcher::instance()->removeNativeEventFilter(&cclient);
ConnexionData& connexiondata = ConnexionData::getInstance(); ConnexionData& connexiondata = ConnexionData::getInstance();
int deviceid = connexiondata.getDeviceID(); int deviceid = connexiondata.getDeviceID();
connexiondata.setDeviceID(0); connexiondata.setDeviceID(0);
@ -225,15 +221,15 @@ enum ConnexionPid {
// e3dmouse_virtual_key // e3dmouse_virtual_key
enum V3dk { enum V3dk {
V3DK_INVALID = 0 V3DK_INVALID = 0,
, V3DK_MENU = 1, V3DK_FIT V3DK_MENU = 1, V3DK_FIT,
, V3DK_TOP, V3DK_LEFT, V3DK_RIGHT, V3DK_FRONT, V3DK_BOTTOM, V3DK_BACK V3DK_TOP, V3DK_LEFT, V3DK_RIGHT, V3DK_FRONT, V3DK_BOTTOM, V3DK_BACK,
, V3DK_CW, V3DK_CCW V3DK_CW, V3DK_CCW,
, V3DK_ISO1, V3DK_ISO2 V3DK_ISO1, V3DK_ISO2,
, V3DK_1, V3DK_2, V3DK_3, V3DK_4, V3DK_5, V3DK_6, V3DK_7, V3DK_8, V3DK_9, V3DK_10 V3DK_1, V3DK_2, V3DK_3, V3DK_4, V3DK_5, V3DK_6, V3DK_7, V3DK_8, V3DK_9, V3DK_10,
, V3DK_ESC, V3DK_ALT, V3DK_SHIFT, V3DK_CTRL V3DK_ESC, V3DK_ALT, V3DK_SHIFT, V3DK_CTRL,
, V3DK_ROTATE, V3DK_PANZOOM, V3DK_DOMINANT V3DK_ROTATE, V3DK_PANZOOM, V3DK_DOMINANT,
, V3DK_PLUS, V3DK_MINUS V3DK_PLUS, V3DK_MINUS
}; };
struct tag_VirtualKeys { struct tag_VirtualKeys {
@ -244,33 +240,33 @@ struct tag_VirtualKeys {
// e3dmouse_virtual_key // e3dmouse_virtual_key
static const V3dk SpaceExplorerKeys[] = { static const V3dk SpaceExplorerKeys[] = {
V3DK_INVALID // there is no button 0 V3DK_INVALID, // there is no button 0
, V3DK_1, V3DK_2 V3DK_1, V3DK_2,
, V3DK_TOP, V3DK_LEFT, V3DK_RIGHT, V3DK_FRONT V3DK_TOP, V3DK_LEFT, V3DK_RIGHT, V3DK_FRONT,
, V3DK_ESC, V3DK_ALT, V3DK_SHIFT, V3DK_CTRL V3DK_ESC, V3DK_ALT, V3DK_SHIFT, V3DK_CTRL,
, V3DK_FIT, V3DK_MENU V3DK_FIT, V3DK_MENU,
, V3DK_PLUS, V3DK_MINUS V3DK_PLUS, V3DK_MINUS,
, V3DK_ROTATE V3DK_ROTATE
}; };
//e3dmouse_virtual_key //e3dmouse_virtual_key
static const V3dk SpacePilotKeys[] = { static const V3dk SpacePilotKeys[] = {
V3DK_INVALID V3DK_INVALID,
, V3DK_1, V3DK_2, V3DK_3, V3DK_4, V3DK_5, V3DK_6 V3DK_1, V3DK_2, V3DK_3, V3DK_4, V3DK_5, V3DK_6,
, V3DK_TOP, V3DK_LEFT, V3DK_RIGHT, V3DK_FRONT V3DK_TOP, V3DK_LEFT, V3DK_RIGHT, V3DK_FRONT,
, V3DK_ESC, V3DK_ALT, V3DK_SHIFT, V3DK_CTRL V3DK_ESC, V3DK_ALT, V3DK_SHIFT, V3DK_CTRL,
, V3DK_FIT, V3DK_MENU V3DK_FIT, V3DK_MENU,
, V3DK_PLUS, V3DK_MINUS V3DK_PLUS, V3DK_MINUS,
, V3DK_DOMINANT, V3DK_ROTATE V3DK_DOMINANT, V3DK_ROTATE,
}; };
static const struct tag_VirtualKeys _3dmouseVirtualKeys[] = { static const struct tag_VirtualKeys _3dmouseVirtualKeys[] = {
CONNEXIONPID_SPACEPILOT CONNEXIONPID_SPACEPILOT,
, sizeof(SpacePilotKeys) / sizeof(SpacePilotKeys[0]) sizeof(SpacePilotKeys) / sizeof(SpacePilotKeys[0]),
, const_cast<V3dk *>(SpacePilotKeys), const_cast<V3dk *>(SpacePilotKeys),
CONNEXIONPID_SPACEEXPLORER CONNEXIONPID_SPACEEXPLORER,
, sizeof(SpaceExplorerKeys) / sizeof(SpaceExplorerKeys[0]) sizeof(SpaceExplorerKeys) / sizeof(SpaceExplorerKeys[0]),
, const_cast<V3dk *>(SpaceExplorerKeys) const_cast<V3dk *>(SpaceExplorerKeys)
}; };
// Converts a hid device keycode (button identifier) of a pre-2009 3Dconnexion USB device to the standard 3d mouse virtual key definition. // Converts a hid device keycode (button identifier) of a pre-2009 3Dconnexion USB device to the standard 3d mouse virtual key definition.
@ -282,10 +278,8 @@ static const struct tag_VirtualKeys _3dmouseVirtualKeys[] = {
// to the standard 3d mouse virtual key definition. // to the standard 3d mouse virtual key definition.
unsigned short HidToVirtualKey(unsigned long pid, unsigned short hidKeyCode) { unsigned short HidToVirtualKey(unsigned long pid, unsigned short hidKeyCode) {
unsigned short virtualkey = hidKeyCode; unsigned short virtualkey = hidKeyCode;
for (size_t i = 0; i<sizeof(_3dmouseVirtualKeys) / sizeof(_3dmouseVirtualKeys[0]); ++i) for (size_t i = 0; i<sizeof(_3dmouseVirtualKeys) / sizeof(_3dmouseVirtualKeys[0]); ++i) {
{ if (pid == _3dmouseVirtualKeys[i].pid) {
if (pid == _3dmouseVirtualKeys[i].pid)
{
if (hidKeyCode < _3dmouseVirtualKeys[i].nKeys) { if (hidKeyCode < _3dmouseVirtualKeys[i].nKeys) {
virtualkey = _3dmouseVirtualKeys[i].vkeys[hidKeyCode]; virtualkey = _3dmouseVirtualKeys[i].vkeys[hidKeyCode];
} else { } else {
@ -332,8 +326,7 @@ ConnexionClient::ConnexionClient() {
} }
ConnexionClient::~ConnexionClient() { ConnexionClient::~ConnexionClient() {
ConnexionClient& cclient = ConnexionClient::getInstance(); QAbstractEventDispatcher::instance()->removeNativeEventFilter(&this);
QAbstractEventDispatcher::instance()->removeNativeEventFilter(&cclient);
} }
// Access the mouse parameters structure // Access the mouse parameters structure
@ -680,8 +673,6 @@ void ConnexionClient::OnRawInput(UINT nInputCode, HRAWINPUT hRawInput) {
bool ConnexionClient::TranslateRawInputData(UINT nInputCode, PRAWINPUT pRawInput) { bool ConnexionClient::TranslateRawInputData(UINT nInputCode, PRAWINPUT pRawInput) {
bool bIsForeground = (nInputCode == RIM_INPUT); bool bIsForeground = (nInputCode == RIM_INPUT);
//qDebug("Rawinput.header.dwType=0x%x\n", pRawInput->header.dwType);
// We are not interested in keyboard or mouse data received via raw input // We are not interested in keyboard or mouse data received via raw input
if (pRawInput->header.dwType != RIM_TYPEHID) { if (pRawInput->header.dwType != RIM_TYPEHID) {
return false; return false;
@ -691,7 +682,7 @@ bool ConnexionClient::TranslateRawInputData(UINT nInputCode, PRAWINPUT pRawInput
UINT dwSize = 0; UINT dwSize = 0;
if (::GetRawInputDeviceInfo(pRawInput->header.hDevice, RIDI_DEVICENAME, NULL, &dwSize) == 0) { if (::GetRawInputDeviceInfo(pRawInput->header.hDevice, RIDI_DEVICENAME, NULL, &dwSize) == 0) {
std::vector<wchar_t> szDeviceName(dwSize + 1); std::vector<wchar_t> szDeviceName(dwSize + 1);
if (::GetRawInputDeviceInfo(pRawInput->header.hDevice, RIDI_DEVICENAME, &szDeviceName[0], &dwSize) >0) { if (::GetRawInputDeviceInfo(pRawInput->header.hDevice, RIDI_DEVICENAME, &szDeviceName[0], &dwSize) > 0) {
qDebug("Device Name = %s\nDevice handle = 0x%x\n", &szDeviceName[0], pRawInput->header.hDevice); qDebug("Device Name = %s\nDevice handle = 0x%x\n", &szDeviceName[0], pRawInput->header.hDevice);
} }
} }
@ -806,16 +797,19 @@ bool ConnexionClient::TranslateRawInputData(UINT nInputCode, PRAWINPUT pRawInput
return false; return false;
} }
MouseParameters::MouseParameters() : fNavigation(NAVIGATION_OBJECT_MODE) MouseParameters::MouseParameters() :
, fPivot(PIVOT_AUTO) fNavigation(NAVIGATION_OBJECT_MODE),
, fPivotVisibility(PIVOT_SHOW) fPivot(PIVOT_AUTO),
, fIsLockHorizon(true) fPivotVisibility(PIVOT_SHOW),
, fIsPanZoom(true) fIsLockHorizon(true),
, fIsRotate(true) fIsPanZoom(true),
, fSpeed(SPEED_LOW) { fIsRotate(true),
fSpeed(SPEED_LOW)
{
} }
MouseParameters::~MouseParameters() { MouseParameters::~MouseParameters()
{
} }
bool MouseParameters::IsPanZoom() const { bool MouseParameters::IsPanZoom() const {
@ -831,15 +825,15 @@ MouseParameters::Speed MouseParameters::GetSpeed() const {
} }
void MouseParameters::SetPanZoom(bool isPanZoom) { void MouseParameters::SetPanZoom(bool isPanZoom) {
fIsPanZoom=isPanZoom; fIsPanZoom = isPanZoom;
} }
void MouseParameters::SetRotate(bool isRotate) { void MouseParameters::SetRotate(bool isRotate) {
fIsRotate=isRotate; fIsRotate = isRotate;
} }
void MouseParameters::SetSpeed(Speed speed) { void MouseParameters::SetSpeed(Speed speed) {
fSpeed=speed; fSpeed = speed;
} }
MouseParameters::Navigation MouseParameters::GetNavigationMode() const { MouseParameters::Navigation MouseParameters::GetNavigationMode() const {
@ -878,13 +872,6 @@ void MouseParameters::SetPivotVisibility(PivotVisibility visibility) {
#else #else
#define WITH_SEPARATE_THREAD false // set to true or false
// Make the linker happy for the framework check (see link below for more info)
// http://developer.apple.com/documentation/MacOSX/Conceptual/BPFrameworks/Concepts/WeakLinking.html
extern int16_t SetConnexionHandlers(ConnexionMessageHandlerProc messageHandler, ConnexionAddedHandlerProc addedHandler, ConnexionRemovedHandlerProc removedHandler, bool useSeparateThread) __attribute__((weak_import));
int fConnexionClientID; int fConnexionClientID;
static ConnexionDeviceState lastState; static ConnexionDeviceState lastState;
@ -893,20 +880,18 @@ static void DeviceAddedHandler(unsigned int connection);
static void DeviceRemovedHandler(unsigned int connection); static void DeviceRemovedHandler(unsigned int connection);
static void MessageHandler(unsigned int connection, unsigned int messageType, void *messageArgument); static void MessageHandler(unsigned int connection, unsigned int messageType, void *messageArgument);
void ConnexionClient::toggleConnexion(bool shouldEnable) void ConnexionClient::toggleConnexion(bool shouldEnable) {
{
if (shouldEnable && !ConnexionClient::Is3dmouseAttached()) { if (shouldEnable && !ConnexionClient::Is3dmouseAttached()) {
ConnexionClient::init(); ConnexionClient::init();
} }
if (!shouldEnable && ConnexionClient::Is3dmouseAttached()) { if (!shouldEnable && ConnexionClient::Is3dmouseAttached()) {
ConnexionClient::destroy(); ConnexionClient::destroy();
} }
} }
void ConnexionClient::init() { void ConnexionClient::init() {
// Make sure the framework is installed // Make sure the framework is installed
if (SetConnexionHandlers != NULL && Menu::getInstance()->isOptionChecked(MenuOption::Connexion)) { if (Menu::getInstance()->isOptionChecked(MenuOption::Connexion)) {
// Install message handler and register our client // Install message handler and register our client
InstallConnexionHandlers(MessageHandler, DeviceAddedHandler, DeviceRemovedHandler); InstallConnexionHandlers(MessageHandler, DeviceAddedHandler, DeviceRemovedHandler);
// Either use this to take over in our application only... does not work // Either use this to take over in our application only... does not work
@ -1010,4 +995,4 @@ void MessageHandler(unsigned int connection, unsigned int messageType, void *mes
#endif // __APPLE__ #endif // __APPLE__
#endif // HAVE_CONNEXIONCLIENT #endif // HAVE_3DCONNEXIONCLIENT

View file

@ -1,5 +1,5 @@
// 3DConnexion.h // 3DConnexionClient.h
// hifi // interface/src/devices
// //
// Created by Marcel Verhagen on 09-06-15. // Created by Marcel Verhagen on 09-06-15.
// Copyright 2015 High Fidelity, Inc. // Copyright 2015 High Fidelity, Inc.
@ -8,8 +8,8 @@
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
// //
#ifndef hifi_ConnexionClient_h #ifndef hifi_3DConnexionClient_h
#define hifi_ConnexionClient_h #define hifi_3DConnexionClient_h
#include <qobject.h> #include <qobject.h>
#include <qlibrary.h> #include <qlibrary.h>
@ -18,7 +18,7 @@
#include "ui/UserInputMapper.h" #include "ui/UserInputMapper.h"
#ifndef HAVE_CONNEXIONCLIENT #ifndef HAVE_3DCONNEXIONCLIENT
class ConnexionClient : public QObject { class ConnexionClient : public QObject {
Q_OBJECT Q_OBJECT
public: public:
@ -29,9 +29,9 @@ public:
public slots: public slots:
void toggleConnexion(bool shouldEnable) {}; void toggleConnexion(bool shouldEnable) {};
}; };
#endif // NOT_HAVE_CONNEXIONCLIENT #endif // NOT_HAVE_3DCONNEXIONCLIENT
#ifdef HAVE_CONNEXIONCLIENT #ifdef HAVE_3DCONNEXIONCLIENT
// the windows connexion rawinput // the windows connexion rawinput
#ifdef _WIN32 #ifdef _WIN32
@ -90,13 +90,12 @@ public:
~ConnexionClient(); ~ConnexionClient();
static ConnexionClient& getInstance(); static ConnexionClient& getInstance();
ConnexionClient* client;
static void init(); static void init();
static void destroy(); static void destroy();
static bool Is3dmouseAttached(); static bool Is3dmouseAttached();
ConnexionClient* client;
I3dMouseParam& MouseParams(); I3dMouseParam& MouseParams();
const I3dMouseParam& MouseParams() const; const I3dMouseParam& MouseParams() const;
@ -166,16 +165,16 @@ class ConnexionClient : public QObject {
Q_OBJECT Q_OBJECT
public: public:
static ConnexionClient& getInstance(); static ConnexionClient& getInstance();
static bool Is3dmouseAttached();
static void init(); static void init();
static void destroy(); static void destroy();
static bool Is3dmouseAttached();
public slots: public slots:
void toggleConnexion(bool shouldEnable); void toggleConnexion(bool shouldEnable);
}; };
#endif // __APPLE__ #endif // __APPLE__
#endif // HAVE_CONNEXIONCLIENT #endif // HAVE_3DCONNEXIONCLIENT
// connnects to the userinputmapper // connnects to the userinputmapper
@ -241,4 +240,4 @@ protected:
AxisStateMap _axisStateMap; AxisStateMap _axisStateMap;
}; };
#endif // defined(hifi_ConnexionClient_h) #endif // defined(hifi_3DConnexionClient_h)