feat: add AltGr modifier override to Screen Settings Dialog

This commit is contained in:
64JohnLee 2026-05-14 21:58:06 +08:00 committed by Nick Bolton
parent 98c713dd3b
commit 5a1a190edd
11 changed files with 131 additions and 2 deletions

View file

@ -160,7 +160,7 @@ private:
QPixmap m_Pixmap = QIcon::fromTheme("video-display").pixmap(QSize(96, 96)); QPixmap m_Pixmap = QIcon::fromTheme("video-display").pixmap(QSize(96, 96));
QString m_Name = {}; QString m_Name = {};
QStringList m_Aliases = {}; QStringList m_Aliases = {};
QList<int> m_Modifiers = {0, 1, 2, 3, 4, 5}; QList<int> m_Modifiers = {0, 1, 2, 3, 4, 5, 6};
QList<bool> m_SwitchCorners = {false, false, false, false}; QList<bool> m_SwitchCorners = {false, false, false, false};
int m_SwitchCornerSize = 0; int m_SwitchCornerSize = 0;
QList<bool> m_Fixes{false, false, false, false}; QList<bool> m_Fixes{false, false, false, false};

View file

@ -7,7 +7,7 @@
#include "ScreenConfig.h" #include "ScreenConfig.h"
const char *ScreenConfig::m_ModifierNames[] = {"shift", "ctrl", "alt", "meta", "super", "none"}; const char *ScreenConfig::m_ModifierNames[] = {"shift", "ctrl", "alt", "meta", "super", "altgr", "none"};
const char *ScreenConfig::m_FixNames[] = { const char *ScreenConfig::m_FixNames[] = {
"halfDuplexCapsLock", "halfDuplexNumLock", "halfDuplexScrollLock", "xtestIsXineramaUnaware" "halfDuplexCapsLock", "halfDuplexNumLock", "halfDuplexScrollLock", "xtestIsXineramaUnaware"

View file

@ -25,6 +25,7 @@ public:
Alt, Alt,
Meta, Meta,
Super, Super,
AltGr,
None, None,
NumModifiers NumModifiers
}; };

View file

