MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / OnKeyPress

Method OnKeyPress

src/bridge_gui.cpp:250–260  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

248 }
249
250 EventState OnKeyPress([[maybe_unused]] char32_t key, uint16_t keycode) override
251 {
252 const uint8_t i = keycode - '1';
253 if (i < 9 && i < this->bridges.size()) {
254 /* Build the requested bridge */
255 this->BuildBridge(this->bridges[i].index);
256 this->Close();
257 return ES_HANDLED;
258 }
259 return ES_NOT_HANDLED;
260 }
261
262 void OnClick([[maybe_unused]] Point pt, WidgetID widget, [[maybe_unused]] int click_count) override
263 {

Callers

nothing calls this directly

Calls 3

BuildBridgeMethod · 0.95
sizeMethod · 0.45
CloseMethod · 0.45

Tested by

no test coverage detected