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// Held while dropping an asset into the viewport to align it to the surface normal.
14inline constexpr ImGuiKey modifier_drop_align_to_surface = ImGuiKey_LeftAlt;
15
16// File operations
17inline const ImGuiKeyCombination new_scene = {ImGuiKey_LeftCtrl, ImGuiKey_N};
18inline const ImGuiKeyCombination open_scene = {ImGuiKey_LeftCtrl, ImGuiKey_O};
19inline const ImGuiKeyCombination save_scene = {ImGuiKey_LeftCtrl, ImGuiKey_S};
20inline const ImGuiKeyCombination save_scene_as = {ImGuiKey_LeftCtrl, ImGuiKey_LeftShift, ImGuiKey_S};
21
22// Play mode
23inline constexpr ImGuiKey play_toggle = ImGuiKey_F5;
24inline constexpr ImGuiKey pause_toggle = ImGuiKey_F6;
25inline constexpr ImGuiKey step_frame = ImGuiKey_F7;
26
27// Camera movement
28inline constexpr ImGuiKey camera_forward = ImGuiKey_W;
29inline constexpr ImGuiKey camera_backward = ImGuiKey_S;
30inline constexpr ImGuiKey camera_left = ImGuiKey_A;
31inline constexpr ImGuiKey camera_right = ImGuiKey_D;
32
33// Content browser operations
34inline constexpr ImGuiKey rename_item = ImGuiKey_F2;
35inline constexpr ImGuiKey delete_item = ImGuiKey_Delete;
36inline const ImGuiKeyCombination duplicate_item = {ImGuiKey_LeftCtrl, ImGuiKey_D};
37inline constexpr ImGuiKey navigate_back = ImGuiKey_Backspace;
38inline constexpr ImGuiKey item_action = ImGuiKey_Enter;
39inline constexpr ImGuiKey item_action_alt = ImGuiKey_KeypadEnter;
40inline constexpr ImGuiKey item_cancel = ImGuiKey_Escape;
41
42// Selection and navigation
43inline const ImGuiKeyCombination select_all = {ImGuiKey_LeftCtrl, ImGuiKey_A};
44inline const ImGuiKeyCombination cut = {ImGuiKey_LeftCtrl, ImGuiKey_X};
45inline const ImGuiKeyCombination copy = {ImGuiKey_LeftCtrl, ImGuiKey_C};
46inline const ImGuiKeyCombination paste = {ImGuiKey_LeftCtrl, ImGuiKey_V};
47inline const ImGuiKeyCombination undo = {ImGuiKey_LeftCtrl, ImGuiKey_Z};
48inline const ImGuiKeyCombination redo = {ImGuiKey_LeftCtrl, ImGuiKey_Y};
49inline const ImGuiKeyCombination redo_alt = {ImGuiKey_LeftCtrl, ImGuiKey_LeftShift, ImGuiKey_Z};
50inline const ImGuiKeyCombination undo_history = {ImGuiKey_LeftCtrl, ImGuiKey_U};
51inline const ImGuiKeyCombination recompile_ui = {ImGuiKey_LeftCtrl, ImGuiKey_LeftShift, ImGuiKey_R};
52// Transform operations
53inline constexpr ImGuiKey move_tool = ImGuiKey_W;
54inline constexpr ImGuiKey rotate_tool = ImGuiKey_E;
55inline constexpr ImGuiKey scale_tool = ImGuiKey_R;
56inline constexpr ImGuiKey universal_tool = ImGuiKey_Q;
57inline constexpr ImGuiKey bounds_tool = ImGuiKey_T;
58
59// IK operations
60inline constexpr ImGuiKey ik_ccd = ImGuiKey_K;
61inline constexpr ImGuiKey ik_fabrik = ImGuiKey_L;
62inline constexpr ImGuiKey ik_two_bone = ImGuiKey_M;
63
64// View operations
65inline const ImGuiKeyCombination scene_fullscreen_toggle = {ImGuiKey_LeftCtrl, ImGuiKey_Space};
66inline constexpr ImGuiKey focus_selected = ImGuiKey_F;
67inline const ImGuiKeyCombination frame_all = {ImGuiKey_LeftAlt, ImGuiKey_F};
68inline constexpr ImGuiKey toggle_gizmo_mode = ImGuiKey_Z;
69inline constexpr ImGuiKey toggle_local_global = ImGuiKey_L;
70inline constexpr ImGuiKeyChord snap_scene_camera_to_selected_camera = ImGuiKey_F | ImGuiMod_Shift;
71
72// Function keys
73inline constexpr ImGuiKey help = ImGuiKey_F1;
74
75// Utility functions
76inline auto get_shortcut_name(const ImGuiKeyCombination& shortcut) -> std::string
77{
78 return ImGui::GetKeyCombinationName(shortcut);
79}
80
81inline auto get_shortcut_name(ImGuiKey key) -> std::string
82{
83 return ImGui::GetKeyName(key);
84}
85
86} // namespace shortcuts
87} // namespace unravel
constexpr ImGuiKey camera_forward
Definition shortcuts.h:28
constexpr ImGuiKey camera_left
Definition shortcuts.h:30
constexpr ImGuiKey modifier_camera_speed_boost
Definition shortcuts.h:11
const ImGuiKeyCombination copy
Definition shortcuts.h:45
const ImGuiKeyCombination frame_all
Definition shortcuts.h:67
const ImGuiKeyCombination undo_history
Definition shortcuts.h:50
const ImGuiKeyCombination cut
Definition shortcuts.h:44
constexpr ImGuiKey play_toggle
Definition shortcuts.h:23
constexpr ImGuiKey item_cancel
Definition shortcuts.h:40
constexpr ImGuiKey delete_item
Definition shortcuts.h:35
const ImGuiKeyCombination select_all
Definition shortcuts.h:43
const ImGuiKeyCombination duplicate_item
Definition shortcuts.h:36
constexpr ImGuiKey camera_right
Definition shortcuts.h:31
constexpr ImGuiKey rename_item
Definition shortcuts.h:34
const ImGuiKeyCombination new_scene
Definition shortcuts.h:17
constexpr ImGuiKey modifier_drop_align_to_surface
Definition shortcuts.h:14
constexpr ImGuiKeyChord snap_scene_camera_to_selected_camera
Definition shortcuts.h:70
const ImGuiKeyCombination paste
Definition shortcuts.h:46
constexpr ImGuiKey toggle_gizmo_mode
Definition shortcuts.h:68
const ImGuiKeyCombination undo
Definition shortcuts.h:47
constexpr ImGuiKey ik_ccd
Definition shortcuts.h:60
constexpr ImGuiKey step_frame
Definition shortcuts.h:25
constexpr ImGuiKey camera_backward
Definition shortcuts.h:29
const ImGuiKeyCombination redo
Definition shortcuts.h:48
auto get_shortcut_name(const ImGuiKeyCombination &shortcut) -> std::string
Definition shortcuts.h:76
constexpr ImGuiKey item_action_alt
Definition shortcuts.h:39
constexpr ImGuiKey pause_toggle
Definition shortcuts.h:24
const ImGuiKeyCombination recompile_ui
Definition shortcuts.h:51
constexpr ImGuiKey ik_two_bone
Definition shortcuts.h:62
constexpr ImGuiKey ik_fabrik
Definition shortcuts.h:61
constexpr ImGuiKey toggle_local_global
Definition shortcuts.h:69
constexpr ImGuiKey focus_selected
Definition shortcuts.h:66
constexpr ImGuiKey item_action
Definition shortcuts.h:38
const ImGuiKeyCombination redo_alt
Definition shortcuts.h:49
constexpr ImGuiKey navigate_back
Definition shortcuts.h:37
constexpr ImGuiKey bounds_tool
Definition shortcuts.h:57
const ImGuiKeyCombination scene_fullscreen_toggle
Definition shortcuts.h:65
constexpr ImGuiKey help
Definition shortcuts.h:73
constexpr ImGuiKey rotate_tool
Definition shortcuts.h:54
const ImGuiKeyCombination save_scene_as
Definition shortcuts.h:20
const ImGuiKeyCombination open_scene
Definition shortcuts.h:18
constexpr ImGuiKey modifier_snapping
Definition shortcuts.h:12
constexpr ImGuiKey universal_tool
Definition shortcuts.h:56
constexpr ImGuiKey scale_tool
Definition shortcuts.h:55
const ImGuiKeyCombination save_scene
Definition shortcuts.h:19
constexpr ImGuiKey move_tool
Definition shortcuts.h:53