|
@@ -199,6 +199,10 @@ void KeyboardMapperWidget::keydown_event(GUI::KeyEvent& event)
|
|
tmp_button->update();
|
|
tmp_button->update();
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ if (m_automatic_modifier && event.modifiers() > 0) {
|
|
|
|
+ update_modifier_radio_buttons(event);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
void KeyboardMapperWidget::keyup_event(GUI::KeyEvent& event)
|
|
void KeyboardMapperWidget::keyup_event(GUI::KeyEvent& event)
|
|
@@ -211,6 +215,10 @@ void KeyboardMapperWidget::keyup_event(GUI::KeyEvent& event)
|
|
tmp_button->update();
|
|
tmp_button->update();
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ if (m_automatic_modifier) {
|
|
|
|
+ update_modifier_radio_buttons(event);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
void KeyboardMapperWidget::set_current_map(const String current_map)
|
|
void KeyboardMapperWidget::set_current_map(const String current_map)
|
|
@@ -247,3 +255,27 @@ void KeyboardMapperWidget::show_error_to_user(Error error)
|
|
{
|
|
{
|
|
GUI::MessageBox::show_error(window(), error.string_literal());
|
|
GUI::MessageBox::show_error(window(), error.string_literal());
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+void KeyboardMapperWidget::set_automatic_modifier(bool checked)
|
|
|
|
+{
|
|
|
|
+ m_automatic_modifier = checked;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+void KeyboardMapperWidget::update_modifier_radio_buttons(GUI::KeyEvent& event)
|
|
|
|
+{
|
|
|
|
+ GUI::RadioButton* radio_button;
|
|
|
|
+ if (event.shift() && event.altgr()) {
|
|
|
|
+ radio_button = m_map_group->find_child_of_type_named<GUI::RadioButton>("shift_altgr_map");
|
|
|
|
+ } else if (event.altgr()) {
|
|
|
|
+ radio_button = m_map_group->find_child_of_type_named<GUI::RadioButton>("altgr_map");
|
|
|
|
+ } else if (event.alt()) {
|
|
|
|
+ radio_button = m_map_group->find_child_of_type_named<GUI::RadioButton>("alt_map");
|
|
|
|
+ } else if (event.shift()) {
|
|
|
|
+ radio_button = m_map_group->find_child_of_type_named<GUI::RadioButton>("shift_map");
|
|
|
|
+ } else {
|
|
|
|
+ radio_button = m_map_group->find_child_of_type_named<GUI::RadioButton>("map");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (radio_button)
|
|
|
|
+ radio_button->set_checked(true);
|
|
|
|
+}
|