| 424 | // Template to iterate on scancodes and the corresponding computed rectangle in local coordinates |
| 425 | template <typename F> |
| 426 | void forEachKey(F function) const |
| 427 | { |
| 428 | sf::Vector2f position; |
| 429 | for (const auto& [cells, marginBottom] : m_matrix) |
| 430 | { |
| 431 | for (const auto& [scancode, size, marginRight] : cells) |
| 432 | { |
| 433 | function(scancode, sf::FloatRect(position, size)); |
| 434 | position.x += size.x + marginRight; |
| 435 | } |
| 436 | position.x = 0.f; |
| 437 | position.y += keySize + marginBottom; |
| 438 | } |
| 439 | } |
| 440 | |
| 441 | static constexpr float keySize = 54.f; |
| 442 | static constexpr float padding = 4.f; |
nothing calls this directly
no outgoing calls
no test coverage detected