#include <preferences.hpp>
|
Ui::Preferences * | ui |
|
std::map< QString, UINT > | temp |
|
◆ Preferences()
Preferences::Preferences |
( |
QWidget * | parent = nullptr | ) |
|
|
explicit |
◆ ~Preferences()
Preferences::~Preferences |
( |
| ) |
|
|
override |
◆ change_key_inputs()
void Preferences::change_key_inputs |
( |
| ) |
|
|
private |
This changes the keyboard maps and saves those changes in the config file. This function is executed if the user presses ok button.
◆ change_mouse_sensitivity()
void Preferences::change_mouse_sensitivity |
( |
int | value | ) |
|
|
private |
Changes the mouse sensitivity or the cursor speed
- Parameters
-
value | The amount of mouse sensitivity you want to set. |
◆ eventFilter()
bool Preferences::eventFilter |
( |
QObject * | sender, |
|
|
QEvent * | event ) |
|
overrideprotected |
The event filter virtual function is redefined to to filter for mouse and keyboard inputs when user tries to change the button-key maps. Checks which object is sending the event and type of event. If event is a keyboard or mouse button press then map and the object is button map then get the virtual key code of the key pressed and store the change in a temporary variable.
- Parameters
-
sender | To get the address of the object that is triggering the event. |
event | To capture the event that was triggered. |
- Returns
- [bool] True if event is handled else False.
◆ get_scan_code()
void Preferences::get_scan_code |
( |
WORD | vk, |
|
|
char * | a, |
|
|
int | size = 256 ) |
|
private |
Copies the name of the of corresponding key or virtual key code to the provided buffer.
- Parameters
-
vk | The virtual key code of the key you want to get. |
a | The buffer to store the name of the key. |
size | Size of the buffer(in char) in which the name is stored to ensure memory safety |
◆ install_event_filter()
void Preferences::install_event_filter |
( |
| ) |
|
|
private |
Install the above event filter on all the button maps to capture the key presses when they have the focus.
◆ keyPressEvent()
void Preferences::keyPressEvent |
( |
QKeyEvent * | e | ) |
|
|
overrideprotected |
Make the QWidget box ignore the enter key and escape key presses when the focus is on button map
- Parameters
-
e | Capture the key_press event |
◆ load_keys()
void Preferences::load_keys |
( |
| ) |
|
Displays the key to which each button is mapped to. Saves the initial key maps in variables that can be changed later if user wants to.
◆ temp
std::map<QString, UINT> Preferences::temp |
|
private |
◆ ui
Ui::Preferences* Preferences::ui |
|
private |
The documentation for this class was generated from the following files: