Update Help text, default config, and clang

This commit is contained in:
kalaposfos13 2024-11-16 14:25:14 +01:00
parent 3466de0dc0
commit 3261674819
4 changed files with 42 additions and 79 deletions

View File

@ -702,82 +702,45 @@ void setDefaultValues() {
}
constexpr std::string_view GetDefaultKeyboardConfig() {
return R"(#This is the default keybinding config
#To change per-game configs, modify the CUSAXXXXX.ini files
#To change the default config that applies to new games without modifying already existing configs, modify default.ini
#If you don't like certain mappings, delete, change or comment them out.
#You can add any amount of KBM keybinds to a single controller input,
#but you can use each KBM keybind for one controller input.
#Every input consists of up to 3 different keys.
return R"(#Feeling lost? Check out the Help section!
#Keybinds used by the emulator (these are unchangeable):
#F12 : Trigger Renderdoc capture
#F11 : Fullscreen
#F10 : FPS counter
#Ctrl + F10 : Debug overlay
#F9 : Pause emulator, but only if the debug overlay is active
#F8 : reparse keyboard input(this)
#F7 : toggle mouse-to-joystick input
# (it overwrites everything else to that joystick, so this is required)
triangle = f
circle = space
cross = e
square = r
#This is a mapping for Bloodborne, inspired by other Souls titles on PC.
up = w, lalt
up = mousewheelup
down = s, lalt
down = mousewheeldown
left = a, lalt
left = mousewheelleft
right = d, lalt
right = mousewheelright
#Specifies which joystick the mouse movement controls.
mouse_to_joystick = right;
l1 = rightbutton, lshift
r1 = leftbutton
l2 = rightbutton
r2 = leftbutton, lshift
l3 = x
r3 = q
r3 = middlebutton
#Use healing item, change status in inventory
triangle = f;
#Dodge, back in inventory
circle = space;
#Interact, select item in inventory
cross = e;
#Use quick item, remove item in inventory
square = r;
key_toggle = i, lalt
#Emergency extra bullets
up = w, lalt;
up = mousewheelup;
#Change quick item
down = s, lalt;
down = mousewheeldown;
#Change weapon in left hand
left = a, lalt;
left = mousewheelleft;
#Change weapon in right hand
right = d, lalt;
right = mousewheelright;
#Change into 'inventory mode', so you don't have to hold the secondary key every time you go into menus
key_toggle = i, lalt;
options = escape
touchpad = g
#Menu
options = escape;
#Gestures
touchpad = g;
#Transform
l1 = rightbutton, lshift;
#Light attack
r1 = leftbutton;
#Shoot
l2 = rightbutton;
#Heavy attack
r2 = leftbutton, lshift;
#Does nothing
l3 = x;
#Center cam, lock on
r3 = q;
r3 = middlebutton;
mouse_to_joystick = right
mouse_movement_params = 1, 0.5, 0.125
#Axis mappings
#Move
#Change to 'walk mode' by holding the following key:
#(halves the distance the inputs push the virtual joystick to a given direction)
leftjoystick_halfmode = lctrl;
axis_left_x_minus = a;
axis_left_x_plus = d;
axis_left_y_minus = w;
axis_left_y_plus = s;
leftjoystick_halfmode = lctrl
axis_left_x_minus = a
axis_left_x_plus = d
axis_left_y_minus = w
axis_left_y_plus = s
)";
}
std::filesystem::path GetFoolproofKbmConfigFile(const std::string& game_id) {

View File

@ -338,7 +338,7 @@ void ControllerOutput::AddUpdate(bool pressed, u32 param) {
}
}
void ControllerOutput::FinalizeUpdate() {
if(!state_changed || (old_button_state == new_button_state && old_param == new_param)) {
if (!state_changed || (old_button_state == new_button_state && old_param == new_param)) {
return;
}
old_button_state = new_button_state;
@ -455,7 +455,7 @@ bool IsInputActive(const InputBinding& i) {
for (bool* flag : flags_to_set) {
is_fully_blocked &= *flag;
}
if(is_fully_blocked) {
if (is_fully_blocked) {
return false;
}
for (bool* flag : flags_to_set) {

View File

@ -48,7 +48,7 @@ This project started out because I didn't like the original unchangeable keybind
QString faq() {
return
R"(Q: What are the emulator-wide keybinds?
A: -F12: Triggers Rdoc capture
A: -F12: Triggers Renderdoc capture
-F11: Toggles fullscreen
-F10: Toggles FPS counter
-Ctrl F10: Open the debug menu
@ -57,7 +57,7 @@ A: -F12: Triggers Rdoc capture
-F7: Toggles mouse capture and mouse input
Q: How do I change between mouse and controller joystick input, and why is it even required?
A: You can switch between them with F9, and it is required, because mouse input is done with polling, which means mouse movement is checked every frame, and if it didn't move, the code manually sets the emulator's virtual controller to 0 (back to the center), even if other input devices would update it.
A: You can switch between them with F7, and it is required, because mouse input is done with polling, which means mouse movement is checked every frame, and if it didn't move, the code manually sets the emulator's virtual controller to 0 (back to the center), even if other input devices would update it.
Q: What happens if I accidentally make a typo in the config?
A: The code recognises the line as wrong, and skip it, so the rest of the file will get parsed, but that line in question will be treated like a comment line.
@ -69,7 +69,7 @@ A: Some keys are intentionally omitted, but if you read the bindings through, an
QString syntax() {
return
R"(This is the full list of currently supported mouse and keyboard inputs, and how to use them.
Emulator-reserved keys: F1 through F12, Insert, PrintScreen, Delete, Home, End, PgUp, PgDown
Emulator-reserved keys: F1 through F12
Syntax (aka how a line can look like):
#Comment line
@ -87,7 +87,7 @@ axis_left_y_minus = w;
You can make a comment line by putting # as the first character.
Whitespace doesn't matter, <button>=<key>; is just as valid as <button> = <key>;
';' at the ends of lines is also optional.d
';' at the ends of lines is also optional.
)";
}
QString bindings() {

View File

@ -3,8 +3,8 @@
#include <QDockWidget>
#include <QKeyEvent>
#include <QProgressDialog>
#include <QPlainTextEdit>
#include <QProgressDialog>
#include "about_dialog.h"
#include "cheats_patches.h"
@ -266,8 +266,8 @@ void MainWindow::CreateConnects() {
// this is the editor for kbm keybinds
connect(ui->controllerButton, &QPushButton::clicked, this, [this]() {
EditorDialog *editorWindow = new EditorDialog(this);
editorWindow->exec(); // Show the editor window modally
EditorDialog* editorWindow = new EditorDialog(this);
editorWindow->exec(); // Show the editor window modally
});
#ifdef ENABLE_UPDATER