swift
src
input
keyboard.cpp
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
4
#include "
keyboard.h
"
5
6
#if defined(Q_OS_WIN)
7
# include "
win/keyboardwindows.h
"
8
#elif defined(Q_OS_LINUX)
9
# include "
linux/keyboardlinux.h
"
10
#elif defined(Q_OS_MACOS)
11
# include "
macos/keyboardmacos.h
"
12
#else
13
# error "Platform is not supported!"
14
#endif
15
16
namespace
swift::input
17
{
18
IKeyboard::IKeyboard
(QObject *parent) : QObject(parent) {}
19
20
std::unique_ptr<IKeyboard>
IKeyboard::create
(QObject *parent)
21
{
22
#if defined(Q_OS_WIN)
23
std::unique_ptr<IKeyboard> ptr(
new
CKeyboardWindows
(parent));
24
#elif defined(Q_OS_LINUX)
25
std::unique_ptr<IKeyboard> ptr(
new
CKeyboardLinux
(parent));
26
#elif defined(Q_OS_MACOS)
27
std::unique_ptr<IKeyboard> ptr(
new
CKeyboardMacOS
(parent));
28
#endif
29
ptr->init();
30
return
ptr;
31
}
32
}
// namespace swift::input
swift::input::CKeyboardLinux
Linux implemenation of IKeyboard using hook procedure.
Definition:
keyboardlinux.h:24
swift::input::CKeyboardMacOS
MacOS implemenation of IKeyboard using hook procedure.
Definition:
keyboardmacos.h:22
swift::input::CKeyboardWindows
Windows implemenation of IKeyboard using hook procedure.
Definition:
keyboardwindows.h:25
swift::input::IKeyboard::IKeyboard
IKeyboard(QObject *parent=nullptr)
Constructor.
Definition:
keyboard.cpp:18
swift::input::IKeyboard::create
static std::unique_ptr< IKeyboard > create(QObject *parent=nullptr)
Creates a native keyboard handler object.
Definition:
keyboard.cpp:20
keyboard.h
keyboardlinux.h
keyboardmacos.h
keyboardwindows.h
Generated on Mon Mar 24 2025 16:42:21 for swift by
1.9.1