// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include #include #include #include #include #include #include #include class ExpandableSection : public QWidget { Q_OBJECT public: explicit ExpandableSection(const QString& title, const QString& content, QWidget* parent); signals: void expandedChanged(); // Signal to indicate layout size change private: QPushButton* toggleButton; QTextBrowser* contentBrowser; // Changed from QLabel to QTextBrowser QPropertyAnimation* animation; int contentHeight; void updateContentHeight() { int contentHeight = contentBrowser->document()->size().height(); contentBrowser->setMinimumHeight(contentHeight + 5); contentBrowser->setMaximumHeight(contentHeight + 5); } }; class HelpDialog : public QDialog { Q_OBJECT public: explicit HelpDialog(QWidget* parent = nullptr); private: QString quickstart() { return R"(The keyboard remapping backend, GUI and documentation have been written by kalaposfos In this section, you will find information about the project, its features and help on setting up your ideal setup. To view the config file's syntax, check out the Syntax tab, for keybind names, visit Normal Keybinds and Special Bindings, and if you are here to view emulator-wide keybinds, you can find it in the FAQ section. This project started out because I didn't like the original unchangeable keybinds, but rather than waiting for someone else to do it, I implemented this myself. From the default keybinds, you can clearly tell this was a project built for Bloodborne, but ovbiously you can make adjustments however you like. )"; } QString faq() { return R"(Q: What are the emulator-wide keybinds? A: -F12: Triggers Renderdoc capture -F11: Toggles fullscreen -F10: Toggles FPS counter -Ctrl F10: Open the debug menu -F9: Pauses emultor, if the debug menu is open -F8: Reparses the config file while in-game -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 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. Q: I want to bind to , but your code doesn't support ! A: Some keys are intentionally omitted, but if you read the bindings through, and you're sure it is not there and isn't one of the intentionally disabled ones, reach out to me by opening an issue on https://github.com/kalaposfos13/shadPS4 or on Discord (@kalaposfos). )"; } 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 Syntax (aka how a line can look like): #Comment line = , , ; = , ; = ; Examples: #Interact cross = e; #Heavy attack (in BB) r2 = leftbutton, lshift; #Move forward axis_left_y_minus = w; You can make a comment line by putting # as the first character. Whitespace doesn't matter,