Skip to content

Commit b5facb8

Browse files
Merge pull request #120 from crumblingstatue/master
Add setVirtualKeyboardVisible
2 parents bca82a4 + 55be7db commit b5facb8

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

include/SFML/Window/Keyboard.h

+13
Original file line numberDiff line numberDiff line change
@@ -154,5 +154,18 @@ typedef enum
154154
////////////////////////////////////////////////////////////
155155
CSFML_WINDOW_API sfBool sfKeyboard_isKeyPressed(sfKeyCode key);
156156

157+
////////////////////////////////////////////////////////////
158+
/// \brief Show or hide the virtual keyboard.
159+
///
160+
/// Warning: the virtual keyboard is not supported on all systems.
161+
/// It will typically be implemented on mobile OSes (Android, iOS)
162+
/// but not on desktop OSes (Windows, Linux, ...).
163+
///
164+
/// If the virtual keyboard is not available, this function does nothing.
165+
///
166+
/// \param visible True to show, false to hide
167+
///
168+
////////////////////////////////////////////////////////////
169+
CSFML_WINDOW_API void sfKeyboard_setVirtualKeyboardVisible(sfBool visible);
157170

158171
#endif // SFML_KEYBOARD_H

src/SFML/Window/Keyboard.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,9 @@ sfBool sfKeyboard_isKeyPressed(sfKeyCode key)
3535
{
3636
return sf::Keyboard::isKeyPressed(static_cast<sf::Keyboard::Key>(key));
3737
}
38+
39+
////////////////////////////////////////////////////////////
40+
void sfKeyboard_setVirtualKeyboardVisible(sfBool visible)
41+
{
42+
sf::Keyboard::setVirtualKeyboardVisible(visible == sfTrue);
43+
}

0 commit comments

Comments
 (0)