From 7d84731f5916676df7cc41f272e7ff50ca3333d3 Mon Sep 17 00:00:00 2001 From: Ilia Bozhinov Date: Sat, 2 Mar 2019 15:19:00 +0100 Subject: [PATCH] enable numeric and shift layouts --- src/main.cpp | 13 ++++++++++++- src/osk.hpp | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) 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(); };