SpiecsEngine
 
Loading...
Searching...
No Matches

◆ OnKeyPressed()

bool Spices::ImguiGizmos::OnKeyPressed ( KeyPressedEvent & e)
private

Event Dispatcher target. Registry on Key Resized.

Parameters
[in]eKeyPressedEvent.
Returns
Returns true if need block the event.

Definition at line 211 of file ImguiGizmos.cpp.

212 {
214
215 switch (e.GetKeyCode())
216 {
217 case Key::Q:
218 bEnableGizmo = true;
219 m_GizmoType = ImGuizmo::OPERATION::UNIVERSAL;
220 break;
221 case Key::W:
222 bEnableGizmo = true;
223 m_GizmoType = ImGuizmo::OPERATION::TRANSLATE;
224 break;
225 case Key::E:
226 bEnableGizmo = true;
227 m_GizmoType = ImGuizmo::OPERATION::ROTATE;
228 break;
229 case Key::R:
230 bEnableGizmo = true;
231 m_GizmoType = ImGuizmo::OPERATION::SCALE;
232 break;
233 default:
234 bEnableGizmo = false;
235 m_GizmoType = -1;
236 break;
237 }
238
239 return false;
240 }
#define SPICES_PROFILE_ZONE
int m_GizmoType
Gizmo Type, Transpose, rotate, scale, universal.
Definition ImguiGizmos.h:84
bool bEnableGizmo
Is Enable Gizmo.
Definition ImguiGizmos.h:89

References bEnableGizmo, Spices::Key::E, Spices::KeyEvent::GetKeyCode(), m_GizmoType, Spices::Key::Q, Spices::Key::R, and Spices::Key::W.

Referenced by OnEvent().