MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / IR_OnKeyboardPress

Method IR_OnKeyboardPress

ogsr_engine/xrGame/Level_input.cpp:111–338  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

109extern bool g_block_all_except_movement;
110
111void CLevel::IR_OnKeyboardPress(int key)
112{
113 if (CImGuiEditor::Get().Editor_KeyPress(key))
114 return;
115
116 if (GamePersistent().OnKeyboardPress(key))
117 return;
118
119 EGameActions _curr = get_binded_action(key);
120
121 if (m_blocked_actions.find(_curr) != m_blocked_actions.end())
122 return; // Real Wolf. 14.10.2014
123
124 const bool b_ui_exist = (Has_HUD() && HUD().GetUI());
125
126 switch (_curr)
127 {
128 case kSCREENSHOT:
129 Render->Screenshot();
130 return;
131
132 case kCONSOLE:
133 Console->Show();
134 return;
135
136 case kQUIT: {
137 if (b_ui_exist && HUD().GetUI()->MainInputReceiver())
138 {
139 if (HUD().GetUI()->MainInputReceiver()->IR_OnKeyboardPress(key))
140 return; // special case for mp and main_menu
141
142 if (MainMenu()->IsActive() || !Device.Paused())
143 HUD().GetUI()->StartStopMenu(HUD().GetUI()->MainInputReceiver(), true);
144 }
145 else
146 Console->Execute("main_menu");
147 return;
148 }
149
150 case kPAUSE:
151 if (!g_block_pause)
152 {
153 Device.Pause(!Device.Paused(), TRUE, TRUE, "li_pause_key");
154 }
155 return;
156 }
157
158 if (g_bDisableAllInput)
159 return;
160
161 if (g_block_all_except_movement)
162 {
163 if (!(_curr < kCAM_1 || _curr == kPAUSE || _curr == kSCREENSHOT || _curr == kQUIT || _curr == kCONSOLE))
164 return;
165 }
166
167 if (!b_ui_exist)
168 return;

Callers

nothing calls this directly

Calls 15

GetFunction · 0.85
get_binded_actionFunction · 0.85
MainMenuFunction · 0.85
ActorFunction · 0.85
CurrentEntityFunction · 0.85
restore_actorFunction · 0.85
Editor_KeyPressMethod · 0.80
GetUIMethod · 0.80
PausedMethod · 0.80
iGetAsyncKeyStateMethod · 0.80

Tested by

no test coverage detected