JustAnotherDnDGame 0.1.0
Jeu de rôle tactique au d20, vue de dessus, en C++/Qt
Loading...
Searching...
No Matches
EditorKeyBindings.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2026 Valentin Eloy
2// SPDX-License-Identifier: GPL-3.0-or-later
3
4#pragma once
5
6#include <array>
7#include <cstddef>
8#include <filesystem>
9
11
17
18namespace hmi {
19
42
44constexpr int EDITOR_ACTION_COUNT = 10;
45
54public:
58
60 [[nodiscard]] Key key(EditorAction action) const noexcept;
61
68 void setKey(EditorAction action, Key newKey) noexcept;
69
71 void resetToDefaults() noexcept;
72
74 [[nodiscard]] static Key defaultKey(EditorAction action) noexcept;
75
81 bool save(const std::filesystem::path& path) const;
82
88 [[nodiscard]] static EditorKeyBindings load(const std::filesystem::path& path);
89
90private:
91 std::array<Key, EDITOR_ACTION_COUNT> _keys{};
92};
93
94} // namespace hmi
État des entrées clavier/souris/manette échantillonné une fois par frame.
static Key defaultKey(EditorAction action) noexcept
Definition EditorKeyBindings.cpp:47
Key key(EditorAction action) const noexcept
Definition EditorKeyBindings.cpp:77
std::array< Key, EDITOR_ACTION_COUNT > _keys
Definition EditorKeyBindings.h:91
bool save(const std::filesystem::path &path) const
Sauvegarde dans la section "editeur" de path, en préservant une section "jeu" déjà présente (écrite p...
Definition EditorKeyBindings.cpp:103
EditorKeyBindings()
Construit avec les valeurs par défaut (S/Z/Y/C/V/P/F10/F1/F2/T, cf.
Definition EditorKeyBindings.cpp:73
void resetToDefaults() noexcept
Restaure les neuf actions à leurs touches par défaut (defaultKey).
Definition EditorKeyBindings.cpp:94
void setKey(EditorAction action, Key newKey) noexcept
Lie action à newKey.
Definition EditorKeyBindings.cpp:83
static EditorKeyBindings load(const std::filesystem::path &path)
Charge la section "editeur" de path.
Definition EditorKeyBindings.cpp:134
Definition AudioEngine.cpp:15
@ Paste
Definition PixelHistory.h:40
Key
Touche du clavier, identifiée par son code virtuel Win32.
Definition InputState.h:29
EditorAction
Action d'éditeur logique, remappable indépendamment de la touche physique.
Definition EditorKeyBindings.h:29
@ Undo
Definition EditorKeyBindings.h:31
@ Redo
Definition EditorKeyBindings.h:32
@ Copy
Definition EditorKeyBindings.h:33
@ ToggleHelp
Definition EditorKeyBindings.h:37
@ ToggleGrid
Definition EditorKeyBindings.h:36
@ Rename
Definition EditorKeyBindings.h:38
@ TextureAssignTool
Sélectionne l'outil « Texture par instance » (LOT-45, EX-EDIT-043).
Definition EditorKeyBindings.h:40
@ Playtest
Definition EditorKeyBindings.h:35
@ Save
Definition EditorKeyBindings.h:30
constexpr int EDITOR_ACTION_COUNT
Nombre d'actions d'éditeur remappables (EditorAction).
Definition EditorKeyBindings.h:44