AntiMicroX
Loading...
Searching...
No Matches
src
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
26
class
QKeyEvent
;
27
class
QEvent
;
28
class
QWidget;
29
32
class
SimpleKeyGrabberButton
:
public
QPushButton
33
{
34
Q_OBJECT
35
36
public
:
37
explicit
SimpleKeyGrabberButton
(QWidget *
parent
=
nullptr
);
38
39
void
setValue
(
int
value,
int
alias,
40
JoyButtonSlot::JoySlotInputAction
mode =
JoyButtonSlot::JoyKeyboard
);
// (.., unsigned)
41
void
setValue
(
int
value,
JoyButtonSlot::JoySlotInputAction
mode =
JoyButtonSlot::JoyKeyboard
);
42
void
setValue
(
QString
value,
JoyButtonSlot::JoySlotInputAction
mode =
JoyButtonSlot::JoyLoadProfile
);
43
void
setValues
(
QString
value,
JoyButtonSlot::JoySlotInputAction
mode =
JoyButtonSlot::JoyMix
);
44
void
setValues
(
QString
value,
QList<JoyButtonSlot *>
*
jbtn
,
45
JoyButtonSlot::JoySlotInputAction
mode =
JoyButtonSlot::JoyMix
);
46
JoyButtonSlot
*
getValue
();
47
JoyButtonSlot
&
getValueNonPointer
();
48
void
setValue
(
JoyButtonSlot
*
jbS
);
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
:
63
bool
grabNextAction
;
64
bool
grabbingWheel
;
65
bool
edited
;
66
JoyButtonSlot
buttonslot
;
67
};
68
69
Q_DECLARE_METATYPE
(
SimpleKeyGrabberButton
*)
70
71
#endif
// SIMPLEKEYGRABBERBUTTON_H
JoyButtonSlot
Represents action which can be performed after pressing button.
Definition
joybuttonslot.h:38
JoyButtonSlot::JoySlotInputAction
JoySlotInputAction
Definition
joybuttonslot.h:43
JoyButtonSlot::JoyMix
@ JoyMix
Definition
joybuttonslot.h:59
JoyButtonSlot::JoyKeyboard
@ JoyKeyboard
Definition
joybuttonslot.h:44
JoyButtonSlot::JoyLoadProfile
@ JoyLoadProfile
Definition
joybuttonslot.h:55
JoyDPadXml
Definition
joydpadxml.h:27
SimpleKeyGrabberButton
Button widget used for detecting pressed buttons it is used mainly in advanced button mapping window ...
Definition
simplekeygrabberbutton.h:33
SimpleKeyGrabberButton::getValue
JoyButtonSlot * getValue()
Definition
simplekeygrabberbutton.cpp:311
SimpleKeyGrabberButton::setValue
void setValue(int value, int alias, JoyButtonSlot::JoySlotInputAction mode=JoyButtonSlot::JoyKeyboard)
Definition
simplekeygrabberbutton.cpp:231
SimpleKeyGrabberButton::buttonCodeChanged
void buttonCodeChanged(int value)
SimpleKeyGrabberButton::keyPressEvent
virtual void keyPressEvent(QKeyEvent *event)
Definition
simplekeygrabberbutton.cpp:47
SimpleKeyGrabberButton::refreshButtonLabel
void refreshButtonLabel()
Definition
simplekeygrabberbutton.cpp:317
SimpleKeyGrabberButton::getValueNonPointer
JoyButtonSlot & getValueNonPointer()
Definition
simplekeygrabberbutton.cpp:313
SimpleKeyGrabberButton::setValues
void setValues(QString value, JoyButtonSlot::JoySlotInputAction mode=JoyButtonSlot::JoyMix)
Definition
simplekeygrabberbutton.cpp:272
SimpleKeyGrabberButton::grabNextAction
bool grabNextAction
Definition
simplekeygrabberbutton.h:63
SimpleKeyGrabberButton::grabbingWheel
bool grabbingWheel
Definition
simplekeygrabberbutton.h:64
SimpleKeyGrabberButton::isGrabbing
bool isGrabbing()
Definition
simplekeygrabberbutton.cpp:325
SimpleKeyGrabberButton::buttonslot
JoyButtonSlot buttonslot
Definition
simplekeygrabberbutton.h:66
SimpleKeyGrabberButton::eventFilter
virtual bool eventFilter(QObject *obj, QEvent *event)
Definition
simplekeygrabberbutton.cpp:55
SimpleKeyGrabberButton::edited
bool edited
Definition
simplekeygrabberbutton.h:65
SimpleKeyGrabberButton::isEdited
bool isEdited()
Definition
simplekeygrabberbutton.cpp:323
joybuttonslot.h
Generated by
1.9.8