Player12
An open source football management simulator
Loading...
Searching...
No Matches
input_actions.cpp File Reference
#include "gui/input_actions.h"
#include <algorithm>
#include <format>
#include <memory>
#include "gui/view_models/match_changes.h"
#include "model/settings_manager.h"

Namespaces

namespace  Input
 Rebindable keyboard shortcuts.
 

Functions

const char * Input::categoryKey (Category category)
 Language key of a category's heading.
 
bool Input::contextsOverlap (Context first, Context second)
 True when two contexts can be live at once.
 
bool Input::isBindableKey (ImGuiKey key)
 True for keys that can be bound (letters, digits, F-keys...).
 
std::string Input::chordToString (ImGuiKeyChord chord)
 Stable name of a chord for the settings file ("Ctrl+K").
 
std::optional< ImGuiKeyChord > Input::chordFromString (std::string_view text)
 Parses chordToString() output; nullopt when invalid.
 
std::string Input::chordLabel (ImGuiKeyChord chord)
 Name shown to the player ("Ctrl+K", "Alt+Left", "-").
 
std::optional< ImGuiKeyChord > Input::capturePressedChord ()
 The chord pressed this frame, for "press a key" capture: the first bindable key pressed with the modifiers held. Modifier keys alone and the mouse never count.
 
std::array< ImGuiKeyChord, 2 > Input::chordsOfEvent (const SDL_KeyboardEvent &event)
 The chord of an SDL key-down event. Letters and digits match both the character and the physical key, so the number row keeps working on layouts where it types symbols (Shift+1 on AZERTY).
 
ActionRegistry & Input::registry ()
 The registry of the running game, with the built-in actions.
 

Variable Documentation

◆ key

ImGuiKey key

◆ label

const char* label

Shown to the player (nullptr: same as name).

◆ mod

ImGuiKeyChord mod

◆ name

const char* name

Written to the settings file.

◆ scancode

SDL_Scancode scancode