Skip to content

Commit b48b3e9

Browse files
committed
virt keyboard
1 parent 738ff3b commit b48b3e9

File tree

6 files changed

+13
-6
lines changed

6 files changed

+13
-6
lines changed

src/ruis/render/native_window.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,5 +84,12 @@ class native_window
8484
void pop_mouse_cursor(cursor_id i);
8585

8686
virtual void set_mouse_cursor_visible(bool visible) {}
87+
88+
/**
89+
* @brief Show/hide the virtual keyboard.
90+
* On mobile platforms this function should show/hide the on-screen keyboard.
91+
* On desktop platforms with physical keyboard this funtion should do nothing.
92+
*/
93+
virtual void set_virtual_keyboard_visible(bool visible) noexcept {}
8794
};
8895
} // namespace ruis::render

tests/app/src/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ class application : public ruisapp::application{
9595
// std::shared_ptr<ruis::widget> c = ruis::gui::inst().inflater().Inflate(zf);
9696

9797
ASSERT(c.get().try_get_widget_as<ruis::push_button>("show_VK_button"))
98-
std::dynamic_pointer_cast<ruis::push_button>(c.get().try_get_widget("show_VK_button"))->click_handler = [this](ruis::push_button&){
99-
this->show_virtual_keyboard();
98+
std::dynamic_pointer_cast<ruis::push_button>(c.get().try_get_widget("show_VK_button"))->click_handler = [this](ruis::push_button& b){
99+
b.context.get().window().set_virtual_keyboard_visible(true);
100100
};
101101

102102
std::dynamic_pointer_cast<ruis::push_button>(c.get().try_get_widget("push_button_in_scroll_container"))->click_handler = [ctx = gui.context](ruis::push_button&){

0 commit comments

Comments
 (0)