Files
dusklight/src/dusk/ui/controller_config.hpp
T
gymnast86 ef43b94370 Add options for binding custom buttons to specific actions (#1141)
* custom action framework and first person custom action

* add bind for midna call

* custom binding for opening dusklight menu

* turbo speed button action

* text descriptions

* fix not stopping default GC controller menu combo

* more explanation text

* block bind actions when in the dusklight menu
2026-05-12 19:36:07 -06:00

61 lines
1.6 KiB
C++

#pragma once
#include "window.hpp"
#include "dusk/config_var.hpp"
#include <pad.h>
namespace dusk::ui {
class ControllerConfigWindow : public Window {
public:
ControllerConfigWindow(bool prelaunch);
void update() override;
void hide(bool close) override;
private:
enum class Page {
Controller,
Buttons,
Triggers,
Sticks,
Rumble,
Actions,
};
void build_port_tab(Rml::Element* content, int port);
void render_page(class Pane& pane, int port, Page page);
void refresh_controller_page();
void poll_pending_binding();
void finish_pending_binding(int completedPort);
void unmap_pending_binding();
bool capture_active() const;
bool pending_input_neutral() const;
Rml::String pending_button_label() const;
Rml::String pending_axis_label() const;
void cancel_pending_binding();
void finish_pending_key_binding();
Rml::String pending_key_label() const;
void stop_rumble_test();
Page mPage = Page::Controller;
Pane* mRightPane = nullptr;
int mActivePort = 0;
int mPendingPort = -1;
bool mPendingBindingArmed = false;
bool mSuppressNavigationUntilNeutral = false;
int mSuppressNavigationPort = -1;
PADButtonMapping* mPendingButtonMapping = nullptr;
PADAxisMapping* mPendingAxisMapping = nullptr;
int mPendingKeyButton = -1;
int mPendingKeyAxis = -1;
bool mRumbleTestActive = false;
int mRumbleTestPort = -1;
ActionBindConfigVar* mPendingActionBinding = nullptr;
};
Rml::String native_button_name(SDL_Gamepad* gamepad, u32 buttonUntyped);
} // namespace dusk::ui