Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions entry/src/main/ets/pages/SettingsPageV2.ets
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ struct SettingsPageV2 {
// 输入 - 鼠标/触控
@State showLocalCursor: boolean = false; // 显示本地指针(双光标模式)
@State touchscreenTrackpad: boolean = false;
@State enableThreeFingerIme: boolean = true;
@State lowLatencyTouch: boolean = false;
@State enableDoubleClickDrag: boolean = false;
@State doubleTapTimeThreshold: number = 125;
Expand Down Expand Up @@ -568,6 +569,7 @@ struct SettingsPageV2 {
// 输入 - 鼠标/触控
this.showLocalCursor = await this.loadBoolean(SettingsKeys.SHOW_LOCAL_CURSOR, false);
this.touchscreenTrackpad = await this.loadBoolean(SettingsKeys.TOUCHSCREEN_TRACKPAD, false);
this.enableThreeFingerIme = await this.loadBoolean(SettingsKeys.ENABLE_THREE_FINGER_IME, true);
this.lowLatencyTouch = await this.loadBoolean(SettingsKeys.LOW_LATENCY_TOUCH, false);
this.enableDoubleClickDrag = await this.loadBoolean(SettingsKeys.ENABLE_DOUBLE_CLICK_DRAG, false);
this.doubleTapTimeThreshold = await PreferencesUtil.get<number>(SettingsKeys.DOUBLE_TAP_TIME_THRESHOLD, 125);
Expand Down Expand Up @@ -1753,6 +1755,16 @@ struct SettingsPageV2 {
this.saveSetting(SettingsKeys.LAST_TOUCH_MODE, '');
}
},
{
title: '三指唤出输入法',
subtitle: '三指同时触摸时打开系统输入法,关闭后触摸将发送到主机',
type: 'toggle',
value: this.enableThreeFingerIme,
action: () => {
this.enableThreeFingerIme = !this.enableThreeFingerIme;
this.saveSetting(SettingsKeys.ENABLE_THREE_FINGER_IME, this.enableThreeFingerIme);
}
},
{
title: '低延迟触摸参数',
subtitle: '缩短触摸点击确认和释放等待,响应更快但更敏感',
Expand Down
7 changes: 5 additions & 2 deletions entry/src/main/ets/pages/StreamPage.ets
Original file line number Diff line number Diff line change
Expand Up @@ -1948,11 +1948,14 @@ struct StreamPage {
/**
* 处理本地系统触摸手势。
*
* 三指同时触摸用于唤出 HarmonyOS IME,优先于远端触摸输入和双指缩放。
* 启用三指输入法手势后,三指同时触摸用于唤出 HarmonyOS IME,
* 优先于远端触摸输入和双指缩放。
* 触发后持续吞掉本组三指,避免远端收到半截多指触摸或鼠标拖拽。
*/
private handleSystemTouchGesture(event: TouchEvent): boolean {
const result = this.threeFingerImeGestureHandler.handleTouchEvent(event, this.viewModel.isConnected);
const enableThreeFingerIme = this.viewModel.inputSettings?.enableThreeFingerIme ?? true;
const result = this.threeFingerImeGestureHandler.handleTouchEvent(
event, enableThreeFingerIme && this.viewModel.isConnected);
if (result === ThreeFingerImeGestureResult.TRIGGERED) {
this.touchInputHandler.cancelActiveInput();
this.panZoomHandler.cancelActiveGesture();
Expand Down
3 changes: 3 additions & 0 deletions entry/src/main/ets/service/SettingsService.ets
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ export class SettingsKeys {
// 输入 - 鼠标/触控
static readonly SHOW_LOCAL_CURSOR: string = 'settings_show_local_cursor';
static readonly TOUCHSCREEN_TRACKPAD: string = 'settings_touchscreen_trackpad';
static readonly ENABLE_THREE_FINGER_IME: string = 'settings_enable_three_finger_ime';
static readonly LOW_LATENCY_TOUCH: string = 'settings_low_latency_touch';
static readonly ENABLE_DOUBLE_CLICK_DRAG: string = 'settings_enable_double_click_drag';
static readonly DOUBLE_TAP_TIME_THRESHOLD: string = 'settings_double_tap_time_threshold';
Expand Down Expand Up @@ -227,6 +228,7 @@ export interface InputSettings {
// 鼠标/触控
showLocalCursor: boolean;
touchscreenTrackpad: boolean;
enableThreeFingerIme: boolean;
lowLatencyTouch: boolean;
enableDoubleClickDrag: boolean;
doubleTapTimeThreshold: number;
Expand Down Expand Up @@ -807,6 +809,7 @@ export class SettingsService {
// 鼠标/触控
showLocalCursor: await this.getBoolean(SettingsKeys.SHOW_LOCAL_CURSOR, false),
touchscreenTrackpad: await this.getBoolean(SettingsKeys.TOUCHSCREEN_TRACKPAD, false),
enableThreeFingerIme: await this.getBoolean(SettingsKeys.ENABLE_THREE_FINGER_IME, true),
lowLatencyTouch: await this.getBoolean(SettingsKeys.LOW_LATENCY_TOUCH, false),
enableDoubleClickDrag: await this.getBoolean(SettingsKeys.ENABLE_DOUBLE_CLICK_DRAG, false),
doubleTapTimeThreshold: await this.getNumber(SettingsKeys.DOUBLE_TAP_TIME_THRESHOLD, 125),
Expand Down
1 change: 1 addition & 0 deletions nativelib/src/main/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ set(SOURCE_FILES
set(MOONLIGHT_COMMON_SOURCES
${MOONLIGHT_COMMON_PATH}/src/Connection.c
${MOONLIGHT_COMMON_PATH}/src/ControlStream.c
${MOONLIGHT_COMMON_PATH}/src/CursorStream.c
${MOONLIGHT_COMMON_PATH}/src/VideoStream.c
${MOONLIGHT_COMMON_PATH}/src/AudioStream.c
${MOONLIGHT_COMMON_PATH}/src/InputStream.c
Expand Down
Loading