mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 13:47:35 +00:00
KeyboardSettings: Add text area to test the currently selected keymap
Right now, this is a bit of a hack. We can't set a keymap to only apply to the test area, so we set the system keymap instead, while also keeping track of the "real" current keymap. Whenever the settings are applied, we update what that "real" keymap is, and when we exit, we revert to that keymap. Basically, it behaves as you would expect, apart from it also affecting other applications you are typing in while the KeyboardSettings window is open with a different keymap selected.
This commit is contained in:
parent
0a2b6b64c6
commit
c6099eca5c
3 changed files with 59 additions and 8 deletions
|
@ -6,22 +6,29 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <LibGUI/Button.h>
|
||||
#include <LibGUI/CheckBox.h>
|
||||
#include <LibGUI/ComboBox.h>
|
||||
#include <LibGUI/SettingsWindow.h>
|
||||
#include <LibGUI/TextEditor.h>
|
||||
|
||||
class KeyboardSettingsWidget final : public GUI::SettingsWindow::Tab {
|
||||
C_OBJECT(KeyboardSettingsWidget)
|
||||
public:
|
||||
virtual ~KeyboardSettingsWidget() override = default;
|
||||
virtual ~KeyboardSettingsWidget() override;
|
||||
|
||||
virtual void apply_settings() override;
|
||||
|
||||
private:
|
||||
KeyboardSettingsWidget();
|
||||
|
||||
void set_keymap(String const& keymap_filename);
|
||||
|
||||
String m_current_applied_keymap;
|
||||
Vector<String> m_character_map_files;
|
||||
|
||||
RefPtr<GUI::ComboBox> m_character_map_file_combo;
|
||||
RefPtr<GUI::TextEditor> m_test_typing_area;
|
||||
RefPtr<GUI::Button> m_clear_test_typing_area_button;
|
||||
RefPtr<GUI::CheckBox> m_num_lock_checkbox;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue