6 #ifndef SWIFT_CORE_INPUTMANAGER_H
7 #define SWIFT_CORE_INPUTMANAGER_H
16 #include <QStringList>
40 void registerAction(
const QString &action,
44 void registerRemoteActions(
const QStringList &actions);
48 template <
typename RecvObj>
49 int bind(
const QString &action, RecvObj *receiver,
void (RecvObj::*slotPointer)(
bool))
51 using namespace std::placeholders;
52 auto function = std::bind(slotPointer, receiver, _1);
53 return bindImpl(action, receiver,
function);
57 template <
typename Func>
58 int bind(
const QString &action, QObject *receiver, Func functionObject)
60 return bindImpl(action, receiver, functionObject);
64 void unbind(
int index);
84 void callFunctionsBy(
const QString &action,
bool isKeyDown,
bool shouldEmit =
true);
93 void releaseDevices();
118 QPointer<QObject> m_receiver;
119 std::function<void(
bool)> m_function;
123 void reloadHotkeySettings();
129 int bindImpl(
const QString &action, QObject *receiver, std::function<
void(
bool)>
function);
134 std::unique_ptr<swift::input::IKeyboard> m_keyboard;
135 std::unique_ptr<swift::input::IJoystick> m_joystick;
139 QSet<QString> m_activeActions;
140 QVector<BindInfo> m_boundActions;
142 bool m_actionRelayingEnabled =
false;
143 bool m_captureActive =
false;
149 &CInputManager::reloadHotkeySettings };
IconIndex
Index for each icon, allows to send them via DBus, efficiently store them, etc.
Class template for accessing a specific value in the CSettingsCache.
Backend services of the swift project, like dealing with the network or the simulators.
#define SWIFT_CORE_EXPORT
Export a class or function from the library.