MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / onKeyboardPress

Method onKeyboardPress

src/Engine/InteractiveSurface.cpp:488–498  ·  view source on GitHub ↗

* Sets a function to be called every time a key is pressed when the surface is focused. * @param handler Action handler. * @param key Keyboard button to check for (note: ignores key modifiers). Set to 0 for any key. */

Source from the content-addressed store, hash-verified

486 * @param key Keyboard button to check for (note: ignores key modifiers). Set to 0 for any key.
487 */
488void InteractiveSurface::onKeyboardPress(ActionHandler handler, SDLKey key)
489{
490 if (handler != 0)
491 {
492 _keyPress[key] = handler;
493 }
494 else
495 {
496 _keyPress.erase(key);
497 }
498}
499
500/**
501 * Sets a function to be called every time a key is released when the surface is focused.

Callers 15

InfoboxOKStateMethod · 0.80
InventoryStateMethod · 0.80
BriefingStateMethod · 0.80
NoContainmentStateMethod · 0.80
MiniMapStateMethod · 0.80
ScannerStateMethod · 0.80
DebriefingStateMethod · 0.80
MedikitStateMethod · 0.80
AliensCrashStateMethod · 0.80
BattlescapeStateMethod · 0.80
UnitInfoStateMethod · 0.80
CannotReequipStateMethod · 0.80

Calls

no outgoing calls

Tested by 2

ResearchCompleteStateMethod · 0.64