* 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. */
| 486 | * @param key Keyboard button to check for (note: ignores key modifiers). Set to 0 for any key. |
| 487 | */ |
| 488 | void 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. |
no outgoing calls