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

Method OnKeyboardPress

ogsr_engine/xrGame/CarInput.cpp:144–185  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

142}
143
144void CCar::OnKeyboardPress(int cmd)
145{
146 if (Remote())
147 return;
148
149 switch (cmd)
150 {
151 case kCAM_1: OnCameraChange(ectFirst); break;
152 case kCAM_2: OnCameraChange(ectChase); break;
153 case kCAM_3: OnCameraChange(ectFree); break;
154 case kACCEL: TransmissionUp(); break;
155 case kCROUCH: TransmissionDown(); break;
156 case kFWD: PressForward(); break;
157 case kBACK: PressBack(); break;
158 case kR_STRAFE:
159 PressRight();
160 if (OwnerActor())
161 OwnerActor()->steer_Vehicle(1);
162 break;
163 case kL_STRAFE:
164 PressLeft();
165 if (OwnerActor())
166 OwnerActor()->steer_Vehicle(-1);
167 break;
168 case kJUMP: PressBreaks(); break;
169 case kENGINE: SwitchEngine(); break;
170 case kTORCH: m_lights.SwitchHeadLights(); break;
171 case kNIGHT_VISION: {
172 auto* Act = OwnerActor();
173 if (Act)
174 {
175 auto* pTorch = smart_cast<CTorch*>(Act->inventory().ItemFromSlot(TORCH_SLOT));
176 if (pTorch)
177 {
178 pTorch->SwitchNightVision();
179 }
180 }
181 }
182 break;
183 case kUSE: break;
184 };
185}
186
187void CCar::OnKeyboardRelease(int cmd)
188{

Callers 3

IR_OnKeyboardPressMethod · 0.45
IR_OnKeyboardPressMethod · 0.45
IR_OnKeyboardPressMethod · 0.45

Calls 6

RemoteFunction · 0.85
OwnerActorFunction · 0.85
steer_VehicleMethod · 0.80
SwitchHeadLightsMethod · 0.80
ItemFromSlotMethod · 0.80
SwitchNightVisionMethod · 0.80

Tested by

no test coverage detected