MCPcopy Create free account
hub / github.com/SFML/SFML / keyEventDescription

Function keyEventDescription

examples/keyboard/Keyboard.cpp:712–727  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

710// Append information to string about a keyboard event
711template <typename KeyEventType>
712sf::String keyEventDescription(sf::String text, const KeyEventType& keyEvent)
713{
714 text += "\n\n";
715 text += keyIdentifier(keyEvent.code);
716 text += "\n";
717 text += scancodeIdentifier(keyEvent.scancode);
718 if (somethingIsOdd(keyEvent))
719 {
720 text += "\nLocalized:\t";
721 text += keyIdentifier(sf::Keyboard::localize(keyEvent.scancode));
722 text += "\nDelocalized:\t";
723 text += scancodeIdentifier(sf::Keyboard::delocalize(keyEvent.code));
724 }
725
726 return text;
727}
728
729// Make a string describing a text event
730sf::String textEventDescription(const sf::Event::TextEntered& textEntered)

Callers 1

mainFunction · 0.85

Calls 5

keyIdentifierFunction · 0.85
scancodeIdentifierFunction · 0.85
somethingIsOddFunction · 0.85
localizeFunction · 0.50
delocalizeFunction · 0.50

Tested by

no test coverage detected