swift
Loading...
Searching...
No Matches
src
input
win
keyboardwindows.h
Go to the documentation of this file.
1
// SPDX-FileCopyrightText: Copyright (C) 2013 swift Project Community / Contributors
2
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3
5
6
#ifndef SWIFT_INPUT_KEYBOARD_WINDOWS_H
7
#define SWIFT_INPUT_KEYBOARD_WINDOWS_H
8
9
#include <QHash>
10
#include <QTimer>
11
12
#include "
input/keyboard.h
"
13
#include "
input/swiftinputexport.h
"
14
#include "
misc/input/keyboardkey.h
"
15
#include "
misc/input/keyboardkeylist.h
"
16
#ifndef NOMINMAX
17
# define NOMINMAX
18
#endif
19
#include <Windows.h>
20
21
namespace
swift::input
22
{
24
class
SWIFT_INPUT_EXPORT
CKeyboardWindows
:
public
IKeyboard
25
{
26
Q_OBJECT
27
28
public
:
30
CKeyboardWindows
(
CKeyboardWindows
const
&) =
delete
;
31
33
CKeyboardWindows
&
operator=
(
CKeyboardWindows
const
&) =
delete
;
34
36
virtual
~CKeyboardWindows
()
override
;
37
38
protected
:
40
virtual
bool
init
()
override
;
41
42
private
:
43
friend
class
IKeyboard;
44
46
CKeyboardWindows
(
QObject
*
parent
=
nullptr
);
47
48
void
addKey(WPARAM vkcode);
49
void
removeKey(WPARAM vkcode);
50
void
processKeyEvent(
DWORD
vkCode, WPARAM
event
);
51
void
pollKeyboardState();
52
53
const
bool
useWindowsHook =
false
;
54
56
static
LRESULT CALLBACK keyboardProc(
int
nCode, WPARAM wParam, LPARAM lParam);
57
58
swift::misc::input::CHotkeyCombination
m_keyCombination;
59
HHOOK m_keyboardHook;
60
QTimer
m_pollTimer;
61
QVector<int>
m_pressedKeys;
62
};
63
}
// namespace swift::input
64
65
#endif
// SWIFT_INPUT_KEYBOARD_WINDOWS_H
swift::input::CKeyboardWindows::init
virtual bool init()
Initializes the platform keyboard device.
Definition
keyboardwindows.cpp:141
swift::input::CKeyboardWindows::CKeyboardWindows
CKeyboardWindows(CKeyboardWindows const &)=delete
Copy Constructor.
swift::input::CKeyboardWindows::operator=
CKeyboardWindows & operator=(CKeyboardWindows const &)=delete
Assignment operator.
swift::misc::input::CHotkeyCombination
Value object representing hotkey sequence.
Definition
hotkeycombination.h:26
keyboard.h
keyboardkey.h
keyboardkeylist.h
QObject::QObject
QObject(QObject *parent)
QObject::Q_OBJECT
Q_OBJECTQ_OBJECT
QObject::event
virtual bool event(QEvent *e)
QObject::parent
QObject * parent() const const
QTimer
QVector
DWORD
unsigned long DWORD
Fake Windows DWORD.
Definition
simconnectutilities.h:28
swiftinputexport.h
SWIFT_INPUT_EXPORT
#define SWIFT_INPUT_EXPORT
Export a class or function from the library.
Definition
swiftinputexport.h:20
Generated on
for swift by
1.15.0