@ -48,6 +48,7 @@ ScreenSettingsDialog::ScreenSettingsDialog(QWidget *parent, Screen *screen, cons
ui->comboAlt->setCurrentIndex(m_screen->modifier(static_cast<int>(Alt))); ui->comboAlt->setCurrentIndex(m_screen->modifier(static_cast<int>(Alt)));
ui->comboMeta->setCurrentIndex(m_screen->modifier(static_cast<int>(Meta))); ui->comboMeta->setCurrentIndex(m_screen->modifier(static_cast<int>(Meta)));
ui->comboSuper->setCurrentIndex(m_screen->modifier(static_cast<int>(Super))); ui->comboSuper->setCurrentIndex(m_screen->modifier(static_cast<int>(Super)));
ui->comboAltGr->setCurrentIndex(m_screen->modifier(static_cast<int>(AltGr)));
ui->chkDeadTopLeft->setChecked(m_screen->switchCorner(static_cast<int>(TopLeft))); ui->chkDeadTopLeft->setChecked(m_screen->switchCorner(static_cast<int>(TopLeft)));
ui->chkDeadTopRight->setChecked(m_screen->switchCorner(static_cast<int>(TopRight))); ui->chkDeadTopRight->setChecked(m_screen->switchCorner(static_cast<int>(TopRight)));
@ -102,6 +103,7 @@ void ScreenSettingsDialog::accept()
m_screen->setModifier(Alt, ui->comboAlt->currentIndex()); m_screen->setModifier(Alt, ui->comboAlt->currentIndex());
m_screen->setModifier(Meta, ui->comboMeta->currentIndex()); m_screen->setModifier(Meta, ui->comboMeta->currentIndex());
m_screen->setModifier(Super, ui->comboSuper->currentIndex()); m_screen->setModifier(Super, ui->comboSuper->currentIndex());
m_screen->setModifier(AltGr, ui->comboAltGr->currentIndex());
m_screen->setSwitchCorner(TopLeft, ui->chkDeadTopLeft->isChecked()); m_screen->setSwitchCorner(TopLeft, ui->chkDeadTopLeft->isChecked());
m_screen->setSwitchCorner(TopRight, ui->chkDeadTopRight->isChecked()); m_screen->setSwitchCorner(TopRight, ui->chkDeadTopRight->isChecked());

View file

@ -170,6 +170,11 @@
<string>Super</string> <string>Super</string>
</property> </property>
</item> </item>
<item>
<property name="text">
<string>Alt Gr</string>
</property>
</item>
<item> <item>
<property name="text"> <property name="text">
<string>None</string> <string>None</string>
@ -204,6 +209,11 @@
<string>Super</string> <string>Super</string>
</property> </property>
</item> </item>
<item>
<property name="text">
<string>Alt Gr</string>
</property>
</item>
<item> <item>
<property name="text"> <property name="text">
<string>None</string> <string>None</string>
@ -257,6 +267,11 @@
<string>Super</string> <string>Super</string>
</property> </property>
</item> </item>
<item>
<property name="text">
<string>Alt Gr</string>
</property>
</item>
<item> <item>
<property name="text"> <property name="text">
<string>None</string> <string>None</string>
@ -294,6 +309,11 @@
<string>Super</string> <string>Super</string>
</property> </property>
</item> </item>
<item>
<property name="text">
<string>Alt Gr</string>
</property>
</item>
<item> <item>
<property name="text"> <property name="text">
<string>None</string> <string>None</string>
@ -331,6 +351,63 @@
<string>Super</string> <string>Super</string>
</property> </property>
</item> </item>
<item>
<property name="text">
<string>Alt Gr</string>
</property>
</item>
<item>
<property name="text">
<string>None</string>
</property>
</item>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="labelAltGr">
<property name="text">
<string>Alt &amp;Gr</string>
</property>
<property name="buddy">
<cstring>comboAltGr</cstring>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QComboBox" name="comboAltGr">
<property name="currentIndex">
<number>5</number>
</property>
<item>
<property name="text">
<string>Shift</string>
</property>
</item>
<item>
<property name="text">
<string>Ctrl</string>
</property>
</item>
<item>
<property name="text">
<string>Alt</string>
</property>
</item>
<item>
<property name="text">
<string>Meta</string>
</property>
</item>
<item>
<property name="text">
<string>Super</string>
</property>
</item>
<item>
<property name="text">
<string>Alt Gr</string>
</property>
</item>
<item> <item>
<property name="text"> <property name="text">
<string>None</string> <string>None</string>
@ -668,6 +745,7 @@
<tabstop>comboShift</tabstop> <tabstop>comboShift</tabstop>
<tabstop>comboCtrl</tabstop> <tabstop>comboCtrl</tabstop>
<tabstop>comboSuper</tabstop> <tabstop>comboSuper</tabstop>
<tabstop>comboAltGr</tabstop>
<tabstop>comboAlt</tabstop> <tabstop>comboAlt</tabstop>
<tabstop>chkDeadTopLeft</tabstop> <tabstop>chkDeadTopLeft</tabstop>
<tabstop>chkDeadTopRight</tabstop> <tabstop>chkDeadTopRight</tabstop>

View file

@ -895,6 +895,14 @@ Además, verifique que puede %1 el archivo de configuración del servidor: %2</t
<source>The screen name cannot be the same as an alias. Please either remove the alias or change the screen name.</source> <source>The screen name cannot be the same as an alias. Please either remove the alias or change the screen name.</source>
<translation type="unfinished">El nombre de usuario no puede ser el mismo que un alias. Elimine el alias o cambie el nombre de usuario.</translation> <translation type="unfinished">El nombre de usuario no puede ser el mismo que un alias. Elimine el alias o cambie el nombre de usuario.</translation>
</message> </message>
<message>
<source>Alt Gr</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Alt &amp;Gr</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>ScreenSetupModel</name> <name>ScreenSetupModel</name>

View file

@ -895,6 +895,14 @@ Inoltre, verifica di poter %1 il file di configurazione del server: %2</translat
<source>The screen name cannot be the same as an alias. Please either remove the alias or change the screen name.</source> <source>The screen name cannot be the same as an alias. Please either remove the alias or change the screen name.</source>
<translation>Il nome dello schermo non può essere uguale a un alias. Rimuovi l&apos;alias o modifica il nome dello schermo.</translation> <translation>Il nome dello schermo non può essere uguale a un alias. Rimuovi l&apos;alias o modifica il nome dello schermo.</translation>
</message> </message>
<message>
<source>Alt Gr</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Alt &amp;Gr</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>ScreenSetupModel</name> <name>ScreenSetupModel</name>

View file

@ -897,6 +897,14 @@ Additionally, check you are able to %1 the server config file: %2</source>
<source>The screen name cannot be the same as an alias. Please either remove the alias or change the screen name.</source> <source>The screen name cannot be the same as an alias. Please either remove the alias or change the screen name.</source>
<translation>コンピューター名は別名と同じにできません。別名を削除するか、コンピューター名を変更してください。</translation> <translation>コンピューター名は別名と同じにできません。別名を削除するか、コンピューター名を変更してください。</translation>
</message> </message>
<message>
<source>Alt Gr</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Alt &amp;Gr</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>ScreenSetupModel</name> <name>ScreenSetupModel</name>

View file

@ -895,6 +895,14 @@ Additionally, check you are able to %1 the server config file: %2</source>
<source>The screen name cannot be the same as an alias. Please either remove the alias or change the screen name.</source> <source>The screen name cannot be the same as an alias. Please either remove the alias or change the screen name.</source>
<translation>컴퓨터 이름은 별칭과 같을 수 없습니다. 별칭을 삭제하거나 컴퓨터 이름을 변경하세요.</translation> <translation>컴퓨터 이름은 별칭과 같을 수 없습니다. 별칭을 삭제하거나 컴퓨터 이름을 변경하세요.</translation>
</message> </message>
<message>
<source>Alt Gr</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Alt &amp;Gr</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>ScreenSetupModel</name> <name>ScreenSetupModel</name>

View file

@ -895,6 +895,14 @@ Additionally, check you are able to %1 the server config file: %2</source>
<source>The screen name cannot be the same as an alias. Please either remove the alias or change the screen name.</source> <source>The screen name cannot be the same as an alias. Please either remove the alias or change the screen name.</source>
<translation>Имя экрана не может совпадать с псевдонимом. Удалите псевдоним или измените имя экрана.</translation> <translation>Имя экрана не может совпадать с псевдонимом. Удалите псевдоним или измените имя экрана.</translation>
</message> </message>
<message>
<source>Alt Gr</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Alt &amp;Gr</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>ScreenSetupModel</name> <name>ScreenSetupModel</name>

View file

@ -897,6 +897,14 @@ Additionally, check you are able to %1 the server config file: %2</source>
<source>The screen name cannot be the same as an alias. Please either remove the alias or change the screen name.</source> <source>The screen name cannot be the same as an alias. Please either remove the alias or change the screen name.</source>
<translation>屏幕名称不能与别名相同。请移除别名或更改屏幕名称。</translation> <translation>屏幕名称不能与别名相同。请移除别名或更改屏幕名称。</translation>
</message> </message>
<message>
<source>Alt Gr</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Alt &amp;Gr</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>ScreenSetupModel</name> <name>ScreenSetupModel</name>