Unravel Engine C++ Reference
Loading...
Searching...
No Matches
shortcuts.h
Go to the documentation of this file.
1#pragma once
2
3#include <imgui/imgui.h>
5
6namespace unravel
7{
8namespace shortcuts
9{
10// Modifier keys
11inline constexpr ImGuiKey modifier_camera_speed_boost = ImGuiKey_LeftShift;
12inline constexpr ImGuiKey modifier_snapping = ImGuiKey_LeftCtrl;
13
14// File operations
15inline const ImGuiKeyCombination new_scene = {ImGuiKey_LeftCtrl, ImGuiKey_N};
16inline const ImGuiKeyCombination open_scene = {ImGuiKey_LeftCtrl, ImGuiKey_O};
17inline const ImGuiKeyCombination save_scene = {ImGuiKey_LeftCtrl, ImGuiKey_S};
18inline const ImGuiKeyCombination save_scene_as = {ImGuiKey_LeftCtrl, ImGuiKey_LeftShift, ImGuiKey_S};
19
20// Play mode
21inline constexpr ImGuiKey play_toggle = ImGuiKey_F5;
22inline constexpr ImGuiKey pause_toggle = ImGuiKey_F6;
23inline constexpr ImGuiKey step_frame = ImGuiKey_F7;
24
25// Camera movement
26inline constexpr ImGuiKey camera_forward = ImGuiKey_W;
27inline constexpr ImGuiKey camera_backward = ImGuiKey_S;
28inline constexpr ImGuiKey camera_left = ImGuiKey_A;
29inline constexpr ImGuiKey camera_right = ImGuiKey_D;
30
31// Content browser operations
32inline constexpr ImGuiKey rename_item = ImGuiKey_F2;
33inline constexpr ImGuiKey delete_item = ImGuiKey_Delete;
34inline const ImGuiKeyCombination duplicate_item = {ImGuiKey_LeftCtrl, ImGuiKey_D};
35inline constexpr ImGuiKey navigate_back = ImGuiKey_Backspace;
36inline constexpr ImGuiKey item_action = ImGuiKey_Enter;
37inline constexpr ImGuiKey item_action_alt = ImGuiKey_KeypadEnter;
38inline constexpr ImGuiKey item_cancel = ImGuiKey_Escape;
39
40// Selection and navigation
41inline const ImGuiKeyCombination select_all = {ImGuiKey_LeftCtrl, ImGuiKey_A};
42inline const ImGuiKeyCombination cut = {ImGuiKey_LeftCtrl, ImGuiKey_X};
43inline const ImGuiKeyCombination copy = {ImGuiKey_LeftCtrl, ImGuiKey_C};
44inline const ImGuiKeyCombination paste = {ImGuiKey_LeftCtrl, ImGuiKey_V};
45inline const ImGuiKeyCombination undo = {ImGuiKey_LeftCtrl, ImGuiKey_Z};
46inline const ImGuiKeyCombination redo = {ImGuiKey_LeftCtrl, ImGuiKey_Y};
47inline const ImGuiKeyCombination redo_alt = {ImGuiKey_LeftCtrl, ImGuiKey_LeftShift, ImGuiKey_Z};
48inline const ImGuiKeyCombination undo_history = {ImGuiKey_LeftCtrl, ImGuiKey_U};
49inline const ImGuiKeyCombination recompile_ui = {ImGuiKey_LeftCtrl, ImGuiKey_LeftShift, ImGuiKey_R};
50// Transform operations
51inline constexpr ImGuiKey move_tool = ImGuiKey_W;
52inline constexpr ImGuiKey rotate_tool = ImGuiKey_E;
53inline constexpr ImGuiKey scale_tool = ImGuiKey_R;
54inline constexpr ImGuiKey universal_tool = ImGuiKey_Q;
55inline constexpr ImGuiKey bounds_tool = ImGuiKey_T;
56
57// IK operations
58inline constexpr ImGuiKey ik_ccd = ImGuiKey_K;
59inline constexpr ImGuiKey ik_fabrik = ImGuiKey_L;
60
61// View operations
62inline constexpr ImGuiKey focus_selected = ImGuiKey_F;
63inline const ImGuiKeyCombination frame_all = {ImGuiKey_LeftAlt, ImGuiKey_F};
64inline constexpr ImGuiKey toggle_gizmo_mode = ImGuiKey_Z;
65inline constexpr ImGuiKey toggle_local_global = ImGuiKey_L;
66inline constexpr ImGuiKeyChord snap_scene_camera_to_selected_camera = ImGuiKey_F | ImGuiMod_Shift;
67
68// Function keys
69inline constexpr ImGuiKey help = ImGuiKey_F1;
70
71// Utility functions
72inline auto get_shortcut_name(const ImGuiKeyCombination& shortcut) -> std::string
73{
74 return ImGui::GetKeyCombinationName(shortcut);
75}
76
77inline auto get_shortcut_name(ImGuiKey key) -> std::string
78{
79 return ImGui::GetKeyName(key);
80}
81
82} // namespace shortcuts
83} // namespace unravel
constexpr ImGuiKey camera_forward
Definition shortcuts.h:26
constexpr ImGuiKey camera_left
Definition shortcuts.h:28
constexpr ImGuiKey modifier_camera_speed_boost
Definition shortcuts.h:11
const ImGuiKeyCombination copy
Definition shortcuts.h:43
const ImGuiKeyCombination frame_all
Definition shortcuts.h:63
const ImGuiKeyCombination undo_history
Definition shortcuts.h:48
const ImGuiKeyCombination cut
Definition shortcuts.h:42
constexpr ImGuiKey play_toggle
Definition shortcuts.h:21
constexpr ImGuiKey item_cancel
Definition shortcuts.h:38
constexpr ImGuiKey delete_item
Definition shortcuts.h:33
const ImGuiKeyCombination select_all
Definition shortcuts.h:41
const ImGuiKeyCombination duplicate_item
Definition shortcuts.h:34
constexpr ImGuiKey camera_right
Definition shortcuts.h:29
constexpr ImGuiKey rename_item
Definition shortcuts.h:32
const ImGuiKeyCombination new_scene
Definition shortcuts.h:15
constexpr ImGuiKeyChord snap_scene_camera_to_selected_camera
Definition shortcuts.h:66
const ImGuiKeyCombination paste
Definition shortcuts.h:44
constexpr ImGuiKey toggle_gizmo_mode
Definition shortcuts.h:64
const ImGuiKeyCombination undo
Definition shortcuts.h:45
constexpr ImGuiKey ik_ccd
Definition shortcuts.h:58
constexpr ImGuiKey step_frame
Definition shortcuts.h:23
constexpr ImGuiKey camera_backward
Definition shortcuts.h:27
const ImGuiKeyCombination redo
Definition shortcuts.h:46
auto get_shortcut_name(const ImGuiKeyCombination &shortcut) -> std::string
Definition shortcuts.h:72
constexpr ImGuiKey item_action_alt
Definition shortcuts.h:37
constexpr ImGuiKey pause_toggle
Definition shortcuts.h:22
const ImGuiKeyCombination recompile_ui
Definition shortcuts.h:49
constexpr ImGuiKey ik_fabrik
Definition shortcuts.h:59
constexpr ImGuiKey toggle_local_global
Definition shortcuts.h:65
constexpr ImGuiKey focus_selected
Definition shortcuts.h:62
constexpr ImGuiKey item_action
Definition shortcuts.h:36
const ImGuiKeyCombination redo_alt
Definition shortcuts.h:47
constexpr ImGuiKey navigate_back
Definition shortcuts.h:35
constexpr ImGuiKey bounds_tool
Definition shortcuts.h:55
constexpr ImGuiKey help
Definition shortcuts.h:69
constexpr ImGuiKey rotate_tool
Definition shortcuts.h:52
const ImGuiKeyCombination save_scene_as
Definition shortcuts.h:18
const ImGuiKeyCombination open_scene
Definition shortcuts.h:16
constexpr ImGuiKey modifier_snapping
Definition shortcuts.h:12
constexpr ImGuiKey universal_tool
Definition shortcuts.h:54
constexpr ImGuiKey scale_tool
Definition shortcuts.h:53
const ImGuiKeyCombination save_scene
Definition shortcuts.h:17
constexpr ImGuiKey move_tool
Definition shortcuts.h:51