mirror of
https://github.com/fanchenio/DawnLauncher.git
synced 2025-07-14 05:12:11 +08:00
Fixed a bug that caused the software to crash when entering non-English characters when setting shortcut keys.
This commit is contained in:
parent
5173d73b42
commit
55e247a5a3
@ -248,6 +248,7 @@ let simplifiedChinese = {
|
|||||||
shortcutKeyPrompt5: '与"设置-常规"中的"搜索"快捷键产生冲突,请重新设置。',
|
shortcutKeyPrompt5: '与"设置-常规"中的"搜索"快捷键产生冲突,请重新设置。',
|
||||||
shortcutKeyPrompt6:
|
shortcutKeyPrompt6:
|
||||||
'与"设置-快速搜索"中的"显示/隐藏"快捷键产生冲突,请重新设置。',
|
'与"设置-快速搜索"中的"显示/隐藏"快捷键产生冲突,请重新设置。',
|
||||||
|
shortcutKeyPrompt7: "非法字符。",
|
||||||
show: "显示",
|
show: "显示",
|
||||||
showFollowMousePosition: "显示时跟随鼠标位置",
|
showFollowMousePosition: "显示时跟随鼠标位置",
|
||||||
showHide: "显示/隐藏",
|
showHide: "显示/隐藏",
|
||||||
@ -547,6 +548,7 @@ let traditionalChinese = {
|
|||||||
shortcutKeyPrompt5: '與"設置-常規"中的"搜索"快捷鍵產生沖突,請重新設置。',
|
shortcutKeyPrompt5: '與"設置-常規"中的"搜索"快捷鍵產生沖突,請重新設置。',
|
||||||
shortcutKeyPrompt6:
|
shortcutKeyPrompt6:
|
||||||
'與"設置-快速搜索"中的"顯示/隱藏"快捷鍵產生沖突,請重新設置。',
|
'與"設置-快速搜索"中的"顯示/隱藏"快捷鍵產生沖突,請重新設置。',
|
||||||
|
shortcutKeyPrompt7: "非法字符。",
|
||||||
show: "顯示",
|
show: "顯示",
|
||||||
showFollowMousePosition: "顯示時跟隨鼠標位置",
|
showFollowMousePosition: "顯示時跟隨鼠標位置",
|
||||||
showHide: "顯示/隱藏",
|
showHide: "顯示/隱藏",
|
||||||
@ -864,6 +866,7 @@ let english = {
|
|||||||
'It conflicts with the "Search" shortcut key in "Settings-General", please reset it.',
|
'It conflicts with the "Search" shortcut key in "Settings-General", please reset it.',
|
||||||
shortcutKeyPrompt6:
|
shortcutKeyPrompt6:
|
||||||
'It conflicts with the "Show/Hide" shortcut key in "Settings-Quick Search", please reset it.',
|
'It conflicts with the "Show/Hide" shortcut key in "Settings-Quick Search", please reset it.',
|
||||||
|
shortcutKeyPrompt7: "Invaild symbol.",
|
||||||
show: "Show",
|
show: "Show",
|
||||||
showFollowMousePosition: "Follows Mouse Position on Display",
|
showFollowMousePosition: "Follows Mouse Position on Display",
|
||||||
showHide: "Show/Hide",
|
showHide: "Show/Hide",
|
||||||
|
@ -26,6 +26,19 @@ async function checkShortcutKey(
|
|||||||
| "GeneralSearch"
|
| "GeneralSearch"
|
||||||
| "QuickSearch"
|
| "QuickSearch"
|
||||||
): Promise<boolean> {
|
): Promise<boolean> {
|
||||||
|
if (shortcutKey) {
|
||||||
|
// 校验是否有特殊字符
|
||||||
|
for (let i = 0; i < shortcutKey.length; i++) {
|
||||||
|
let charCode = shortcutKey.charCodeAt(i);
|
||||||
|
if (charCode < 0 || charCode > 127) {
|
||||||
|
window.api.showErrorMessageBox(
|
||||||
|
windowName,
|
||||||
|
store.language.shortcutKeyPrompt7
|
||||||
|
);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
// 校验完整性
|
// 校验完整性
|
||||||
if (!checkShortcutKeyComplete(shortcutKey)) {
|
if (!checkShortcutKeyComplete(shortcutKey)) {
|
||||||
window.api.showErrorMessageBox(
|
window.api.showErrorMessageBox(
|
||||||
|
Loading…
Reference in New Issue
Block a user