diff --git a/include/SFML/Window/Keyboard.h b/include/SFML/Window/Keyboard.h index 5b17687..9e79155 100644 --- a/include/SFML/Window/Keyboard.h +++ b/include/SFML/Window/Keyboard.h @@ -154,5 +154,18 @@ typedef enum //////////////////////////////////////////////////////////// CSFML_WINDOW_API sfBool sfKeyboard_isKeyPressed(sfKeyCode key); +//////////////////////////////////////////////////////////// +/// \brief Show or hide the virtual keyboard. +/// +/// Warning: the virtual keyboard is not supported on all systems. +/// It will typically be implemented on mobile OSes (Android, iOS) +/// but not on desktop OSes (Windows, Linux, ...). +/// +/// If the virtual keyboard is not available, this function does nothing. +/// +/// \param visible True to show, false to hide +/// +//////////////////////////////////////////////////////////// +CSFML_WINDOW_API void sfKeyboard_setVirtualKeyboardVisible(sfBool visible); #endif // SFML_KEYBOARD_H diff --git a/src/SFML/Window/Keyboard.cpp b/src/SFML/Window/Keyboard.cpp index ab0c66b..ff65cfb 100644 --- a/src/SFML/Window/Keyboard.cpp +++ b/src/SFML/Window/Keyboard.cpp @@ -35,3 +35,9 @@ sfBool sfKeyboard_isKeyPressed(sfKeyCode key) { return sf::Keyboard::isKeyPressed(static_cast(key)); } + +//////////////////////////////////////////////////////////// +void sfKeyboard_setVirtualKeyboardVisible(sfBool visible) +{ + sf::Keyboard::setVirtualKeyboardVisible(visible == sfTrue); +}