#include <QDir>
#include <QSettings>
#include <minwindef.h>
|
enum | setting_keys::server_keys { setting_keys::Port
} |
|
enum | setting_keys::keys {
setting_keys::A
, setting_keys::B
, setting_keys::X
, setting_keys::Y
,
setting_keys::RSHDR
, setting_keys::LSHDR
, setting_keys::DPADDOWN
, setting_keys::DPADUP
,
setting_keys::DPADRIGHT
, setting_keys::DPADLEFT
, setting_keys::VIEW
, setting_keys::MENU
} |
|
◆ is_mouse_button()
uint is_mouse_button |
( |
UINT | vk | ) |
|
Function to find out if the user mapped a keyboard key or mouse button
- Parameters
-
vk | Virtual key code of the key or mouse button pressed |
- Returns
- 1 if its a mouse button else 0
◆ load_all_settings()
void load_all_settings |
( |
| ) |
|
Run the functions using the function array to load all the necessary settings.
◆ load_key_maps()
Load the key maps from the settings file.
◆ load_mouse_setting()
void load_mouse_setting |
( |
| ) |
|
Loads and sets the mouse sensitivity.
◆ load_port_number()
void load_port_number |
( |
| ) |
|
Load and set the port number
◆ load_setting()
QVariant load_setting |
( |
const QString & | key | ) |
|
Get the value of a setting.
- Parameters
-
key | The fullname including the groups of the setting in string format |
- Returns
- The setting as QVariant can be converted into almost all data types.
◆ load_settings_file()
void load_settings_file |
( |
QObject * | parent = nullptr | ) |
|
Loads the settings file for the current application.
- Parameters
-
parent | The parent object either a widget or Qt Application e.t.c |
◆ save_setting()
void save_setting |
( |
const QString & | key, |
|
|
const QVariant & | value ) |
Save a setting to the settings file
- Parameters
-
key | The name of the setting in string format if you want to group settings seperate the head group using </> |
value | The value of the settings can be of any data type string, int, char, float, e.t.c. |
◆ set_mouse_sensitivity()
void set_mouse_sensitivity |
( |
| ) |
|
◆ keymaps
Initial value:= {
@ A
Definition settings.hpp:21
@ DPADRIGHT
Definition settings.hpp:29
@ DPADUP
Definition settings.hpp:28
@ VIEW
Definition settings.hpp:31
@ X
Definition settings.hpp:23
@ MENU
Definition settings.hpp:32
@ DPADLEFT
Definition settings.hpp:30
@ DPADDOWN
Definition settings.hpp:27
@ Y
Definition settings.hpp:24
@ RSHDR
Definition settings.hpp:25
@ LSHDR
Definition settings.hpp:26
@ B
Definition settings.hpp:22
A Qmap to map the keys in namespace to corresponding settings name in string format.
◆ server_settings
QList<QString> server_settings = {"port"} |
|
inline |
◆ settings
◆ SETTINGS_FILE
const QString SETTINGS_FILE |
|
extern |