AntiMicroX
Loading...
Searching...
No Matches
simplekeygrabberbutton.h
Go to the documentation of this file.
1/* antimicrox Gamepad to KB+M event mapper
2 * Copyright (C) 2015 Travis Nickles <nickles.travis@gmail.com>
3 * Copyright (C) 2020 Jagoda Górska <juliagoda.pl@protonmail>
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#ifndef SIMPLEKEYGRABBERBUTTON_H
20#define SIMPLEKEYGRABBERBUTTON_H
21
22#include "joybuttonslot.h"
23
24#include <QPushButton>
25
26class QKeyEvent;
27class QEvent;
28class QWidget;
29
32class SimpleKeyGrabberButton : public QPushButton
33{
35
36 public:
37 explicit SimpleKeyGrabberButton(QWidget *parent = nullptr);
38
39 void setValue(int value, int alias,
49 bool isEdited();
50 bool isGrabbing();
51
52 protected:
53 virtual void keyPressEvent(QKeyEvent *event);
54 virtual bool eventFilter(QObject *obj, QEvent *event);
55
56 signals:
57 void buttonCodeChanged(int value);
58
59 public slots:
60 void refreshButtonLabel();
61
62 private:
65 bool edited;
67};
68
70
71#endif // SIMPLEKEYGRABBERBUTTON_H
Represents action which can be performed after pressing button.
Definition joybuttonslot.h:38
JoySlotInputAction
Definition joybuttonslot.h:43
@ JoyMix
Definition joybuttonslot.h:59
@ JoyKeyboard
Definition joybuttonslot.h:44
@ JoyLoadProfile
Definition joybuttonslot.h:55
Definition joydpadxml.h:27
Button widget used for detecting pressed buttons it is used mainly in advanced button mapping window ...
Definition simplekeygrabberbutton.h:33
JoyButtonSlot * getValue()
Definition simplekeygrabberbutton.cpp:311
void setValue(int value, int alias, JoyButtonSlot::JoySlotInputAction mode=JoyButtonSlot::JoyKeyboard)
Definition simplekeygrabberbutton.cpp:231
void buttonCodeChanged(int value)
virtual void keyPressEvent(QKeyEvent *event)
Definition simplekeygrabberbutton.cpp:47
void refreshButtonLabel()
Definition simplekeygrabberbutton.cpp:317
JoyButtonSlot & getValueNonPointer()
Definition simplekeygrabberbutton.cpp:313
void setValues(QString value, JoyButtonSlot::JoySlotInputAction mode=JoyButtonSlot::JoyMix)
Definition simplekeygrabberbutton.cpp:272
bool grabNextAction
Definition simplekeygrabberbutton.h:63
bool grabbingWheel
Definition simplekeygrabberbutton.h:64
bool isGrabbing()
Definition simplekeygrabberbutton.cpp:325
JoyButtonSlot buttonslot
Definition simplekeygrabberbutton.h:66
virtual bool eventFilter(QObject *obj, QEvent *event)
Definition simplekeygrabberbutton.cpp:55
bool edited
Definition simplekeygrabberbutton.h:65
bool isEdited()
Definition simplekeygrabberbutton.cpp:323