diff --git a/src/main.cpp b/src/main.cpp index 0a621be..9b95f0d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -153,8 +153,19 @@ namespace wf return *window; } - void Keyboard::handle_action(int32_t action) + void Keyboard::handle_action(uint32_t action) { + if (action == ABC_TOGGLE) + { + if (current_layout == default_layout.get()) { + set_layout(shift_layout.get()); + } else { + set_layout(default_layout.get()); + } + } + + if (action == NUM_TOGGLE) + set_layout(numeric_layout.get()); } } } diff --git a/src/osk.hpp b/src/osk.hpp index 694cd0f..3c22417 100644 --- a/src/osk.hpp +++ b/src/osk.hpp @@ -71,7 +71,7 @@ namespace wf static void create(); static Keyboard& get(); - void handle_action(int32_t action); + void handle_action(uint32_t action); VirtualKeyboardDevice& get_device(); Gtk::Window& get_window(); };