Nix (Dev) 3.5.10
dev - 3.5.10 - 1af9301
Loading...
Searching...
No Matches
utils.hpp
Go to the documentation of this file.
1#ifndef IV_SRC_UI_CAD_UTILS_HPP_
2#define IV_SRC_UI_CAD_UTILS_HPP_
3
4#include "core/defines.hpp"
5#include "ui/cad/enums.hpp"
7
8#include <string>
9
10namespace iv::cad
11{
12
14{
15 if (keysPressed.isKeyEsc)
16 {
18 }
19
20 if (keysPressed.isControl and keysPressed.isKeyPlus)
21 {
23 }
24
25 if (keysPressed.isKeyDelete)
26 {
28 }
29
30 if (keysPressed.isControl and keysPressed.isKeyC)
31 {
33 }
34
35 if (keysPressed.isControl and keysPressed.isKeyV)
36 {
38 }
39
40 if (keysPressed.isControl and keysPressed.isKeyR)
41 {
43 }
44
45 if (keysPressed.isControl and keysPressed.isKeyE)
46 {
48 }
49
50 if (keysPressed.isControl and keysPressed.isKeyA)
51 {
53 }
54
55 if (keysPressed.isControl and keysPressed.isKeyP)
56 {
58 }
59
60 if (keysPressed.isControl and keysPressed.isKeyZ and keysPressed.isShift)
61 {
63 }
64
65 if (keysPressed.isControl and keysPressed.isKeyZ)
66 {
68 }
69
70 if (keysPressed.isControl and keysPressed.isKeyY)
71 {
73 }
74
75 // Arrow keys
76 if (keysPressed.isArrowKeyUp)
77 {
79 }
80
81 if (keysPressed.isArrowKeyDown)
82 {
84 }
85
86 if (keysPressed.isArrowKeyLeft)
87 {
89 }
90
91 if (keysPressed.isArrowKeyRight)
92 {
94 }
95
97}
98
99inline std::string shortcutKey(iv::cad::eMimicEditorShortcut shortcut)
100{
101 switch (shortcut)
102 {
104 return "";
106 return "Ctrl + +";
108 return "Supr";
110 return "Ctrl + C";
112 return "Ctrl + V";
114 return "Ctrl + R";
116 return "Ctrl + E";
118 return "Ctrl + A";
120 return "Ctrl + P";
122 return "Ctrl + Z";
124 return "Ctrl + Shift + Z\n \\ Ctrl + Y";
126 return "Arrow Up";
128 return "Arrow Down";
130 return "Arrow Left";
132 return "Arrow Right";
134 return "Ctrl + Arrow Up";
136 return "Ctrl + Arrow Down";
138 return "Ctrl + Arrow Left";
140 return "Ctrl + Arrow Right";
142 return "Esc";
143 }
144
145 return "";
146}
147
149{
150 switch (shortcut)
151 {
153 return "";
155 return _("Add element");
157 return _("Delete selection");
159 return _("Copy elements");
161 return _("Paste elements");
163 return _("Rotate");
165 return _("Equidistance");
167 return _("Alignment");
169 return _("Center");
171 return _("Undo");
173 return _("Redo");
175 return _("Move up");
177 return _("Move down");
179 return _("Move left");
181 return _("Move right");
183 return _("Move up jumping");
185 return _("Move down jumping");
187 return _("Move left jumping");
189 return _("Move right jumping");
191 return _("Cancel action");
192 }
193
194 return "";
195}
196
197}// namespace iv::cad
198
199#endif//IV_SRC_UI_CAD_UTILS_HPP_
#define _(string)
Definition defines.hpp:169
Definition CadMimicEditorUseCases.cpp:21
std::string shortcutKey(iv::cad::eMimicEditorShortcut shortcut)
Definition utils.hpp:99
std::string shortcutDescription(iv::cad::eMimicEditorShortcut shortcut)
Definition utils.hpp:148
iv::cad::eMimicEditorShortcut extractMimicEditorShortcut(const iv::ui::KeysPressed &keysPressed)
Definition utils.hpp:13
eMimicEditorShortcut
Definition enums.hpp:8
Definition interactionsStructs.hpp:24
bool isKeyPlus
Definition interactionsStructs.hpp:32
bool isKeyR
Definition interactionsStructs.hpp:38
bool isArrowKeyUp
Definition interactionsStructs.hpp:46
bool isKeyP
Definition interactionsStructs.hpp:41
bool isKeyY
Definition interactionsStructs.hpp:37
bool isKeyZ
Definition interactionsStructs.hpp:36
bool isArrowKeyLeft
Definition interactionsStructs.hpp:47
bool isKeyEsc
Definition interactionsStructs.hpp:30
bool isKeyE
Definition interactionsStructs.hpp:39
bool isArrowKeyRight
Definition interactionsStructs.hpp:45
bool isKeyC
Definition interactionsStructs.hpp:33
bool isArrowKeyDown
Definition interactionsStructs.hpp:44
bool isShift
Definition interactionsStructs.hpp:26
bool isKeyA
Definition interactionsStructs.hpp:40
bool isKeyV
Definition interactionsStructs.hpp:34
bool isKeyDelete
Definition interactionsStructs.hpp:31
bool isControl
Definition interactionsStructs.hpp:27