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() { constexpr std::string_view GetDefaultKeyboardConfig() {
return R"(#This is the default keybinding config return R"(#Feeling lost? Check out the Help section!
#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.
#Keybinds used by the emulator (these are unchangeable): triangle = f
#F12 : Trigger Renderdoc capture circle = space
#F11 : Fullscreen cross = e
#F10 : FPS counter square = r
#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)
#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. l1 = rightbutton, lshift
mouse_to_joystick = right; r1 = leftbutton
l2 = rightbutton
r2 = leftbutton, lshift
l3 = x
r3 = q
r3 = middlebutton
#Use healing item, change status in inventory key_toggle = i, lalt
triangle = f;
#Dodge, back in inventory
circle = space;
#Interact, select item in inventory
cross = e;
#Use quick item, remove item in inventory
square = r;
#Emergency extra bullets options = escape
up = w, lalt; touchpad = g
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;
#Menu
options = escape;
#Gestures
touchpad = g;
#Transform mouse_to_joystick = right
l1 = rightbutton, lshift; mouse_movement_params = 1, 0.5, 0.125
#Light attack
r1 = leftbutton;
#Shoot
l2 = rightbutton;
#Heavy attack
r2 = leftbutton, lshift;
#Does nothing
l3 = x;
#Center cam, lock on
r3 = q;
r3 = middlebutton;
#Axis mappings leftjoystick_halfmode = lctrl
#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;
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) { 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() { 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; return;
} }
old_button_state = new_button_state; old_button_state = new_button_state;
@ -455,7 +455,7 @@ bool IsInputActive(const InputBinding& i) {
for (bool* flag : flags_to_set) { for (bool* flag : flags_to_set) {
is_fully_blocked &= *flag; is_fully_blocked &= *flag;
} }
if(is_fully_blocked) { if (is_fully_blocked) {
return false; return false;
} }
for (bool* flag : flags_to_set) { 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() { QString faq() {
return return
R"(Q: What are the emulator-wide keybinds? R"(Q: What are the emulator-wide keybinds?
A: -F12: Triggers Rdoc capture A: -F12: Triggers Renderdoc capture
-F11: Toggles fullscreen -F11: Toggles fullscreen
-F10: Toggles FPS counter -F10: Toggles FPS counter
-Ctrl F10: Open the debug menu -Ctrl F10: Open the debug menu
@ -57,7 +57,7 @@ A: -F12: Triggers Rdoc capture
-F7: Toggles mouse capture and mouse input -F7: Toggles mouse capture and mouse input
Q: How do I change between mouse and controller joystick input, and why is it even required? 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? 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. 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() { QString syntax() {
return return
R"(This is the full list of currently supported mouse and keyboard inputs, and how to use them. 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): Syntax (aka how a line can look like):
#Comment line #Comment line
@ -87,7 +87,7 @@ axis_left_y_minus = w;
You can make a comment line by putting # as the first character. 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>; 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() { QString bindings() {

View File

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