From 0053e87f1a345502430f8f1ce94a59d1c399ddda Mon Sep 17 00:00:00 2001 From: viarotel Date: Mon, 16 Sep 2024 15:39:50 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E2=9C=A8=20Update=20to=20scrcpy@2.7=20?= =?UTF-8?q?to=20support=20the=20gamepad?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/locales/languages/en-US.json | 3 ++ src/locales/languages/zh-CN.json | 3 ++ src/locales/languages/zh-TW.json | 3 ++ src/store/preference/model/input/index.js | 34 ++++++++++++++++++---- src/store/preference/model/record/index.js | 2 +- 5 files changed, 39 insertions(+), 6 deletions(-) diff --git a/src/locales/languages/en-US.json b/src/locales/languages/en-US.json index 174b88d9..1e43fb41 100644 --- a/src/locales/languages/en-US.json +++ b/src/locales/languages/en-US.json @@ -370,6 +370,9 @@ "preferences.input.keyboard.inject.tips": "Set keyboard text injection first option", "preferences.input.keyboard.inject.options[0].placeholder": "Inject letters as text", "preferences.input.keyboard.inject.options[1].placeholder": "Force always inject the original button event", + "preferences.input.gamepad.name": "Gamepad", + "preferences.input.gamepad.placeholder": "Disabled", + "preferences.input.gamepad.tips": "This option allows connecting a gamepad (PS4/PS5 or Xbox) to your computer to play Android games. Note: The game being played must support gamepad input.", "preferences.camera.name": "Camera", "preferences.camera.camera-facing.name": "Camera Source", diff --git a/src/locales/languages/zh-CN.json b/src/locales/languages/zh-CN.json index 5c3c1233..67a0bca1 100644 --- a/src/locales/languages/zh-CN.json +++ b/src/locales/languages/zh-CN.json @@ -370,6 +370,9 @@ "preferences.input.keyboard.inject.tips": "设置键盘文本注入首选项", "preferences.input.keyboard.inject.options[0].placeholder": "将字母作为文本注入", "preferences.input.keyboard.inject.options[1].placeholder": "强制始终注入原始按键事件", + "preferences.input.gamepad.name": "游戏手柄", + "preferences.input.gamepad.placeholder": "禁用", + "preferences.input.gamepad.tips": "该选项将允许将游戏手柄( PS4/PS5 或 XBox)连接到你的电脑来玩安卓游戏。注意:所玩的游戏必须支持游戏手柄输入。", "preferences.camera.name": "摄像控制", "preferences.camera.camera-facing.name": "摄像源", diff --git a/src/locales/languages/zh-TW.json b/src/locales/languages/zh-TW.json index da8c807f..16c2660c 100644 --- a/src/locales/languages/zh-TW.json +++ b/src/locales/languages/zh-TW.json @@ -370,6 +370,9 @@ "preferences.input.keyboard.inject.tips": "設定鍵盤文字輸入優先選項", "preferences.input.keyboard.inject.options[0].placeholder": "將字母作為文字輸入", "preferences.input.keyboard.inject.options[1].placeholder": "強制始終輸入原始按鍵事件", + "preferences.input.gamepad.name": "遊戲手柄", + "preferences.input.gamepad.placeholder": "停用", + "preferences.input.gamepad.tips": "此選項允許將遊戲手柄(PS4/PS5或Xbox)連接到您的電腦以玩安卓遊戲。注意:所玩的遊戲必須支持遊戲手柄輸入。", "preferences.camera.name": "鏡頭控制", "preferences.camera.camera-facing.name": "鏡頭來源", diff --git a/src/store/preference/model/input/index.js b/src/store/preference/model/input/index.js index 6ca72691..f7fa67eb 100644 --- a/src/store/preference/model/input/index.js +++ b/src/store/preference/model/input/index.js @@ -10,7 +10,7 @@ export default { props: { clearable: true, }, - value: undefined, + value: void 0, placeholder: 'preferences.input.mouse.placeholder', tips: 'preferences.input.mouse.tips', options: [ @@ -51,7 +51,7 @@ export default { props: { clearable: true, }, - value: undefined, + value: void 0, placeholder: 'preferences.input.keyboard.placeholder', tips: 'preferences.input.keyboard.tips', options: [ @@ -81,7 +81,7 @@ export default { label: 'preferences.input.keyboard.inject.name', field: '--keyboard-inject', type: 'KeyboardInjectSelect', - value: undefined, + value: void 0, placeholder: 'preferences.input.keyboard.inject.placeholder', tips: 'preferences.input.keyboard.inject.tips', options: [ @@ -108,12 +108,36 @@ export default { videoCodec: { hidden: true, field: '--prefer-text', - value: undefined, + value: void 0, }, videoEncoder: { hidden: true, field: '--raw-key-events', - value: undefined, + value: void 0, + }, + gamepad: { + label: 'preferences.input.gamepad.name', + field: '--gamepad', + type: 'Select', + value: void 0, + placeholder: 'preferences.input.gamepad.placeholder', + tips: 'preferences.input.gamepad.tips', + options: [ + { + label: 'disabled', + value: '', + }, + { + label: 'uhid', + value: 'uhid', + placeholder: 'preferences.input.keyboard.options[1].placeholder', + }, + { + label: 'aoa', + value: 'aoa', + placeholder: 'preferences.input.keyboard.options[2].placeholder', + }, + ], }, }, } diff --git a/src/store/preference/model/record/index.js b/src/store/preference/model/record/index.js index 441471bc..3e6cf712 100644 --- a/src/store/preference/model/record/index.js +++ b/src/store/preference/model/record/index.js @@ -6,7 +6,7 @@ export default { label: 'preferences.record.format.name', field: '--record-format', type: 'Select', - value: 'mp4', + value: void 0, placeholder: 'preferences.record.format.placeholder', options: [ {