mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 14:55:36 +08:00
committed by
Roland Winklmeier
parent
14e9e01b90
commit
a131e8c91c
@@ -9,6 +9,10 @@ contains(BLACK_CONFIG, BlackSound) {
|
||||
SUBDIRS += src/blacksound
|
||||
}
|
||||
|
||||
contains(BLACK_CONFIG, BlackInput) {
|
||||
SUBDIRS += src/blackinput
|
||||
}
|
||||
|
||||
contains(BLACK_CONFIG, BlackSim) {
|
||||
SUBDIRS += src/blacksim
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ DEFINES += BLACK_VERSION=$$BLACK_VERSION
|
||||
BLACK_CONFIG += BlackCore
|
||||
BLACK_CONFIG += BlackGui
|
||||
BLACK_CONFIG += BlackSound
|
||||
BLACK_CONFIG += BlackInput
|
||||
BLACK_CONFIG += BlackSim
|
||||
BLACK_CONFIG += Samples
|
||||
BLACK_CONFIG += Unittests
|
||||
@@ -35,6 +36,7 @@ BLACK_CONFIG += FSX
|
||||
################################
|
||||
|
||||
contains(BLACK_CONFIG, BlackSound) { DEFINES += WITH_BLACKSOUND }
|
||||
contains(BLACK_CONFIG, BlackInput) { DEFINES += WITH_BLACKINPUT }
|
||||
contains(BLACK_CONFIG, BlackSim) { DEFINES += WITH_BLACKSIM }
|
||||
contains(BLACK_CONFIG, BlackCore) { DEFINES += WITH_BLACKCORE }
|
||||
contains(BLACK_CONFIG, BlackGui) { DEFINES += WITH_BLACKGUI }
|
||||
|
||||
@@ -20,6 +20,10 @@ blacksound {
|
||||
LIBS += -lblacksound
|
||||
}
|
||||
|
||||
blackinput {
|
||||
LIBS += -lblackinput
|
||||
}
|
||||
|
||||
blacksim {
|
||||
LIBS += -lblacksim
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ TEMPLATE = app
|
||||
|
||||
CONFIG += console
|
||||
CONFIG -= app_bundle
|
||||
CONFIG += blackmisc blacksound blackcore blacksim
|
||||
CONFIG += blackmisc blacksound blackinput blackcore blacksim
|
||||
|
||||
DEPENDPATH += . ../../src/blackmisc ../../src/blacksound ../../src/blackcore ../../src/blacksim
|
||||
INCLUDEPATH += . ../../src
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
#include "infowindow.h"
|
||||
#include "guimodeenums.h"
|
||||
#include "blackcore/keyboard.h"
|
||||
#include "blackinput/keyboard.h"
|
||||
#include "blackcore/context_audio.h"
|
||||
#include "blackcore/context_network.h"
|
||||
#include "blackcore/context_settings.h"
|
||||
@@ -132,7 +132,7 @@ private:
|
||||
QLabel *m_statusBarLabel; /*!< status bar label */
|
||||
|
||||
// Hotkeys
|
||||
BlackCore::IKeyboard *m_keyboard;
|
||||
BlackInput::IKeyboard *m_keyboard;
|
||||
|
||||
//! GUI status update
|
||||
void updateGuiStatusInformation();
|
||||
|
||||
@@ -320,7 +320,7 @@ void MainWindow::setHotkeys()
|
||||
Q_ASSERT(this->getIContextSettings());
|
||||
if (!this->m_keyboard)
|
||||
{
|
||||
this->m_keyboard = BlackCore::IKeyboard::getInstance();
|
||||
this->m_keyboard = BlackInput::IKeyboard::getInstance();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -10,7 +10,7 @@ TEMPLATE = app
|
||||
SOURCES += *.cpp
|
||||
HEADERS += *.h
|
||||
FORMS += *.ui
|
||||
CONFIG += blackmisc blacksound blackcore blackgui blacksim
|
||||
CONFIG += blackmisc blacksound blackinput blackcore blackgui blacksim
|
||||
|
||||
DEPENDPATH += . ../../src/blackmisc ../../src/blackgui ../../src/blacksound ../../src/blacksim ../../src/blackcore
|
||||
INCLUDEPATH += . ../../src
|
||||
|
||||
@@ -16,7 +16,7 @@ HotkeyDialog::HotkeyDialog(QWidget *parent) :
|
||||
m_lblHotkey(nullptr),
|
||||
m_led(nullptr)
|
||||
{
|
||||
m_keyboard = BlackCore::IKeyboard::getInstance();
|
||||
m_keyboard = BlackInput::IKeyboard::getInstance();
|
||||
|
||||
setupUi();
|
||||
setupConnections();
|
||||
@@ -87,7 +87,7 @@ void HotkeyDialog::setupUi()
|
||||
}
|
||||
void HotkeyDialog::setupConnections()
|
||||
{
|
||||
connect(m_keyboard, &BlackCore::IKeyboard::keySelectionChanged, this, &HotkeyDialog::keySelectionChanged);
|
||||
connect(m_keyboard, &BlackCore::IKeyboard::keySelectionFinished, this, &HotkeyDialog::keySelectionFinished);
|
||||
connect(m_keyboard, &BlackInput::IKeyboard::keySelectionChanged, this, &HotkeyDialog::keySelectionChanged);
|
||||
connect(m_keyboard, &BlackInput::IKeyboard::keySelectionFinished, this, &HotkeyDialog::keySelectionFinished);
|
||||
connect(m_pbSelect, &QPushButton::clicked, this, &HotkeyDialog::selectHotKey);
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#define BLACKSAMPLE_HOTKEY_H
|
||||
|
||||
#include "led.h"
|
||||
#include "blackcore/keyboard.h"
|
||||
#include "blackinput/keyboard.h"
|
||||
#include "blackmisc/hwkeyboardkey.h"
|
||||
|
||||
#include <QDialog>
|
||||
@@ -57,7 +57,7 @@ private:
|
||||
void setupUi();
|
||||
void setupConnections();
|
||||
|
||||
BlackCore::IKeyboard *m_keyboard;
|
||||
BlackInput::IKeyboard *m_keyboard;
|
||||
QPushButton *m_pbSelect;
|
||||
QLabel *m_lblHotkey;
|
||||
CLed *m_led;
|
||||
|
||||
@@ -9,7 +9,7 @@ TARGET = sample_hotkey
|
||||
TEMPLATE = app
|
||||
|
||||
CONFIG -= app_bundle
|
||||
CONFIG += blackmisc blackcore
|
||||
CONFIG += blackmisc blackinput blackcore
|
||||
|
||||
DEPENDPATH += . ../../src
|
||||
INCLUDEPATH += . ../../src
|
||||
|
||||
@@ -8,7 +8,7 @@ QT += network dbus xml multimedia
|
||||
TARGET = blackcore
|
||||
TEMPLATE = lib
|
||||
CONFIG += staticlib
|
||||
CONFIG += blackmisc blacksim
|
||||
CONFIG += blackmisc blackinput blacksim
|
||||
|
||||
INCLUDEPATH += ..
|
||||
DEPENDPATH += . ..
|
||||
@@ -25,21 +25,6 @@ DEFINES += LOG_IN_FILE
|
||||
HEADERS += *.h
|
||||
SOURCES += *.cpp
|
||||
|
||||
win32 {
|
||||
HEADERS += $$PWD/win/*.h
|
||||
SOURCES += $$PWD/win/*.cpp
|
||||
}
|
||||
|
||||
unix:!macx {
|
||||
HEADERS += $$PWD/linux/*.h
|
||||
SOURCES += $$PWD/linux/*.cpp
|
||||
}
|
||||
|
||||
macx {
|
||||
HEADERS += $$PWD/mac/*.h
|
||||
SOURCES += $$PWD/mac/*.cpp
|
||||
}
|
||||
|
||||
win32:!win32-g++*: PRE_TARGETDEPS += ../../lib/blackmisc.lib ../../lib/blacksound.lib ../../lib/blacksim.lib
|
||||
else: PRE_TARGETDEPS += ../../lib/libblackmisc.a ../../lib/libblacksound.a ../../lib/libblacksim.a
|
||||
|
||||
|
||||
@@ -34,8 +34,7 @@ namespace BlackCore
|
||||
m_voice->moveToThread(&m_threadVoice);
|
||||
m_threadVoice.start();
|
||||
|
||||
// 2. Hotkeys
|
||||
m_keyboard = IKeyboard::getInstance();
|
||||
m_keyboard = BlackInput::IKeyboard::getInstance();
|
||||
|
||||
// 3. own aircraft, if possible
|
||||
if (this->getIContextOwnAircraft()) m_voice->setMyAircraftCallsign(this->getIContextOwnAircraft()->getOwnAircraft().getCallsign());
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include "context_runtime.h"
|
||||
#include "dbus_server.h"
|
||||
#include "voice_vatlib.h"
|
||||
#include "blackcore/keyboard.h"
|
||||
#include "blackinput/keyboard.h"
|
||||
|
||||
#include <QThread>
|
||||
#include <QQueue>
|
||||
@@ -127,8 +127,8 @@ namespace BlackCore
|
||||
bool inTransitionState() const;
|
||||
|
||||
CVoiceVatlib *m_voice; //!< underlying voice lib
|
||||
IKeyboard *m_keyboard;
|
||||
IKeyboard::RegistrationHandle m_handlePtt;
|
||||
BlackInput::IKeyboard *m_keyboard;
|
||||
BlackInput::IKeyboard::RegistrationHandle m_handlePtt;
|
||||
QThread m_threadVoice;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
#include "blackcore/context.h"
|
||||
#include "blackcore/dbus_server.h"
|
||||
#include "blackcore/keyboard.h"
|
||||
#include "blackinput/keyboard.h"
|
||||
#include "blackmisc/hwkeyboardkeylist.h"
|
||||
#include "blackmisc/statusmessagelist.h"
|
||||
#include "blackmisc/settingutilities.h"
|
||||
|
||||
46
src/blackinput/blackinput.pro
Normal file
46
src/blackinput/blackinput.pro
Normal file
@@ -0,0 +1,46 @@
|
||||
include (../../config.pri)
|
||||
include (../../build.pri)
|
||||
|
||||
QT += network dbus gui multimedia
|
||||
|
||||
TARGET = blackinput
|
||||
TEMPLATE = lib
|
||||
CONFIG += staticlib
|
||||
CONFIG += blackmisc
|
||||
|
||||
INCLUDEPATH += ..
|
||||
DEPENDPATH += . ..
|
||||
|
||||
# PRECOMPILED_HEADER = stdpch.h
|
||||
precompile_header:!isEmpty(PRECOMPILED_HEADER) {
|
||||
DEFINES += USING_PCH
|
||||
}
|
||||
|
||||
DEFINES += LOG_IN_FILE
|
||||
|
||||
win32:!win32-g++*: PRE_TARGETDEPS += ../../lib/blackmisc.lib
|
||||
else: PRE_TARGETDEPS += ../../lib/libblackmisc.a
|
||||
|
||||
HEADERS += *.h
|
||||
SOURCES += *.cpp
|
||||
|
||||
win32 {
|
||||
HEADERS += $$PWD/win/*.h
|
||||
SOURCES += $$PWD/win/*.cpp
|
||||
}
|
||||
|
||||
unix:!macx {
|
||||
HEADERS += $$PWD/linux/*.h
|
||||
SOURCES += $$PWD/linux/*.cpp
|
||||
}
|
||||
|
||||
macx {
|
||||
HEADERS += $$PWD/osx/*.h
|
||||
SOURCES += $$PWD/osx/*.cpp
|
||||
}
|
||||
|
||||
DESTDIR = ../../lib
|
||||
OTHER_FILES +=
|
||||
RESOURCES +=
|
||||
|
||||
include (../../libraries.pri)
|
||||
@@ -6,16 +6,16 @@
|
||||
#include "keyboard.h"
|
||||
|
||||
#if defined(Q_OS_WIN)
|
||||
#include "blackcore/win/keyboard_windows.h"
|
||||
#include "win/keyboard_windows.h"
|
||||
#elif defined(Q_OS_LINUX)
|
||||
#include "blackcore/linux/keyboard_linux.h"
|
||||
#include "linux/keyboard_linux.h"
|
||||
#elif defined(Q_OS_OSX)
|
||||
#include "blackcore/mac/keyboard_mac.h"
|
||||
#include "osx/keyboard_mac.h"
|
||||
#else
|
||||
#error "Platform is not supported!"
|
||||
#endif
|
||||
|
||||
namespace BlackCore
|
||||
namespace BlackInput
|
||||
{
|
||||
IKeyboard *IKeyboard::m_instance = nullptr;
|
||||
|
||||
@@ -49,4 +49,4 @@ namespace BlackCore
|
||||
return false;
|
||||
}
|
||||
|
||||
} // BlackCore
|
||||
} // BlackInput
|
||||
@@ -7,8 +7,8 @@
|
||||
\file
|
||||
*/
|
||||
|
||||
#ifndef BLACKCORE_KEYBOARD_H
|
||||
#define BLACKCORE_KEYBOARD_H
|
||||
#ifndef BLACKINPUT_KEYBOARD_H
|
||||
#define BLACKINPUT_KEYBOARD_H
|
||||
|
||||
#include "../blackmisc/hwkeyboardkey.h"
|
||||
#include <QMultiMap>
|
||||
@@ -16,7 +16,7 @@
|
||||
#include <QPointer>
|
||||
#include <functional>
|
||||
|
||||
namespace BlackCore
|
||||
namespace BlackInput
|
||||
{
|
||||
/*!
|
||||
* \brief Abstract interface for native keyboard handling.
|
||||
@@ -181,4 +181,4 @@ namespace BlackCore
|
||||
bool operator==(IKeyboard::RegistrationHandle const &lhs, IKeyboard::RegistrationHandle const &rhs);
|
||||
}
|
||||
|
||||
#endif // BLACKCORE_KEYBOARD_H
|
||||
#endif // BLACKINPUT_KEYBOARD_H
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
using namespace BlackMisc::Hardware;
|
||||
|
||||
namespace BlackCore
|
||||
namespace BlackInput
|
||||
{
|
||||
CKeyboardLinux::CKeyboardLinux(QObject *parent) :
|
||||
IKeyboard(parent),
|
||||
@@ -7,14 +7,14 @@
|
||||
\file
|
||||
*/
|
||||
|
||||
#ifndef BLACKCORE_KEYBOARD_LINUX_H
|
||||
#define BLACKCORE_KEYBOARD_LINUX_H
|
||||
#ifndef BLACKINPUT_KEYBOARD_LINUX_H
|
||||
#define BLACKINPUT_KEYBOARD_LINUX_H
|
||||
|
||||
#include "blackcore/keyboard.h"
|
||||
#include "blackinput/keyboard.h"
|
||||
#include "blackmisc/hwkeyboardkey.h"
|
||||
#include <QHash>
|
||||
|
||||
namespace BlackCore
|
||||
namespace BlackInput
|
||||
{
|
||||
//! \brief Linux implemenation of IKeyboard using hook procedure
|
||||
//! \todo Change QHash to a CCollection object
|
||||
@@ -84,4 +84,4 @@ namespace BlackCore
|
||||
};
|
||||
}
|
||||
|
||||
#endif // BLACKCORE_KEYBOARD_LINUX_H
|
||||
#endif // BLACKINPUT_KEYBOARD_LINUX_H
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
using namespace BlackMisc::Hardware;
|
||||
|
||||
namespace BlackCore
|
||||
namespace BlackInput
|
||||
{
|
||||
CKeyboardMac::CKeyboardMac(QObject *parent) :
|
||||
IKeyboard(parent),
|
||||
@@ -7,14 +7,14 @@
|
||||
\file
|
||||
*/
|
||||
|
||||
#ifndef BLACKCORE_KEYBOARD_MAC_H
|
||||
#define BLACKCORE_KEYBOARD_MAC_H
|
||||
#ifndef BLACKINPUT_KEYBOARD_MAC_H
|
||||
#define BLACKINPUT_KEYBOARD_MAC_H
|
||||
|
||||
#include "blackcore/keyboard.h"
|
||||
#include "blackinput/keyboard.h"
|
||||
#include "blackmisc/hwkeyboardkey.h"
|
||||
#include <QHash>
|
||||
|
||||
namespace BlackCore
|
||||
namespace BlackInput
|
||||
{
|
||||
//! \brief Linux implemenation of IKeyboard using hook procedure
|
||||
//! \todo Change QHash to a CCollection object
|
||||
@@ -84,4 +84,4 @@ namespace BlackCore
|
||||
};
|
||||
}
|
||||
|
||||
#endif // BLACKCORE_KEYBOARD_MAC_H
|
||||
#endif // BLACKINPUT_KEYBOARD_MAC_H
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
using namespace BlackMisc::Hardware;
|
||||
|
||||
namespace BlackCore
|
||||
namespace BlackInput
|
||||
{
|
||||
CKeyboardWindows::CKeyboardWindows(QObject *parent) :
|
||||
IKeyboard(parent),
|
||||
@@ -7,10 +7,10 @@
|
||||
\file
|
||||
*/
|
||||
|
||||
#ifndef BLACKCORE_KEYBOARD_WINDOWS_H
|
||||
#define BLACKCORE_KEYBOARD_WINDOWS_H
|
||||
#ifndef BLACKINPUT_KEYBOARD_WINDOWS_H
|
||||
#define BLACKINPUT_KEYBOARD_WINDOWS_H
|
||||
|
||||
#include "blackcore/keyboard.h"
|
||||
#include "blackinput/keyboard.h"
|
||||
#include "blackmisc/hwkeyboardkey.h"
|
||||
#include <QHash>
|
||||
#ifndef NOMINMAX
|
||||
@@ -18,7 +18,7 @@
|
||||
#endif
|
||||
#include <windows.h>
|
||||
|
||||
namespace BlackCore
|
||||
namespace BlackInput
|
||||
{
|
||||
//! \brief Windows implemenation of IKeyboard using hook procedure
|
||||
//! \todo Change QHash to a CCollection object
|
||||
@@ -107,4 +107,4 @@ namespace BlackCore
|
||||
};
|
||||
}
|
||||
|
||||
#endif // BLACKCORE_KEYBOARD_WINDOWS_H
|
||||
#endif // BLACKINPUT_KEYBOARD_WINDOWS_H
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
using namespace BlackMisc::Hardware;
|
||||
|
||||
namespace BlackCore
|
||||
namespace BlackInput
|
||||
{
|
||||
Qt::Key CKeyMappingWindows::convertToKey(WPARAM virtualKey)
|
||||
{
|
||||
@@ -4,8 +4,8 @@
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
|
||||
#ifndef BLACKCORE_KEYMAPPING_WINDOWS_H
|
||||
#define BLACKCORE_KEYMAPPING_WINDOWS_H
|
||||
#ifndef BLACKINPUT_KEYMAPPING_WINDOWS_H
|
||||
#define BLACKINPUT_KEYMAPPING_WINDOWS_H
|
||||
|
||||
#include "blackmisc/hwkeyboardkey.h"
|
||||
#ifndef NOMINMAX
|
||||
@@ -13,7 +13,7 @@
|
||||
#endif
|
||||
#include <windows.h>
|
||||
|
||||
namespace BlackCore
|
||||
namespace BlackInput
|
||||
{
|
||||
//! \brief This class provides methods to map between windows virtual keys and CKeyboardKey
|
||||
class CKeyMappingWindows
|
||||
@@ -41,5 +41,5 @@ namespace BlackCore
|
||||
static bool isModifier(WPARAM vkcode);
|
||||
};
|
||||
|
||||
} // namespace BlackCore
|
||||
} // namespace BlackInput
|
||||
#endif // guard
|
||||
Reference in New Issue
Block a user