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

Function MakeZxcvbKeys

src/osk_gui.cpp:296–307  ·  view source on GitHub ↗

Construct the zxcvb row keys. */

Source from the content-addressed store, hash-verified

294
295/** Construct the zxcvb row keys. */
296static std::unique_ptr<NWidgetBase> MakeZxcvbKeys()
297{
298 std::unique_ptr<NWidgetHorizontal> hor = std::make_unique<NWidgetHorizontalLTR>();
299 hor->SetPIP(0, INTER_KEY_SPACE, 0);
300
301 AddKey(hor, KEY_PADDING, 3, WWT_IMGBTN, WID_OSK_SHIFT, WidgetData{.sprite = SPR_OSK_SHIFT});
302 for (WidgetID widnum = WID_OSK_ZXCVB_FIRST; widnum <= WID_OSK_ZXCVB_LAST; widnum++) {
303 AddKey(hor, KEY_PADDING, 2, WWT_PUSHBTN, widnum, {});
304 }
305 AddKey(hor, KEY_PADDING, 1, NWID_SPACER, 0, {});
306 return hor;
307}
308
309/** Construct the spacebar row keys. */
310static std::unique_ptr<NWidgetBase> MakeSpacebarKeys()

Callers

nothing calls this directly

Calls 2

AddKeyFunction · 0.85
SetPIPMethod · 0.80

Tested by

no test coverage detected