-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
21 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/* Copyright (C) 2024 Michal Kosciesza <[email protected]> | ||
/* Copyright (C) 2024-2025 Michal Kosciesza <[email protected]> | ||
* | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
|
@@ -302,7 +302,7 @@ ColumnLayout { | |
ComboBoxForm { | ||
visible: _settings.is_xcb() | ||
label.text: qsTranslate("SettingsPage", "Keystroke sending method") | ||
toolTip: qsTranslate("SettingsPage", "Keystroke sending method used in %1.").arg("<i>" + qsTranslate("SettingsPage", "Insert into active window") + "</i>") | ||
toolTip: qsTranslate("SettingsPage", "Simulated keystroke sending method used in %1.").arg("<i>" + qsTranslate("SettingsPage", "Insert into active window") + "</i>") | ||
comboBox { | ||
currentIndex: { | ||
if (_settings.fake_keyboard_type === Settings.FakeKeyboardTypeLegacy) return 0 | ||
|
@@ -323,8 +323,23 @@ ColumnLayout { | |
} | ||
} | ||
|
||
SpinBoxForm { | ||
visible: _settings.is_xcb() && _settings.fake_keyboard_type === Settings.FakeKeyboardTypeLegacy | ||
label.text: qsTranslate("SettingsPage", "Keystroke delay") | ||
toolTip: qsTranslate("SettingsPage", "The delay between simulated keystrokes used in %1.").arg("<i>" + qsTranslate("SettingsPage", "Insert into active window") + "</i>") | ||
spinBox { | ||
from: 1 | ||
to: 1000 | ||
stepSize: 1 | ||
value: _settings.fake_keyboard_delay | ||
onValueChanged: { | ||
_settings.fake_keyboard_delay = spinBox.value; | ||
} | ||
} | ||
} | ||
|
||
TextFieldForm { | ||
visible: _settings.is_xcb() && _settings.fake_keyboard_type === Settings.FakeKeyboardTypeNative | ||
visible: _settings.is_xcb() && _settings.fake_keyboard_type === Settings.FakeKeyboardTypeLegacy | ||
label.text: qsTranslate("SettingsPage", "Compose file") | ||
toolTip: qsTranslate("SettingsPage", "X11 compose file used in %1.").arg("<i>" + qsTranslate("SettingsPage", "Insert into active window") + "</i>") + " " + | ||
qsTranslate("SettingsPage", "Leave blank to use the default value.") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/* Copyright (C) 2021-2024 Michal Kosciesza <[email protected]> | ||
/* Copyright (C) 2021-2025 Michal Kosciesza <[email protected]> | ||
* | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
|
@@ -2677,7 +2677,8 @@ void settings::set_fake_keyboard_type(fake_keyboard_type_t value) { | |
} | ||
|
||
int settings::fake_keyboard_delay() const { | ||
return value(QStringLiteral("fake_keyboard_delay"), 10).toInt(); | ||
auto v = value(QStringLiteral("fake_keyboard_delay"), 10).toInt(); | ||
return std::clamp(v, 1, 1000); | ||
} | ||
|
||
void settings::set_fake_keyboard_delay(int value) { | ||
|