Skip to content

Commit

Permalink
Merge pull request #120 from crumblingstatue/master
Browse files Browse the repository at this point in the history
Add setVirtualKeyboardVisible
  • Loading branch information
LaurentGomila authored Nov 9, 2016
2 parents bca82a4 + 55be7db commit b5facb8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
13 changes: 13 additions & 0 deletions include/SFML/Window/Keyboard.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 6 additions & 0 deletions src/SFML/Window/Keyboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,9 @@ sfBool sfKeyboard_isKeyPressed(sfKeyCode key)
{
return sf::Keyboard::isKeyPressed(static_cast<sf::Keyboard::Key>(key));
}

////////////////////////////////////////////////////////////
void sfKeyboard_setVirtualKeyboardVisible(sfBool visible)
{
sf::Keyboard::setVirtualKeyboardVisible(visible == sfTrue);
}

0 comments on commit b5facb8

Please sign in to comment.