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

Method getKeyFromEvent

src/SFML/Window/Unix/KeyboardImpl.cpp:792–805  ·  view source on GitHub ↗

///////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

790
791////////////////////////////////////////////////////////////
792Keyboard::Key KeyboardImpl::getKeyFromEvent(XKeyEvent& event)
793{
794 // Try each KeySym index (modifier group) until we get a match
795 for (int i = 0; i < 4; ++i)
796 {
797 // Get the SFML keyboard code from the keysym of the key that has been pressed
798 const KeySym keysym = XLookupKeysym(&event, i);
799 const Keyboard::Key key = keySymToKey(keysym);
800 if (key != Keyboard::Key::Unknown)
801 return key;
802 }
803
804 return Keyboard::Key::Unknown;
805}
806
807
808////////////////////////////////////////////////////////////

Callers

nothing calls this directly

Calls 1

keySymToKeyFunction · 0.85

Tested by

no test coverage detected