* Removed redundant "sf::" where possible
* Moved some functions from sf::priv::anonymous to anonymous namespace.
This commit is contained in:
parent
75e793218f
commit
16a95cfc20
|
@ -28,7 +28,7 @@
|
|||
////////////////////////////////////////////////////////////
|
||||
// Headers
|
||||
////////////////////////////////////////////////////////////
|
||||
#include <SFML/Window/Keyboard.hpp> // sf::Keyboard::Key
|
||||
#include <SFML/Window/Keyboard.hpp>
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/keysym.h>
|
||||
|
||||
|
@ -44,233 +44,233 @@ namespace priv
|
|||
/// \return The corresponding sf::Keyboard::Key
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
inline sf::Keyboard::Key keySymToSFKey(KeySym symbol)
|
||||
inline Keyboard::Key keySymToSFKey(KeySym symbol)
|
||||
{
|
||||
switch (symbol)
|
||||
{
|
||||
case XK_Shift_L: return sf::Keyboard::LShift;
|
||||
case XK_Shift_R: return sf::Keyboard::RShift;
|
||||
case XK_Control_L: return sf::Keyboard::LControl;
|
||||
case XK_Control_R: return sf::Keyboard::RControl;
|
||||
case XK_Alt_L: return sf::Keyboard::LAlt;
|
||||
case XK_Alt_R: return sf::Keyboard::RAlt;
|
||||
case XK_Super_L: return sf::Keyboard::LSystem;
|
||||
case XK_Super_R: return sf::Keyboard::RSystem;
|
||||
case XK_Menu: return sf::Keyboard::Menu;
|
||||
case XK_Escape: return sf::Keyboard::Escape;
|
||||
case XK_semicolon: return sf::Keyboard::SemiColon;
|
||||
case XK_slash: return sf::Keyboard::Slash;
|
||||
case XK_equal: return sf::Keyboard::Equal;
|
||||
case XK_minus: return sf::Keyboard::Dash;
|
||||
case XK_bracketleft: return sf::Keyboard::LBracket;
|
||||
case XK_bracketright: return sf::Keyboard::RBracket;
|
||||
case XK_comma: return sf::Keyboard::Comma;
|
||||
case XK_period: return sf::Keyboard::Period;
|
||||
case XK_apostrophe: return sf::Keyboard::Quote;
|
||||
case XK_backslash: return sf::Keyboard::BackSlash;
|
||||
case XK_grave: return sf::Keyboard::Tilde;
|
||||
case XK_space: return sf::Keyboard::Space;
|
||||
case XK_Return: return sf::Keyboard::Return;
|
||||
case XK_KP_Enter: return sf::Keyboard::Return;
|
||||
case XK_BackSpace: return sf::Keyboard::BackSpace;
|
||||
case XK_Tab: return sf::Keyboard::Tab;
|
||||
case XK_Prior: return sf::Keyboard::PageUp;
|
||||
case XK_Next: return sf::Keyboard::PageDown;
|
||||
case XK_End: return sf::Keyboard::End;
|
||||
case XK_Home: return sf::Keyboard::Home;
|
||||
case XK_Insert: return sf::Keyboard::Insert;
|
||||
case XK_Delete: return sf::Keyboard::Delete;
|
||||
case XK_KP_Add: return sf::Keyboard::Add;
|
||||
case XK_KP_Subtract: return sf::Keyboard::Subtract;
|
||||
case XK_KP_Multiply: return sf::Keyboard::Multiply;
|
||||
case XK_KP_Divide: return sf::Keyboard::Divide;
|
||||
case XK_Pause: return sf::Keyboard::Pause;
|
||||
case XK_F1: return sf::Keyboard::F1;
|
||||
case XK_F2: return sf::Keyboard::F2;
|
||||
case XK_F3: return sf::Keyboard::F3;
|
||||
case XK_F4: return sf::Keyboard::F4;
|
||||
case XK_F5: return sf::Keyboard::F5;
|
||||
case XK_F6: return sf::Keyboard::F6;
|
||||
case XK_F7: return sf::Keyboard::F7;
|
||||
case XK_F8: return sf::Keyboard::F8;
|
||||
case XK_F9: return sf::Keyboard::F9;
|
||||
case XK_F10: return sf::Keyboard::F10;
|
||||
case XK_F11: return sf::Keyboard::F11;
|
||||
case XK_F12: return sf::Keyboard::F12;
|
||||
case XK_F13: return sf::Keyboard::F13;
|
||||
case XK_F14: return sf::Keyboard::F14;
|
||||
case XK_F15: return sf::Keyboard::F15;
|
||||
case XK_Left: return sf::Keyboard::Left;
|
||||
case XK_Right: return sf::Keyboard::Right;
|
||||
case XK_Up: return sf::Keyboard::Up;
|
||||
case XK_Down: return sf::Keyboard::Down;
|
||||
case XK_KP_Insert: return sf::Keyboard::Numpad0;
|
||||
case XK_KP_End: return sf::Keyboard::Numpad1;
|
||||
case XK_KP_Down: return sf::Keyboard::Numpad2;
|
||||
case XK_KP_Page_Down: return sf::Keyboard::Numpad3;
|
||||
case XK_KP_Left: return sf::Keyboard::Numpad4;
|
||||
case XK_KP_Begin: return sf::Keyboard::Numpad5;
|
||||
case XK_KP_Right: return sf::Keyboard::Numpad6;
|
||||
case XK_KP_Home: return sf::Keyboard::Numpad7;
|
||||
case XK_KP_Up: return sf::Keyboard::Numpad8;
|
||||
case XK_KP_Page_Up: return sf::Keyboard::Numpad9;
|
||||
case XK_a: return sf::Keyboard::A;
|
||||
case XK_b: return sf::Keyboard::B;
|
||||
case XK_c: return sf::Keyboard::C;
|
||||
case XK_d: return sf::Keyboard::D;
|
||||
case XK_e: return sf::Keyboard::E;
|
||||
case XK_f: return sf::Keyboard::F;
|
||||
case XK_g: return sf::Keyboard::G;
|
||||
case XK_h: return sf::Keyboard::H;
|
||||
case XK_i: return sf::Keyboard::I;
|
||||
case XK_j: return sf::Keyboard::J;
|
||||
case XK_k: return sf::Keyboard::K;
|
||||
case XK_l: return sf::Keyboard::L;
|
||||
case XK_m: return sf::Keyboard::M;
|
||||
case XK_n: return sf::Keyboard::N;
|
||||
case XK_o: return sf::Keyboard::O;
|
||||
case XK_p: return sf::Keyboard::P;
|
||||
case XK_q: return sf::Keyboard::Q;
|
||||
case XK_r: return sf::Keyboard::R;
|
||||
case XK_s: return sf::Keyboard::S;
|
||||
case XK_t: return sf::Keyboard::T;
|
||||
case XK_u: return sf::Keyboard::U;
|
||||
case XK_v: return sf::Keyboard::V;
|
||||
case XK_w: return sf::Keyboard::W;
|
||||
case XK_x: return sf::Keyboard::X;
|
||||
case XK_y: return sf::Keyboard::Y;
|
||||
case XK_z: return sf::Keyboard::Z;
|
||||
case XK_0: return sf::Keyboard::Num0;
|
||||
case XK_1: return sf::Keyboard::Num1;
|
||||
case XK_2: return sf::Keyboard::Num2;
|
||||
case XK_3: return sf::Keyboard::Num3;
|
||||
case XK_4: return sf::Keyboard::Num4;
|
||||
case XK_5: return sf::Keyboard::Num5;
|
||||
case XK_6: return sf::Keyboard::Num6;
|
||||
case XK_7: return sf::Keyboard::Num7;
|
||||
case XK_8: return sf::Keyboard::Num8;
|
||||
case XK_9: return sf::Keyboard::Num9;
|
||||
case XK_Shift_L: return Keyboard::LShift;
|
||||
case XK_Shift_R: return Keyboard::RShift;
|
||||
case XK_Control_L: return Keyboard::LControl;
|
||||
case XK_Control_R: return Keyboard::RControl;
|
||||
case XK_Alt_L: return Keyboard::LAlt;
|
||||
case XK_Alt_R: return Keyboard::RAlt;
|
||||
case XK_Super_L: return Keyboard::LSystem;
|
||||
case XK_Super_R: return Keyboard::RSystem;
|
||||
case XK_Menu: return Keyboard::Menu;
|
||||
case XK_Escape: return Keyboard::Escape;
|
||||
case XK_semicolon: return Keyboard::SemiColon;
|
||||
case XK_slash: return Keyboard::Slash;
|
||||
case XK_equal: return Keyboard::Equal;
|
||||
case XK_minus: return Keyboard::Dash;
|
||||
case XK_bracketleft: return Keyboard::LBracket;
|
||||
case XK_bracketright: return Keyboard::RBracket;
|
||||
case XK_comma: return Keyboard::Comma;
|
||||
case XK_period: return Keyboard::Period;
|
||||
case XK_apostrophe: return Keyboard::Quote;
|
||||
case XK_backslash: return Keyboard::BackSlash;
|
||||
case XK_grave: return Keyboard::Tilde;
|
||||
case XK_space: return Keyboard::Space;
|
||||
case XK_Return: return Keyboard::Return;
|
||||
case XK_KP_Enter: return Keyboard::Return;
|
||||
case XK_BackSpace: return Keyboard::BackSpace;
|
||||
case XK_Tab: return Keyboard::Tab;
|
||||
case XK_Prior: return Keyboard::PageUp;
|
||||
case XK_Next: return Keyboard::PageDown;
|
||||
case XK_End: return Keyboard::End;
|
||||
case XK_Home: return Keyboard::Home;
|
||||
case XK_Insert: return Keyboard::Insert;
|
||||
case XK_Delete: return Keyboard::Delete;
|
||||
case XK_KP_Add: return Keyboard::Add;
|
||||
case XK_KP_Subtract: return Keyboard::Subtract;
|
||||
case XK_KP_Multiply: return Keyboard::Multiply;
|
||||
case XK_KP_Divide: return Keyboard::Divide;
|
||||
case XK_Pause: return Keyboard::Pause;
|
||||
case XK_F1: return Keyboard::F1;
|
||||
case XK_F2: return Keyboard::F2;
|
||||
case XK_F3: return Keyboard::F3;
|
||||
case XK_F4: return Keyboard::F4;
|
||||
case XK_F5: return Keyboard::F5;
|
||||
case XK_F6: return Keyboard::F6;
|
||||
case XK_F7: return Keyboard::F7;
|
||||
case XK_F8: return Keyboard::F8;
|
||||
case XK_F9: return Keyboard::F9;
|
||||
case XK_F10: return Keyboard::F10;
|
||||
case XK_F11: return Keyboard::F11;
|
||||
case XK_F12: return Keyboard::F12;
|
||||
case XK_F13: return Keyboard::F13;
|
||||
case XK_F14: return Keyboard::F14;
|
||||
case XK_F15: return Keyboard::F15;
|
||||
case XK_Left: return Keyboard::Left;
|
||||
case XK_Right: return Keyboard::Right;
|
||||
case XK_Up: return Keyboard::Up;
|
||||
case XK_Down: return Keyboard::Down;
|
||||
case XK_KP_Insert: return Keyboard::Numpad0;
|
||||
case XK_KP_End: return Keyboard::Numpad1;
|
||||
case XK_KP_Down: return Keyboard::Numpad2;
|
||||
case XK_KP_Page_Down: return Keyboard::Numpad3;
|
||||
case XK_KP_Left: return Keyboard::Numpad4;
|
||||
case XK_KP_Begin: return Keyboard::Numpad5;
|
||||
case XK_KP_Right: return Keyboard::Numpad6;
|
||||
case XK_KP_Home: return Keyboard::Numpad7;
|
||||
case XK_KP_Up: return Keyboard::Numpad8;
|
||||
case XK_KP_Page_Up: return Keyboard::Numpad9;
|
||||
case XK_a: return Keyboard::A;
|
||||
case XK_b: return Keyboard::B;
|
||||
case XK_c: return Keyboard::C;
|
||||
case XK_d: return Keyboard::D;
|
||||
case XK_e: return Keyboard::E;
|
||||
case XK_f: return Keyboard::F;
|
||||
case XK_g: return Keyboard::G;
|
||||
case XK_h: return Keyboard::H;
|
||||
case XK_i: return Keyboard::I;
|
||||
case XK_j: return Keyboard::J;
|
||||
case XK_k: return Keyboard::K;
|
||||
case XK_l: return Keyboard::L;
|
||||
case XK_m: return Keyboard::M;
|
||||
case XK_n: return Keyboard::N;
|
||||
case XK_o: return Keyboard::O;
|
||||
case XK_p: return Keyboard::P;
|
||||
case XK_q: return Keyboard::Q;
|
||||
case XK_r: return Keyboard::R;
|
||||
case XK_s: return Keyboard::S;
|
||||
case XK_t: return Keyboard::T;
|
||||
case XK_u: return Keyboard::U;
|
||||
case XK_v: return Keyboard::V;
|
||||
case XK_w: return Keyboard::W;
|
||||
case XK_x: return Keyboard::X;
|
||||
case XK_y: return Keyboard::Y;
|
||||
case XK_z: return Keyboard::Z;
|
||||
case XK_0: return Keyboard::Num0;
|
||||
case XK_1: return Keyboard::Num1;
|
||||
case XK_2: return Keyboard::Num2;
|
||||
case XK_3: return Keyboard::Num3;
|
||||
case XK_4: return Keyboard::Num4;
|
||||
case XK_5: return Keyboard::Num5;
|
||||
case XK_6: return Keyboard::Num6;
|
||||
case XK_7: return Keyboard::Num7;
|
||||
case XK_8: return Keyboard::Num8;
|
||||
case XK_9: return Keyboard::Num9;
|
||||
}
|
||||
|
||||
return sf::Keyboard::Unknown;
|
||||
return Keyboard::Unknown;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Convert sf::Keyboard::Key to X11 KeySym
|
||||
/// \brief Convert Keyboard::Key to X11 KeySym
|
||||
///
|
||||
/// \param key X11 sf::Keyboard::Key
|
||||
/// \param key X11 Keyboard::Key
|
||||
///
|
||||
/// \return The corresponding X11 KeySym
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
inline KeySym SFKeyToKeySym(sf::Keyboard::Key key)
|
||||
inline KeySym SFKeyToKeySym(Keyboard::Key key)
|
||||
{
|
||||
// Get the corresponding X11 keysym
|
||||
KeySym keysym = NoSymbol;
|
||||
switch (key)
|
||||
{
|
||||
case sf::Keyboard::LShift: keysym = XK_Shift_L; break;
|
||||
case sf::Keyboard::RShift: keysym = XK_Shift_R; break;
|
||||
case sf::Keyboard::LControl: keysym = XK_Control_L; break;
|
||||
case sf::Keyboard::RControl: keysym = XK_Control_R; break;
|
||||
case sf::Keyboard::LAlt: keysym = XK_Alt_L; break;
|
||||
case sf::Keyboard::RAlt: keysym = XK_Alt_R; break;
|
||||
case sf::Keyboard::LSystem: keysym = XK_Super_L; break;
|
||||
case sf::Keyboard::RSystem: keysym = XK_Super_R; break;
|
||||
case sf::Keyboard::Menu: keysym = XK_Menu; break;
|
||||
case sf::Keyboard::Escape: keysym = XK_Escape; break;
|
||||
case sf::Keyboard::SemiColon: keysym = XK_semicolon; break;
|
||||
case sf::Keyboard::Slash: keysym = XK_slash; break;
|
||||
case sf::Keyboard::Equal: keysym = XK_equal; break;
|
||||
case sf::Keyboard::Dash: keysym = XK_minus; break;
|
||||
case sf::Keyboard::LBracket: keysym = XK_bracketleft; break;
|
||||
case sf::Keyboard::RBracket: keysym = XK_bracketright; break;
|
||||
case sf::Keyboard::Comma: keysym = XK_comma; break;
|
||||
case sf::Keyboard::Period: keysym = XK_period; break;
|
||||
case sf::Keyboard::Quote: keysym = XK_apostrophe; break;
|
||||
case sf::Keyboard::BackSlash: keysym = XK_backslash; break;
|
||||
case sf::Keyboard::Tilde: keysym = XK_grave; break;
|
||||
case sf::Keyboard::Space: keysym = XK_space; break;
|
||||
case sf::Keyboard::Return: keysym = XK_Return; break;
|
||||
case sf::Keyboard::BackSpace: keysym = XK_BackSpace; break;
|
||||
case sf::Keyboard::Tab: keysym = XK_Tab; break;
|
||||
case sf::Keyboard::PageUp: keysym = XK_Prior; break;
|
||||
case sf::Keyboard::PageDown: keysym = XK_Next; break;
|
||||
case sf::Keyboard::End: keysym = XK_End; break;
|
||||
case sf::Keyboard::Home: keysym = XK_Home; break;
|
||||
case sf::Keyboard::Insert: keysym = XK_Insert; break;
|
||||
case sf::Keyboard::Delete: keysym = XK_Delete; break;
|
||||
case sf::Keyboard::Add: keysym = XK_KP_Add; break;
|
||||
case sf::Keyboard::Subtract: keysym = XK_KP_Subtract; break;
|
||||
case sf::Keyboard::Multiply: keysym = XK_KP_Multiply; break;
|
||||
case sf::Keyboard::Divide: keysym = XK_KP_Divide; break;
|
||||
case sf::Keyboard::Pause: keysym = XK_Pause; break;
|
||||
case sf::Keyboard::F1: keysym = XK_F1; break;
|
||||
case sf::Keyboard::F2: keysym = XK_F2; break;
|
||||
case sf::Keyboard::F3: keysym = XK_F3; break;
|
||||
case sf::Keyboard::F4: keysym = XK_F4; break;
|
||||
case sf::Keyboard::F5: keysym = XK_F5; break;
|
||||
case sf::Keyboard::F6: keysym = XK_F6; break;
|
||||
case sf::Keyboard::F7: keysym = XK_F7; break;
|
||||
case sf::Keyboard::F8: keysym = XK_F8; break;
|
||||
case sf::Keyboard::F9: keysym = XK_F9; break;
|
||||
case sf::Keyboard::F10: keysym = XK_F10; break;
|
||||
case sf::Keyboard::F11: keysym = XK_F11; break;
|
||||
case sf::Keyboard::F12: keysym = XK_F12; break;
|
||||
case sf::Keyboard::F13: keysym = XK_F13; break;
|
||||
case sf::Keyboard::F14: keysym = XK_F14; break;
|
||||
case sf::Keyboard::F15: keysym = XK_F15; break;
|
||||
case sf::Keyboard::Left: keysym = XK_Left; break;
|
||||
case sf::Keyboard::Right: keysym = XK_Right; break;
|
||||
case sf::Keyboard::Up: keysym = XK_Up; break;
|
||||
case sf::Keyboard::Down: keysym = XK_Down; break;
|
||||
case sf::Keyboard::Numpad0: keysym = XK_KP_Insert; break;
|
||||
case sf::Keyboard::Numpad1: keysym = XK_KP_End; break;
|
||||
case sf::Keyboard::Numpad2: keysym = XK_KP_Down; break;
|
||||
case sf::Keyboard::Numpad3: keysym = XK_KP_Page_Down; break;
|
||||
case sf::Keyboard::Numpad4: keysym = XK_KP_Left; break;
|
||||
case sf::Keyboard::Numpad5: keysym = XK_KP_Begin; break;
|
||||
case sf::Keyboard::Numpad6: keysym = XK_KP_Right; break;
|
||||
case sf::Keyboard::Numpad7: keysym = XK_KP_Home; break;
|
||||
case sf::Keyboard::Numpad8: keysym = XK_KP_Up; break;
|
||||
case sf::Keyboard::Numpad9: keysym = XK_KP_Page_Up; break;
|
||||
case sf::Keyboard::A: keysym = XK_a; break;
|
||||
case sf::Keyboard::B: keysym = XK_b; break;
|
||||
case sf::Keyboard::C: keysym = XK_c; break;
|
||||
case sf::Keyboard::D: keysym = XK_d; break;
|
||||
case sf::Keyboard::E: keysym = XK_e; break;
|
||||
case sf::Keyboard::F: keysym = XK_f; break;
|
||||
case sf::Keyboard::G: keysym = XK_g; break;
|
||||
case sf::Keyboard::H: keysym = XK_h; break;
|
||||
case sf::Keyboard::I: keysym = XK_i; break;
|
||||
case sf::Keyboard::J: keysym = XK_j; break;
|
||||
case sf::Keyboard::K: keysym = XK_k; break;
|
||||
case sf::Keyboard::L: keysym = XK_l; break;
|
||||
case sf::Keyboard::M: keysym = XK_m; break;
|
||||
case sf::Keyboard::N: keysym = XK_n; break;
|
||||
case sf::Keyboard::O: keysym = XK_o; break;
|
||||
case sf::Keyboard::P: keysym = XK_p; break;
|
||||
case sf::Keyboard::Q: keysym = XK_q; break;
|
||||
case sf::Keyboard::R: keysym = XK_r; break;
|
||||
case sf::Keyboard::S: keysym = XK_s; break;
|
||||
case sf::Keyboard::T: keysym = XK_t; break;
|
||||
case sf::Keyboard::U: keysym = XK_u; break;
|
||||
case sf::Keyboard::V: keysym = XK_v; break;
|
||||
case sf::Keyboard::W: keysym = XK_w; break;
|
||||
case sf::Keyboard::X: keysym = XK_x; break;
|
||||
case sf::Keyboard::Y: keysym = XK_y; break;
|
||||
case sf::Keyboard::Z: keysym = XK_z; break;
|
||||
case sf::Keyboard::Num0: keysym = XK_0; break;
|
||||
case sf::Keyboard::Num1: keysym = XK_1; break;
|
||||
case sf::Keyboard::Num2: keysym = XK_2; break;
|
||||
case sf::Keyboard::Num3: keysym = XK_3; break;
|
||||
case sf::Keyboard::Num4: keysym = XK_4; break;
|
||||
case sf::Keyboard::Num5: keysym = XK_5; break;
|
||||
case sf::Keyboard::Num6: keysym = XK_6; break;
|
||||
case sf::Keyboard::Num7: keysym = XK_7; break;
|
||||
case sf::Keyboard::Num8: keysym = XK_8; break;
|
||||
case sf::Keyboard::Num9: keysym = XK_9; break;
|
||||
case Keyboard::LShift: keysym = XK_Shift_L; break;
|
||||
case Keyboard::RShift: keysym = XK_Shift_R; break;
|
||||
case Keyboard::LControl: keysym = XK_Control_L; break;
|
||||
case Keyboard::RControl: keysym = XK_Control_R; break;
|
||||
case Keyboard::LAlt: keysym = XK_Alt_L; break;
|
||||
case Keyboard::RAlt: keysym = XK_Alt_R; break;
|
||||
case Keyboard::LSystem: keysym = XK_Super_L; break;
|
||||
case Keyboard::RSystem: keysym = XK_Super_R; break;
|
||||
case Keyboard::Menu: keysym = XK_Menu; break;
|
||||
case Keyboard::Escape: keysym = XK_Escape; break;
|
||||
case Keyboard::SemiColon: keysym = XK_semicolon; break;
|
||||
case Keyboard::Slash: keysym = XK_slash; break;
|
||||
case Keyboard::Equal: keysym = XK_equal; break;
|
||||
case Keyboard::Dash: keysym = XK_minus; break;
|
||||
case Keyboard::LBracket: keysym = XK_bracketleft; break;
|
||||
case Keyboard::RBracket: keysym = XK_bracketright; break;
|
||||
case Keyboard::Comma: keysym = XK_comma; break;
|
||||
case Keyboard::Period: keysym = XK_period; break;
|
||||
case Keyboard::Quote: keysym = XK_apostrophe; break;
|
||||
case Keyboard::BackSlash: keysym = XK_backslash; break;
|
||||
case Keyboard::Tilde: keysym = XK_grave; break;
|
||||
case Keyboard::Space: keysym = XK_space; break;
|
||||
case Keyboard::Return: keysym = XK_Return; break;
|
||||
case Keyboard::BackSpace: keysym = XK_BackSpace; break;
|
||||
case Keyboard::Tab: keysym = XK_Tab; break;
|
||||
case Keyboard::PageUp: keysym = XK_Prior; break;
|
||||
case Keyboard::PageDown: keysym = XK_Next; break;
|
||||
case Keyboard::End: keysym = XK_End; break;
|
||||
case Keyboard::Home: keysym = XK_Home; break;
|
||||
case Keyboard::Insert: keysym = XK_Insert; break;
|
||||
case Keyboard::Delete: keysym = XK_Delete; break;
|
||||
case Keyboard::Add: keysym = XK_KP_Add; break;
|
||||
case Keyboard::Subtract: keysym = XK_KP_Subtract; break;
|
||||
case Keyboard::Multiply: keysym = XK_KP_Multiply; break;
|
||||
case Keyboard::Divide: keysym = XK_KP_Divide; break;
|
||||
case Keyboard::Pause: keysym = XK_Pause; break;
|
||||
case Keyboard::F1: keysym = XK_F1; break;
|
||||
case Keyboard::F2: keysym = XK_F2; break;
|
||||
case Keyboard::F3: keysym = XK_F3; break;
|
||||
case Keyboard::F4: keysym = XK_F4; break;
|
||||
case Keyboard::F5: keysym = XK_F5; break;
|
||||
case Keyboard::F6: keysym = XK_F6; break;
|
||||
case Keyboard::F7: keysym = XK_F7; break;
|
||||
case Keyboard::F8: keysym = XK_F8; break;
|
||||
case Keyboard::F9: keysym = XK_F9; break;
|
||||
case Keyboard::F10: keysym = XK_F10; break;
|
||||
case Keyboard::F11: keysym = XK_F11; break;
|
||||
case Keyboard::F12: keysym = XK_F12; break;
|
||||
case Keyboard::F13: keysym = XK_F13; break;
|
||||
case Keyboard::F14: keysym = XK_F14; break;
|
||||
case Keyboard::F15: keysym = XK_F15; break;
|
||||
case Keyboard::Left: keysym = XK_Left; break;
|
||||
case Keyboard::Right: keysym = XK_Right; break;
|
||||
case Keyboard::Up: keysym = XK_Up; break;
|
||||
case Keyboard::Down: keysym = XK_Down; break;
|
||||
case Keyboard::Numpad0: keysym = XK_KP_Insert; break;
|
||||
case Keyboard::Numpad1: keysym = XK_KP_End; break;
|
||||
case Keyboard::Numpad2: keysym = XK_KP_Down; break;
|
||||
case Keyboard::Numpad3: keysym = XK_KP_Page_Down; break;
|
||||
case Keyboard::Numpad4: keysym = XK_KP_Left; break;
|
||||
case Keyboard::Numpad5: keysym = XK_KP_Begin; break;
|
||||
case Keyboard::Numpad6: keysym = XK_KP_Right; break;
|
||||
case Keyboard::Numpad7: keysym = XK_KP_Home; break;
|
||||
case Keyboard::Numpad8: keysym = XK_KP_Up; break;
|
||||
case Keyboard::Numpad9: keysym = XK_KP_Page_Up; break;
|
||||
case Keyboard::A: keysym = XK_a; break;
|
||||
case Keyboard::B: keysym = XK_b; break;
|
||||
case Keyboard::C: keysym = XK_c; break;
|
||||
case Keyboard::D: keysym = XK_d; break;
|
||||
case Keyboard::E: keysym = XK_e; break;
|
||||
case Keyboard::F: keysym = XK_f; break;
|
||||
case Keyboard::G: keysym = XK_g; break;
|
||||
case Keyboard::H: keysym = XK_h; break;
|
||||
case Keyboard::I: keysym = XK_i; break;
|
||||
case Keyboard::J: keysym = XK_j; break;
|
||||
case Keyboard::K: keysym = XK_k; break;
|
||||
case Keyboard::L: keysym = XK_l; break;
|
||||
case Keyboard::M: keysym = XK_m; break;
|
||||
case Keyboard::N: keysym = XK_n; break;
|
||||
case Keyboard::O: keysym = XK_o; break;
|
||||
case Keyboard::P: keysym = XK_p; break;
|
||||
case Keyboard::Q: keysym = XK_q; break;
|
||||
case Keyboard::R: keysym = XK_r; break;
|
||||
case Keyboard::S: keysym = XK_s; break;
|
||||
case Keyboard::T: keysym = XK_t; break;
|
||||
case Keyboard::U: keysym = XK_u; break;
|
||||
case Keyboard::V: keysym = XK_v; break;
|
||||
case Keyboard::W: keysym = XK_w; break;
|
||||
case Keyboard::X: keysym = XK_x; break;
|
||||
case Keyboard::Y: keysym = XK_y; break;
|
||||
case Keyboard::Z: keysym = XK_z; break;
|
||||
case Keyboard::Num0: keysym = XK_0; break;
|
||||
case Keyboard::Num1: keysym = XK_1; break;
|
||||
case Keyboard::Num2: keysym = XK_2; break;
|
||||
case Keyboard::Num3: keysym = XK_3; break;
|
||||
case Keyboard::Num4: keysym = XK_4; break;
|
||||
case Keyboard::Num5: keysym = XK_5; break;
|
||||
case Keyboard::Num6: keysym = XK_6; break;
|
||||
case Keyboard::Num7: keysym = XK_7; break;
|
||||
case Keyboard::Num8: keysym = XK_8; break;
|
||||
case Keyboard::Num9: keysym = XK_9; break;
|
||||
default: keysym = 0; break;
|
||||
}
|
||||
return keysym;
|
||||
|
|
|
@ -35,11 +35,6 @@
|
|||
#include <X11/Xutil.h>
|
||||
#include <cstring>
|
||||
|
||||
namespace sf
|
||||
{
|
||||
namespace priv
|
||||
{
|
||||
|
||||
namespace {
|
||||
|
||||
KeyCode scancodeToKeycode[sf::Keyboard::ScanCodeCount] = { 0 }; ///< Mapping of SFML scancode to X11 KeyCode
|
||||
|
@ -230,7 +225,7 @@ sf::Keyboard::Scancode translateKeyCode(Display* display, KeyCode keycode)
|
|||
|
||||
void initMapping()
|
||||
{
|
||||
Display* display = OpenDisplay();
|
||||
Display* display = sf::priv::OpenDisplay();
|
||||
|
||||
// Find the X11 key code -> SFML key code mapping
|
||||
// This code was inspired by GLFW implementation
|
||||
|
@ -317,7 +312,7 @@ void initMapping()
|
|||
}
|
||||
}
|
||||
|
||||
CloseDisplay(display);
|
||||
sf::priv::CloseDisplay(display);
|
||||
|
||||
isMappingInitialized = true;
|
||||
}
|
||||
|
@ -345,12 +340,12 @@ sf::Keyboard::Scancode keyCodeToSFScancode(KeyCode code)
|
|||
////////////////////////////////////////////////////////////
|
||||
KeyCode SFKeyToKeyCode(sf::Keyboard::Key key)
|
||||
{
|
||||
KeySym keysym = SFKeyToKeySym(key);
|
||||
KeySym keysym = sf::priv::SFKeyToKeySym(key);
|
||||
if (keysym != NoSymbol)
|
||||
{
|
||||
Display* display = OpenDisplay();
|
||||
Display* display = sf::priv::OpenDisplay();
|
||||
KeyCode keycode = XKeysymToKeycode(display, keysym);
|
||||
CloseDisplay(display);
|
||||
sf::priv::CloseDisplay(display);
|
||||
return keycode;
|
||||
}
|
||||
return 0;
|
||||
|
@ -359,12 +354,12 @@ KeyCode SFKeyToKeyCode(sf::Keyboard::Key key)
|
|||
////////////////////////////////////////////////////////////
|
||||
KeySym SFScancodeToKeySym(sf::Keyboard::Scancode code)
|
||||
{
|
||||
Display* display = OpenDisplay();
|
||||
Display* display = sf::priv::OpenDisplay();
|
||||
KeySym keysym = NoSymbol;
|
||||
KeyCode keycode = SFScancodeToKeyCode(code);
|
||||
if (keycode != 0) // ensure that this Scancode is mapped to keycode
|
||||
keysym = XkbKeycodeToKeysym(display, keycode, 0, 0);
|
||||
CloseDisplay(display);
|
||||
sf::priv::CloseDisplay(display);
|
||||
return keysym;
|
||||
}
|
||||
|
||||
|
@ -373,13 +368,13 @@ bool isKeyPressedImpl(KeyCode keycode)
|
|||
{
|
||||
if (keycode != 0)
|
||||
{
|
||||
Display* display = OpenDisplay();
|
||||
Display* display = sf::priv::OpenDisplay();
|
||||
|
||||
// Get the whole keyboard state
|
||||
char keys[32];
|
||||
XQueryKeymap(display, keys);
|
||||
|
||||
CloseDisplay(display);
|
||||
sf::priv::CloseDisplay(display);
|
||||
|
||||
// Check our keycode
|
||||
return (keys[keycode / 8] & (1 << (keycode % 8))) != 0;
|
||||
|
@ -389,8 +384,13 @@ bool isKeyPressedImpl(KeyCode keycode)
|
|||
|
||||
} // anonymous namespace
|
||||
|
||||
namespace sf
|
||||
{
|
||||
namespace priv
|
||||
{
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
bool KeyboardImpl::isKeyPressed(sf::Keyboard::Key key)
|
||||
bool KeyboardImpl::isKeyPressed(Keyboard::Key key)
|
||||
{
|
||||
KeyCode keycode = SFKeyToKeyCode(key);
|
||||
return isKeyPressedImpl(keycode);
|
||||
|
@ -398,7 +398,7 @@ bool KeyboardImpl::isKeyPressed(sf::Keyboard::Key key)
|
|||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
bool KeyboardImpl::isKeyPressed(sf::Keyboard::Scancode code)
|
||||
bool KeyboardImpl::isKeyPressed(Keyboard::Scancode code)
|
||||
{
|
||||
KeyCode keycode = SFScancodeToKeyCode(code);
|
||||
return isKeyPressedImpl(keycode);
|
||||
|
@ -406,7 +406,7 @@ bool KeyboardImpl::isKeyPressed(sf::Keyboard::Scancode code)
|
|||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sf::Keyboard::Scancode KeyboardImpl::unlocalize(sf::Keyboard::Key key)
|
||||
Keyboard::Scancode KeyboardImpl::unlocalize(Keyboard::Key key)
|
||||
{
|
||||
KeyCode keycode = SFKeyToKeyCode(key);
|
||||
return keyCodeToSFScancode(keycode);
|
||||
|
@ -414,25 +414,25 @@ sf::Keyboard::Scancode KeyboardImpl::unlocalize(sf::Keyboard::Key key)
|
|||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sf::Keyboard::Key KeyboardImpl::localize(sf::Keyboard::Scancode code)
|
||||
Keyboard::Key KeyboardImpl::localize(Keyboard::Scancode code)
|
||||
{
|
||||
KeySym keysym = SFScancodeToKeySym(code);
|
||||
return keySymToSFKey(keysym);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sf::String KeyboardImpl::getDescription(Keyboard::Scancode code)
|
||||
String KeyboardImpl::getDescription(Keyboard::Scancode code)
|
||||
{
|
||||
bool checkInput = true;
|
||||
|
||||
// these scancodes actually correspond to keys with input
|
||||
// but we want to return their description, not their behaviour
|
||||
if (code == sf::Keyboard::ScanEnter ||
|
||||
code == sf::Keyboard::ScanReturn ||
|
||||
code == sf::Keyboard::ScanTab ||
|
||||
code == sf::Keyboard::ScanDelete ||
|
||||
code == sf::Keyboard::ScanBackspace ||
|
||||
code == sf::Keyboard::ScanSpace)
|
||||
if (code == Keyboard::ScanEnter ||
|
||||
code == Keyboard::ScanReturn ||
|
||||
code == Keyboard::ScanTab ||
|
||||
code == Keyboard::ScanDelete ||
|
||||
code == Keyboard::ScanBackspace ||
|
||||
code == Keyboard::ScanSpace)
|
||||
{
|
||||
checkInput = false;
|
||||
}
|
||||
|
@ -440,98 +440,98 @@ sf::String KeyboardImpl::getDescription(Keyboard::Scancode code)
|
|||
if (checkInput)
|
||||
{
|
||||
KeySym keysym = SFScancodeToKeySym(code);
|
||||
sf::Uint32 unicode = keysymToUnicode(keysym);
|
||||
Uint32 unicode = keysymToUnicode(keysym);
|
||||
|
||||
if (unicode != 0)
|
||||
return sf::String(unicode);
|
||||
return String(unicode);
|
||||
}
|
||||
|
||||
// Fallback to our best guess for the keys that are known to be independent of the layout.
|
||||
switch (code)
|
||||
{
|
||||
case sf::Keyboard::ScanEnter: return "Enter";
|
||||
case sf::Keyboard::ScanEscape: return "Escape";
|
||||
case sf::Keyboard::ScanBackspace: return "Backspace";
|
||||
case sf::Keyboard::ScanTab: return "Tab";
|
||||
case sf::Keyboard::ScanSpace: return "Space";
|
||||
case Keyboard::ScanEnter: return "Enter";
|
||||
case Keyboard::ScanEscape: return "Escape";
|
||||
case Keyboard::ScanBackspace: return "Backspace";
|
||||
case Keyboard::ScanTab: return "Tab";
|
||||
case Keyboard::ScanSpace: return "Space";
|
||||
|
||||
case sf::Keyboard::ScanF1: return "F1";
|
||||
case sf::Keyboard::ScanF2: return "F2";
|
||||
case sf::Keyboard::ScanF3: return "F3";
|
||||
case sf::Keyboard::ScanF4: return "F4";
|
||||
case sf::Keyboard::ScanF5: return "F5";
|
||||
case sf::Keyboard::ScanF6: return "F6";
|
||||
case sf::Keyboard::ScanF7: return "F7";
|
||||
case sf::Keyboard::ScanF8: return "F8";
|
||||
case sf::Keyboard::ScanF9: return "F9";
|
||||
case sf::Keyboard::ScanF10: return "F10";
|
||||
case sf::Keyboard::ScanF11: return "F11";
|
||||
case sf::Keyboard::ScanF12: return "F12";
|
||||
case sf::Keyboard::ScanF13: return "F13";
|
||||
case sf::Keyboard::ScanF14: return "F14";
|
||||
case sf::Keyboard::ScanF15: return "F15";
|
||||
case Keyboard::ScanF1: return "F1";
|
||||
case Keyboard::ScanF2: return "F2";
|
||||
case Keyboard::ScanF3: return "F3";
|
||||
case Keyboard::ScanF4: return "F4";
|
||||
case Keyboard::ScanF5: return "F5";
|
||||
case Keyboard::ScanF6: return "F6";
|
||||
case Keyboard::ScanF7: return "F7";
|
||||
case Keyboard::ScanF8: return "F8";
|
||||
case Keyboard::ScanF9: return "F9";
|
||||
case Keyboard::ScanF10: return "F10";
|
||||
case Keyboard::ScanF11: return "F11";
|
||||
case Keyboard::ScanF12: return "F12";
|
||||
case Keyboard::ScanF13: return "F13";
|
||||
case Keyboard::ScanF14: return "F14";
|
||||
case Keyboard::ScanF15: return "F15";
|
||||
|
||||
case sf::Keyboard::ScanCapsLock: return "CapsLock";
|
||||
case sf::Keyboard::ScanPrintScreen: return "PrintScreen";
|
||||
case sf::Keyboard::ScanScrollLock: return "ScrollLock";
|
||||
case Keyboard::ScanCapsLock: return "CapsLock";
|
||||
case Keyboard::ScanPrintScreen: return "PrintScreen";
|
||||
case Keyboard::ScanScrollLock: return "ScrollLock";
|
||||
|
||||
case sf::Keyboard::ScanPause: return "Pause";
|
||||
case sf::Keyboard::ScanInsert: return "Insert";
|
||||
case sf::Keyboard::ScanHome: return "Home";
|
||||
case sf::Keyboard::ScanPageUp: return "PageUp";
|
||||
case sf::Keyboard::ScanDelete: return "Delete";
|
||||
case sf::Keyboard::ScanEnd: return "End";
|
||||
case sf::Keyboard::ScanPageDown: return "PageDown";
|
||||
case Keyboard::ScanPause: return "Pause";
|
||||
case Keyboard::ScanInsert: return "Insert";
|
||||
case Keyboard::ScanHome: return "Home";
|
||||
case Keyboard::ScanPageUp: return "PageUp";
|
||||
case Keyboard::ScanDelete: return "Delete";
|
||||
case Keyboard::ScanEnd: return "End";
|
||||
case Keyboard::ScanPageDown: return "PageDown";
|
||||
|
||||
case sf::Keyboard::ScanLeft: return "Left Arrow";
|
||||
case sf::Keyboard::ScanRight: return "Right Arrow";
|
||||
case sf::Keyboard::ScanDown: return "Down Arrow";
|
||||
case sf::Keyboard::ScanUp: return "Up Arrow";
|
||||
case Keyboard::ScanLeft: return "Left Arrow";
|
||||
case Keyboard::ScanRight: return "Right Arrow";
|
||||
case Keyboard::ScanDown: return "Down Arrow";
|
||||
case Keyboard::ScanUp: return "Up Arrow";
|
||||
|
||||
case sf::Keyboard::ScanNumLock: return "NumLock";
|
||||
case sf::Keyboard::ScanDivide: return "Divide (Numpad)";
|
||||
case sf::Keyboard::ScanMultiply: return "Multiply (Numpad)";
|
||||
case sf::Keyboard::ScanMinus: return "Minux (Numpad)";
|
||||
case sf::Keyboard::ScanPlus: return "Plus (Numpad)";
|
||||
case sf::Keyboard::ScanPadEquals: return "Equals (Numpad)";
|
||||
case sf::Keyboard::ScanReturn: return "Return (Numpad)";
|
||||
case sf::Keyboard::ScanDecimal: return "Decimal (Numpad)";
|
||||
case Keyboard::ScanNumLock: return "NumLock";
|
||||
case Keyboard::ScanDivide: return "Divide (Numpad)";
|
||||
case Keyboard::ScanMultiply: return "Multiply (Numpad)";
|
||||
case Keyboard::ScanMinus: return "Minux (Numpad)";
|
||||
case Keyboard::ScanPlus: return "Plus (Numpad)";
|
||||
case Keyboard::ScanPadEquals: return "Equals (Numpad)";
|
||||
case Keyboard::ScanReturn: return "Return (Numpad)";
|
||||
case Keyboard::ScanDecimal: return "Decimal (Numpad)";
|
||||
|
||||
case sf::Keyboard::ScanNumpad0: return "0 (Numpad)";
|
||||
case sf::Keyboard::ScanNumpad1: return "1 (Numpad)";
|
||||
case sf::Keyboard::ScanNumpad2: return "2 (Numpad)";
|
||||
case sf::Keyboard::ScanNumpad3: return "3 (Numpad)";
|
||||
case sf::Keyboard::ScanNumpad4: return "4 (Numpad)";
|
||||
case sf::Keyboard::ScanNumpad5: return "5 (Numpad)";
|
||||
case sf::Keyboard::ScanNumpad6: return "6 (Numpad)";
|
||||
case sf::Keyboard::ScanNumpad7: return "7 (Numpad)";
|
||||
case sf::Keyboard::ScanNumpad8: return "8 (Numpad)";
|
||||
case sf::Keyboard::ScanNumpad9: return "9 (Numpad)";
|
||||
case Keyboard::ScanNumpad0: return "0 (Numpad)";
|
||||
case Keyboard::ScanNumpad1: return "1 (Numpad)";
|
||||
case Keyboard::ScanNumpad2: return "2 (Numpad)";
|
||||
case Keyboard::ScanNumpad3: return "3 (Numpad)";
|
||||
case Keyboard::ScanNumpad4: return "4 (Numpad)";
|
||||
case Keyboard::ScanNumpad5: return "5 (Numpad)";
|
||||
case Keyboard::ScanNumpad6: return "6 (Numpad)";
|
||||
case Keyboard::ScanNumpad7: return "7 (Numpad)";
|
||||
case Keyboard::ScanNumpad8: return "8 (Numpad)";
|
||||
case Keyboard::ScanNumpad9: return "9 (Numpad)";
|
||||
|
||||
case sf::Keyboard::ScanApplication: return "Application";
|
||||
case sf::Keyboard::ScanExecute: return "Execute";
|
||||
case sf::Keyboard::ScanHelp: return "Help";
|
||||
case sf::Keyboard::ScanMenu: return "Menu";
|
||||
case sf::Keyboard::ScanSelect: return "Select";
|
||||
case sf::Keyboard::ScanStop: return "Stop";
|
||||
case sf::Keyboard::ScanAgain: return "Again";
|
||||
case sf::Keyboard::ScanUndo: return "Undo";
|
||||
case sf::Keyboard::ScanCut: return "Cut";
|
||||
case sf::Keyboard::ScanCopy: return "Copy";
|
||||
case sf::Keyboard::ScanPaste: return "Paste";
|
||||
case sf::Keyboard::ScanFind: return "Find";
|
||||
case sf::Keyboard::ScanMute: return "Mute";
|
||||
case sf::Keyboard::ScanVolumeUp: return "Volume Up";
|
||||
case sf::Keyboard::ScanVolumeDown: return "Volume Down";
|
||||
case Keyboard::ScanApplication: return "Application";
|
||||
case Keyboard::ScanExecute: return "Execute";
|
||||
case Keyboard::ScanHelp: return "Help";
|
||||
case Keyboard::ScanMenu: return "Menu";
|
||||
case Keyboard::ScanSelect: return "Select";
|
||||
case Keyboard::ScanStop: return "Stop";
|
||||
case Keyboard::ScanAgain: return "Again";
|
||||
case Keyboard::ScanUndo: return "Undo";
|
||||
case Keyboard::ScanCut: return "Cut";
|
||||
case Keyboard::ScanCopy: return "Copy";
|
||||
case Keyboard::ScanPaste: return "Paste";
|
||||
case Keyboard::ScanFind: return "Find";
|
||||
case Keyboard::ScanMute: return "Mute";
|
||||
case Keyboard::ScanVolumeUp: return "Volume Up";
|
||||
case Keyboard::ScanVolumeDown: return "Volume Down";
|
||||
|
||||
case sf::Keyboard::ScanLControl: return "Control (Left)";
|
||||
case sf::Keyboard::ScanLShift: return "Shift (Left)";
|
||||
case sf::Keyboard::ScanLAlt: return "Alt (Left)";
|
||||
case sf::Keyboard::ScanLSystem: return "Meta (Left)";
|
||||
case sf::Keyboard::ScanRControl: return "Control (Right)";
|
||||
case sf::Keyboard::ScanRShift: return "Shift (Right)";
|
||||
case sf::Keyboard::ScanRAlt: return "Alt (Right)";
|
||||
case sf::Keyboard::ScanRSystem: return "Meta (Right)";
|
||||
case Keyboard::ScanLControl: return "Control (Left)";
|
||||
case Keyboard::ScanLShift: return "Shift (Left)";
|
||||
case Keyboard::ScanLAlt: return "Alt (Left)";
|
||||
case Keyboard::ScanLSystem: return "Meta (Left)";
|
||||
case Keyboard::ScanRControl: return "Control (Right)";
|
||||
case Keyboard::ScanRShift: return "Shift (Right)";
|
||||
case Keyboard::ScanRAlt: return "Alt (Right)";
|
||||
case Keyboard::ScanRSystem: return "Meta (Right)";
|
||||
}
|
||||
|
||||
return "Unknown Scancode"; // no guess good enough possible.
|
||||
|
@ -539,9 +539,9 @@ sf::String KeyboardImpl::getDescription(Keyboard::Scancode code)
|
|||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sf::Keyboard::Key KeyboardImpl::getKeyFromEvent(XKeyEvent& event)
|
||||
Keyboard::Key KeyboardImpl::getKeyFromEvent(XKeyEvent& event)
|
||||
{
|
||||
sf::Keyboard::Key key = Keyboard::Unknown;
|
||||
Keyboard::Key key = Keyboard::Unknown;
|
||||
|
||||
// Try each KeySym index (modifier group) until we get a match
|
||||
for (int i = 0; i < 4; ++i)
|
||||
|
@ -558,7 +558,7 @@ sf::Keyboard::Key KeyboardImpl::getKeyFromEvent(XKeyEvent& event)
|
|||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sf::Keyboard::Scancode KeyboardImpl::getScancodeFromEvent(XKeyEvent& event)
|
||||
Keyboard::Scancode KeyboardImpl::getScancodeFromEvent(XKeyEvent& event)
|
||||
{
|
||||
return keyCodeToSFScancode(event.keycode);
|
||||
}
|
||||
|
|
|
@ -52,31 +52,31 @@ public:
|
|||
/// \copydoc sf::Keyboard::isKeyPressed(Key)
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
static bool isKeyPressed(sf::Keyboard::Key key);
|
||||
static bool isKeyPressed(Keyboard::Key key);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \copydoc sf::Keyboard::isKeyPressed(Scancode)
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
static bool isKeyPressed(sf::Keyboard::Scancode code);
|
||||
static bool isKeyPressed(Keyboard::Scancode code);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \copydoc sf::Keyboard::localize
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
static sf::Keyboard::Scancode unlocalize(sf::Keyboard::Key key);
|
||||
static Keyboard::Scancode unlocalize(Keyboard::Key key);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \copydoc sf::Keyboard::unlocalize
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
static sf::Keyboard::Key localize(sf::Keyboard::Scancode code);
|
||||
static Keyboard::Key localize(Keyboard::Scancode code);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \copydoc sf::Keyboard::getDescription
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
static sf::String getDescription(Keyboard::Scancode code);
|
||||
static String getDescription(Keyboard::Scancode code);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the sf::Keyboard::Key from XKeyEvent
|
||||
|
@ -86,7 +86,7 @@ public:
|
|||
/// \return A key being pressed or released
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
static sf::Keyboard::Key getKeyFromEvent(XKeyEvent& event);
|
||||
static Keyboard::Key getKeyFromEvent(XKeyEvent& event);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the sf::Keyboard::Scancode from XKeyEvent
|
||||
|
@ -96,7 +96,7 @@ public:
|
|||
/// \return A scancode of a key being pressed or released
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
static sf::Keyboard::Scancode getScancodeFromEvent(XKeyEvent& event);
|
||||
static Keyboard::Scancode getScancodeFromEvent(XKeyEvent& event);
|
||||
};
|
||||
|
||||
} // namespace priv
|
||||
|
|
Loading…
Reference in a new issue