Add initial dummy scancode implementation on Linux (DRM)

This commit is contained in:
kimci86 2022-06-23 22:37:34 +02:00 committed by Lukas Dürrenberger
parent a717ce66e1
commit aba54925d8
2 changed files with 61 additions and 7 deletions

View File

@ -407,6 +407,7 @@ namespace
// //
event.type = inputEvent.value ? sf::Event::KeyPressed : sf::Event::KeyReleased; event.type = inputEvent.value ? sf::Event::KeyPressed : sf::Event::KeyReleased;
event.key.code = kb; event.key.code = kb;
event.key.scancode = sf::Keyboard::Scan::Unknown; // TODO: not implemented
event.key.alt = altDown(); event.key.alt = altDown();
event.key.control = controlDown(); event.key.control = controlDown();
event.key.shift = shiftDown(); event.key.shift = shiftDown();
@ -567,6 +568,41 @@ bool InputImpl::isKeyPressed(Keyboard::Key key)
return keyMap[static_cast<std::size_t>(key)]; return keyMap[static_cast<std::size_t>(key)];
} }
////////////////////////////////////////////////////////////
bool InputImpl::isKeyPressed(Keyboard::Scancode /* code */)
{
// TODO: not implemented
err() << "sf::Keyboard::isKeyPressed(Keyboard::Scancode) is not implemented for DRM." << std::endl;
return false;
}
////////////////////////////////////////////////////////////
Keyboard::Key InputImpl::localize(Keyboard::Scancode /* code */)
{
// TODO: not implemented
err() << "sf::Keyboard::localize is not implemented for DRM." << std::endl;
return Keyboard::Unknown;
}
////////////////////////////////////////////////////////////
Keyboard::Scancode InputImpl::delocalize(Keyboard::Key /* key */)
{
// TODO: not implemented
err() << "sf::Keyboard::delocalize is not implemented for DRM." << std::endl;
return Keyboard::Scan::Unknown;
}
////////////////////////////////////////////////////////////
String InputImpl::getDescription(Keyboard::Scancode /* code */)
{
// TODO: not implemented
err() << "sf::Keyboard::getDescription is not implemented for DRM." << std::endl;
return "";
}
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void InputImpl::setVirtualKeyboardVisible(bool /*visible*/) void InputImpl::setVirtualKeyboardVisible(bool /*visible*/)

View File

@ -46,19 +46,37 @@ class InputImpl
public: public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Check if a key is pressed /// \copydoc sf::Keyboard::isKeyPressed(Key)
///
/// \param key Key to check
///
/// \return True if the key is pressed, false otherwise
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
static bool isKeyPressed(Keyboard::Key key); static bool isKeyPressed(Keyboard::Key key);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Show or hide the virtual keyboard /// \copydoc sf::Keyboard::isKeyPressed(Scancode)
/// ///
/// \param visible True to show, false to hide ////////////////////////////////////////////////////////////
static bool isKeyPressed(Keyboard::Scancode code);
////////////////////////////////////////////////////////////
/// \copydoc sf::Keyboard::localize
///
////////////////////////////////////////////////////////////
static Keyboard::Key localize(Keyboard::Scancode code);
////////////////////////////////////////////////////////////
/// \copydoc sf::Keyboard::delocalize
///
////////////////////////////////////////////////////////////
static Keyboard::Scancode delocalize(Keyboard::Key key);
////////////////////////////////////////////////////////////
/// \copydoc sf::Keyboard::getDescription
///
////////////////////////////////////////////////////////////
static String getDescription(Keyboard::Scancode code);
////////////////////////////////////////////////////////////
/// \copydoc sf::Keyboard::setVirtualKeyboardVisible
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
static void setVirtualKeyboardVisible(bool visible); static void setVirtualKeyboardVisible(bool visible);