Open-Typer
Open source typewriting tutor program
Loading...
Searching...
No Matches
KeyboardUtils.h
1
/*
2
* KeyboardUtils.h
3
* This file is part of Open-Typer
4
*
5
* Copyright (C) 2021-2023 - adazem009
6
*
7
* Open-Typer is free software; you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation; either version 2 of the License, or
10
* (at your option) any later version.
11
*
12
* Open-Typer is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
16
*
17
* You should have received a copy of the GNU General Public License
18
* along with Open-Typer. If not, see <http://www.gnu.org/licenses/>.
19
*/
20
21
#ifndef KEYBOARDUTILS_H
22
#define KEYBOARDUTILS_H
23
24
#include <QObject>
25
#include <QKeyEvent>
26
#include "QmlKeyboardHandler.h"
27
#include "KeyEvent.h"
28
30
class
Q_DECL_EXPORT
KeyboardUtils
:
public
QObject
31
{
32
Q_OBJECT
33
public
:
34
enum
KeyType
35
{
36
KeyType_Any = 0,
37
KeyType_Tab = 1,
38
KeyType_CapsLock = 2,
39
KeyType_Return = 3,
40
KeyType_LShift = 4,
41
KeyType_RShift = 5,
42
KeyType_Ctrl = 6,
43
KeyType_LAlt = 7,
44
KeyType_RAlt = 8,
45
KeyType_Space = 9,
46
KeyType_Backspace = 10
47
};
48
Q_ENUM(KeyType)
49
50
Q_INVOKABLE
static
bool
isSpecialKey(
const
KeyEvent
&event);
51
Q_INVOKABLE
static
bool
isDeadKey(
int
key);
52
Q_INVOKABLE
static
QString deadKeyToString(Qt::Key key);
53
Q_INVOKABLE
static
QString deadKeyToReadableString(Qt::Key key);
54
Q_INVOKABLE
static
bool
isRShift(
int
nativeScanCode,
int
nativeVirtualKey);
55
Q_INVOKABLE
static
bool
isRControl(
int
nativeScanCode,
int
nativeVirtualKey);
56
57
Q_INVOKABLE
static
KeyEvent
createKeyEvent(Qt::Key key = Qt::Key_unknown, Qt::KeyboardModifiers modifiers = Qt::NoModifier, quint32 nativeScanCode = 0, quint32 nativeVirtualKey = 0,
const
QString &text = QString());
58
};
59
60
#endif
// KEYBOARDUTILS_H
KeyEvent
Definition
KeyEvent.h:29
KeyboardUtils
The KeyboardUtils class provides functions related to keyboard and input method.
Definition
KeyboardUtils.h:31
src
framework
keyboard
internal
KeyboardUtils.h
Generated by
1.9.8