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

Function keyIdentifier

examples/keyboard/Keyboard.cpp:30–143  ·  view source on GitHub ↗

Get the C++ enumerator name of the given `sf::Keyboard::Key` value including `Key::` prefix

Source from the content-addressed store, hash-verified

28
29// Get the C++ enumerator name of the given `sf::Keyboard::Key` value including `Key::` prefix
30std::string keyIdentifier(sf::Keyboard::Key code)
31{
32 switch (code)
33 {
34#define CASE(code) \
35 case sf::Keyboard::Key::code: \
36 return "Key::" #code
37 CASE(Unknown);
38 CASE(A);
39 CASE(B);
40 CASE(C);
41 CASE(D);
42 CASE(E);
43 CASE(F);
44 CASE(G);
45 CASE(H);
46 CASE(I);
47 CASE(J);
48 CASE(K);
49 CASE(L);
50 CASE(M);
51 CASE(N);
52 CASE(O);
53 CASE(P);
54 CASE(Q);
55 CASE(R);
56 CASE(S);
57 CASE(T);
58 CASE(U);
59 CASE(V);
60 CASE(W);
61 CASE(X);
62 CASE(Y);
63 CASE(Z);
64 CASE(Num0);
65 CASE(Num1);
66 CASE(Num2);
67 CASE(Num3);
68 CASE(Num4);
69 CASE(Num5);
70 CASE(Num6);
71 CASE(Num7);
72 CASE(Num8);
73 CASE(Num9);
74 CASE(Escape);
75 CASE(LControl);
76 CASE(LShift);
77 CASE(LAlt);
78 CASE(LSystem);
79 CASE(RControl);
80 CASE(RShift);
81 CASE(RAlt);
82 CASE(RSystem);
83 CASE(Menu);
84 CASE(LBracket);
85 CASE(RBracket);
86 CASE(Semicolon);
87 CASE(Comma);

Callers 2

keyEventDescriptionFunction · 0.85
mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected