mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-16 02:06:08 +08:00
refs #510 Remove underscores from all the source file names
This commit is contained in:
76
src/blackinput/win/keyboardwindows.h
Normal file
76
src/blackinput/win/keyboardwindows.h
Normal file
@@ -0,0 +1,76 @@
|
||||
/* Copyright (C) 2013 VATSIM Community / contributors
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
/*!
|
||||
\file
|
||||
*/
|
||||
|
||||
#ifndef BLACKINPUT_KEYBOARD_WINDOWS_H
|
||||
#define BLACKINPUT_KEYBOARD_WINDOWS_H
|
||||
|
||||
#include "blackinput/blackinputexport.h"
|
||||
#include "blackinput/keyboard.h"
|
||||
#include "blackmisc/input/keyboardkey.h"
|
||||
#include "blackmisc/input/keyboardkeylist.h"
|
||||
#include <QHash>
|
||||
#ifndef NOMINMAX
|
||||
#define NOMINMAX
|
||||
#endif
|
||||
#include <windows.h>
|
||||
|
||||
namespace BlackInput
|
||||
{
|
||||
//! \brief Windows implemenation of IKeyboard using hook procedure
|
||||
class BLACKINPUT_EXPORT CKeyboardWindows : public IKeyboard
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
||||
//! \brief Copy Constructor
|
||||
CKeyboardWindows(CKeyboardWindows const&) = delete;
|
||||
|
||||
//! \brief Assignment operator
|
||||
CKeyboardWindows &operator=(CKeyboardWindows const&) = delete;
|
||||
|
||||
//! \brief Destructor
|
||||
virtual ~CKeyboardWindows();
|
||||
|
||||
//! \brief Keyboard hook handle
|
||||
HHOOK keyboardHook() const { return m_keyboardHook; }
|
||||
|
||||
//! \private
|
||||
void processKeyEvent(WPARAM vkCode, uint event);
|
||||
|
||||
protected:
|
||||
|
||||
//! \copydoc IKeyboard::init()
|
||||
virtual bool init() override;
|
||||
|
||||
private:
|
||||
|
||||
friend class IKeyboard;
|
||||
|
||||
//! \brief Constructor
|
||||
CKeyboardWindows(QObject *parent = nullptr);
|
||||
|
||||
void addKey(WPARAM vkcode);
|
||||
void removeKey(WPARAM vkcode);
|
||||
|
||||
/*!
|
||||
* \brief Keyboard hook procedure
|
||||
* \param nCode
|
||||
* \param wParam
|
||||
* \param lParam
|
||||
* \return
|
||||
*/
|
||||
static LRESULT CALLBACK keyboardProc(int nCode, WPARAM wParam, LPARAM lParam);
|
||||
|
||||
|
||||
BlackMisc::Input::CHotkeyCombination m_keyCombination; //!< Set of virtual keys pressed in the last cycle
|
||||
HHOOK m_keyboardHook; //!< Keyboard hook handle
|
||||
};
|
||||
}
|
||||
|
||||
#endif // BLACKINPUT_KEYBOARD_WINDOWS_H
|
||||
Reference in New Issue
Block a user