chore: 调整PC端输入选项及描述

This commit is contained in:
MistEO
2026-03-04 02:32:08 +08:00
parent 410910c752
commit e669b13268
10 changed files with 89 additions and 59 deletions

View File

@@ -2531,12 +2531,12 @@ public class AsstProxy
if (!ulong.TryParse(SettingsViewModel.ConnectSettings.AttachWindowMouseMethod, out var mouseMethod))
{
mouseMethod = 64; // 默认 PostMessageWithCursorPos
mouseMethod = 32; // 默认 SendMessageWithCursorPos
}
if (!ulong.TryParse(SettingsViewModel.ConnectSettings.AttachWindowKeyboardMethod, out var keyboardMethod))
{
keyboardMethod = 64; // 默认 PostMessageWithCursorPos
keyboardMethod = 2; // 默认 SendMessage
}
bool ret = AsstAttachWindow(_handle, hwnd, screencapMethod, mouseMethod, keyboardMethod);

View File

@@ -1264,15 +1264,15 @@ Before use, please ensure:
<system:String x:Key="AttachWindowScreencapMethod">Screencap Method</system:String>
<system:String x:Key="AttachWindowMouseMethod">Mouse Input Method</system:String>
<system:String x:Key="AttachWindowKeyboardMethod">Keyboard Input Method</system:String>
<system:String x:Key="AttachWindowScreencapFramePool">FramePool (Default, Background)</system:String>
<system:String x:Key="AttachWindowScreencapPrintWindow">PrintWindow (Background, Backup 1)</system:String>
<system:String x:Key="AttachWindowScreencapScreenDC">ScreenDC (Background, Backup 2)</system:String>
<system:String x:Key="AttachWindowScreencapDesktopDupWindow">DesktopWindow (Foreground, More Stable)</system:String>
<system:String x:Key="AttachWindowInputSeize">Seize (Foreground, More Stable)</system:String>
<system:String x:Key="AttachWindowInputPostWithCursor">PostMessageWithCursor (Semi-background)</system:String>
<system:String x:Key="AttachWindowInputSendWithCursor">SendMessageWithCursor (Semi-background, Backup)</system:String>
<system:String x:Key="AttachWindowInputPostWithWindowPos">PostMessageWithWindowPos (Background Window)</system:String>
<system:String x:Key="AttachWindowInputSendWithWindowPos">SendMessageWithWindowPos (Background Window, Backup)</system:String>
<system:String x:Key="AttachWindowScreencapFramePool">FramePool (Background, Efficient, Can Minimize)</system:String>
<system:String x:Key="AttachWindowScreencapPrintWindow">PrintWindow (Background, Stable, Can Minimize)</system:String>
<system:String x:Key="AttachWindowScreencapScreenDC">ScreenDC (Background, Backup, Cannot Minimize)</system:String>
<system:String x:Key="AttachWindowScreencapDesktopDupWindow">DesktopWindow (Foreground, No Occlusion)</system:String>
<system:String x:Key="AttachWindowInputSeize">Seize (Foreground, Fully Captures Mouse)</system:String>
<system:String x:Key="AttachWindowInputSendWithCursor">SendMsg-CursorPos (Semi-background, Briefly Captures Mouse)</system:String>
<system:String x:Key="AttachWindowInputSendWithWindowPos">SendMsg-WindowPos (Full Background, No Mouse Capture, Window May Move, Recommend Minimizing)</system:String>
<system:String x:Key="AttachWindowInputSendMsg">SendMsg (Stable)</system:String>
<system:String x:Key="AttachWindowInputPostMsg">PostMsg (Efficient)</system:String>
<!-- !AsstProxy -->
<!-- TrayIcon -->
<system:String x:Key="ForceShow">Force display of MAA</system:String>

View File

@@ -1265,15 +1265,15 @@ MAA Team の開発リソースが限られているため、PC 対応は専任
<system:String x:Key="AttachWindowScreencapMethod">スクリーンキャプチャ方式</system:String>
<system:String x:Key="AttachWindowMouseMethod">マウス入力方式</system:String>
<system:String x:Key="AttachWindowKeyboardMethod">キーボード入力方式</system:String>
<system:String x:Key="AttachWindowScreencapFramePool">FramePoolデフォルト、バックグラウンド)</system:String>
<system:String x:Key="AttachWindowScreencapPrintWindow">PrintWindowバックグラウンド、予備1</system:String>
<system:String x:Key="AttachWindowScreencapScreenDC">ScreenDCバックグラウンド、予備2</system:String>
<system:String x:Key="AttachWindowScreencapDesktopDupWindow">DesktopWindowフォアグラウンド、より安定</system:String>
<system:String x:Key="AttachWindowInputSeize">Seizeフォアグラウンド、より安定</system:String>
<system:String x:Key="AttachWindowInputPostWithCursor">PostMessageWithCursor半バックグラウンド</system:String>
<system:String x:Key="AttachWindowInputSendWithCursor">SendMessageWithCursor半バックグラウンド、予備</system:String>
<system:String x:Key="AttachWindowInputPostWithWindowPos">PostMessageWithWindowPosバックグラウンドウィンドウ</system:String>
<system:String x:Key="AttachWindowInputSendWithWindowPos">SendMessageWithWindowPosバックグラウンドウィンドウ、予備</system:String>
<system:String x:Key="AttachWindowScreencapFramePool">FramePoolバックグラウンド、高効率、最小化可</system:String>
<system:String x:Key="AttachWindowScreencapPrintWindow">PrintWindowバックグラウンド、安定、最小化可</system:String>
<system:String x:Key="AttachWindowScreencapScreenDC">ScreenDCバックグラウンド、予備、最小化不可</system:String>
<system:String x:Key="AttachWindowScreencapDesktopDupWindow">DesktopWindowフォアグラウンド、遮蔽不可</system:String>
<system:String x:Key="AttachWindowInputSeize">Seizeフォアグラウンド、マウスを完全に取得</system:String>
<system:String x:Key="AttachWindowInputSendWithCursor">SendMsg-CursorPos(半バックグラウンド、一時的にマウスを取得</system:String>
<system:String x:Key="AttachWindowInputSendWithWindowPos">SendMsg-WindowPosフルバックグラウンド、マウス不要、ウィンドウが動く可能性あり、最小化推奨</system:String>
<system:String x:Key="AttachWindowInputSendMsg">SendMsg安定</system:String>
<system:String x:Key="AttachWindowInputPostMsg">PostMsg高効率</system:String>
<!-- !AsstProxy -->
<!-- TrayIcon -->
<system:String x:Key="ForceShow">MAAの強制表示</system:String>

View File

@@ -1266,15 +1266,15 @@ MAA Team의 개발 인력이 제한되어 있어 PC 지원은 전담 관리가
<system:String x:Key="AttachWindowScreencapMethod">스크린샷 방식</system:String>
<system:String x:Key="AttachWindowMouseMethod">마우스 입력 방식</system:String>
<system:String x:Key="AttachWindowKeyboardMethod">키보드 입력 방식</system:String>
<system:String x:Key="AttachWindowScreencapFramePool">FramePool (기본값, 백그라운드)</system:String>
<system:String x:Key="AttachWindowScreencapPrintWindow">PrintWindow (백그라운드, 백업 1)</system:String>
<system:String x:Key="AttachWindowScreencapScreenDC">ScreenDC (백그라운드, 백업 2)</system:String>
<system:String x:Key="AttachWindowScreencapDesktopDupWindow">DesktopWindow (포그라운드, 더 안정적)</system:String>
<system:String x:Key="AttachWindowInputSeize">Seize (포그라운드, 더 안정적)</system:String>
<system:String x:Key="AttachWindowInputPostWithCursor">PostMessageWithCursor (반 백그라운드)</system:String>
<system:String x:Key="AttachWindowInputSendWithCursor">SendMessageWithCursor (반 백그라운드, 백업)</system:String>
<system:String x:Key="AttachWindowInputPostWithWindowPos">PostMessageWithWindowPos (백그라운드 윈도우)</system:String>
<system:String x:Key="AttachWindowInputSendWithWindowPos">SendMessageWithWindowPos (백그라운드 윈도우, 백업)</system:String>
<system:String x:Key="AttachWindowScreencapFramePool">FramePool (백그라운드, 효율적, 최소화 가능)</system:String>
<system:String x:Key="AttachWindowScreencapPrintWindow">PrintWindow (백그라운드, 안정적, 최소화 가능)</system:String>
<system:String x:Key="AttachWindowScreencapScreenDC">ScreenDC (백그라운드, 백업, 최소화 불가)</system:String>
<system:String x:Key="AttachWindowScreencapDesktopDupWindow">DesktopWindow (포그라운드, 가림 불가)</system:String>
<system:String x:Key="AttachWindowInputSeize">Seize (포그라운드, 마우스 완전 점유)</system:String>
<system:String x:Key="AttachWindowInputSendWithCursor">SendMsg-CursorPos (반 백그라운드, 마우스 일시 점유)</system:String>
<system:String x:Key="AttachWindowInputSendWithWindowPos">SendMsg-WindowPos (완전 백그라운드, 마우스 비점유, 창 이동 가능하나 사용 무관, 최소화 권장)</system:String>
<system:String x:Key="AttachWindowInputSendMsg">SendMsg (안정적)</system:String>
<system:String x:Key="AttachWindowInputPostMsg">PostMsg (효율적)</system:String>
<!-- !AsstProxy -->
<!-- TrayIcon -->
<system:String x:Key="ForceShow">MAA 강제 표시</system:String>

View File

@@ -1265,15 +1265,15 @@ C:\\leidian\\LDPlayer9。\n
<system:String x:Key="AttachWindowScreencapMethod">截图方式</system:String>
<system:String x:Key="AttachWindowMouseMethod">鼠标输入</system:String>
<system:String x:Key="AttachWindowKeyboardMethod">键盘输入</system:String>
<system:String x:Key="AttachWindowScreencapFramePool">FramePool默认后台</system:String>
<system:String x:Key="AttachWindowScreencapPrintWindow">PrintWindow后台备用1</system:String>
<system:String x:Key="AttachWindowScreencapScreenDC">ScreenDC后台备用2</system:String>
<system:String x:Key="AttachWindowScreencapDesktopDupWindow">DesktopWindow前台更稳定</system:String>
<system:String x:Key="AttachWindowInputSeize">Seize前台更稳定</system:String>
<system:String x:Key="AttachWindowInputPostWithCursor">PostMessageWithCursor半后台</system:String>
<system:String x:Key="AttachWindowInputSendWithCursor">SendMessageWithCursor半后台备用</system:String>
<system:String x:Key="AttachWindowInputPostWithWindowPos">PostMessageWithWindowPos后台窗口</system:String>
<system:String x:Key="AttachWindowInputSendWithWindowPos">SendMessageWithWindowPos后台窗口备用</system:String>
<system:String x:Key="AttachWindowScreencapFramePool">WGC后台高效可最小化</system:String>
<system:String x:Key="AttachWindowScreencapPrintWindow">PrintWindow后台稳定,可最小化</system:String>
<system:String x:Key="AttachWindowScreencapScreenDC">ScreenDC后台备用,不可最小化</system:String>
<system:String x:Key="AttachWindowScreencapDesktopDupWindow">DesktopWindow前台不可遮挡</system:String>
<system:String x:Key="AttachWindowInputSeize">Seize前台完全抢鼠标</system:String>
<system:String x:Key="AttachWindowInputSendWithCursor">SendMsg-CursorPos(半后台,短暂抢鼠标</system:String>
<system:String x:Key="AttachWindowInputSendWithWindowPos">SendMsg-WindowPos全后台不抢鼠标窗口会乱飞但不影响使用建议最小化</system:String>
<system:String x:Key="AttachWindowInputSendMsg">SendMsg稳定</system:String>
<system:String x:Key="AttachWindowInputPostMsg">PostMsg高效</system:String>
<!-- !AsstProxy -->
<!-- TrayIcon -->
<system:String x:Key="ForceShow">强制显示MAA</system:String>

View File

@@ -1265,15 +1265,15 @@ C:\\leidian\\LDPlayer9\n
<system:String x:Key="AttachWindowScreencapMethod">截圖方式</system:String>
<system:String x:Key="AttachWindowMouseMethod">滑鼠輸入</system:String>
<system:String x:Key="AttachWindowKeyboardMethod">鍵盤輸入</system:String>
<system:String x:Key="AttachWindowScreencapFramePool">FramePool預設,背景)</system:String>
<system:String x:Key="AttachWindowScreencapPrintWindow">PrintWindow背景備用1</system:String>
<system:String x:Key="AttachWindowScreencapScreenDC">ScreenDC背景備用2</system:String>
<system:String x:Key="AttachWindowScreencapDesktopDupWindow">DesktopWindow前台更穩定</system:String>
<system:String x:Key="AttachWindowInputSeize">Seize前台更穩定</system:String>
<system:String x:Key="AttachWindowInputPostWithCursor">PostMessageWithCursor半背景</system:String>
<system:String x:Key="AttachWindowInputSendWithCursor">SendMessageWithCursor半背景備用</system:String>
<system:String x:Key="AttachWindowInputPostWithWindowPos">PostMessageWithWindowPos後台視窗</system:String>
<system:String x:Key="AttachWindowInputSendWithWindowPos">SendMessageWithWindowPos後台視窗備用</system:String>
<system:String x:Key="AttachWindowScreencapFramePool">FramePool背景,高效,可最小化</system:String>
<system:String x:Key="AttachWindowScreencapPrintWindow">PrintWindow背景穩定,可最小化</system:String>
<system:String x:Key="AttachWindowScreencapScreenDC">ScreenDC背景備用,不可最小化</system:String>
<system:String x:Key="AttachWindowScreencapDesktopDupWindow">DesktopWindow前台不可遮擋</system:String>
<system:String x:Key="AttachWindowInputSeize">Seize前台完全搶滑鼠</system:String>
<system:String x:Key="AttachWindowInputSendWithCursor">SendMsg-CursorPos(半背景,短暫搶滑鼠</system:String>
<system:String x:Key="AttachWindowInputSendWithWindowPos">SendMsg-WindowPos全背景不搶滑鼠視窗可能亂飛但不影響使用建議最小化</system:String>
<system:String x:Key="AttachWindowInputSendMsg">SendMsg穩定</system:String>
<system:String x:Key="AttachWindowInputPostMsg">PostMsg高效</system:String>
<!-- !AsstProxy -->
<!-- TrayIcon -->
<system:String x:Key="ForceShow">強制顯示 MAA</system:String>

View File

@@ -1236,18 +1236,45 @@ public class ConnectSettingsUserControlModel : PropertyChangedBase
}
/// <summary>
/// Win32 输入方式枚举(与 AsstCaller.h 中 AsstWin32InputMethodEnum 对应)
/// Win32 鼠标输入方式枚举(与 AsstCaller.h 中 AsstWin32InputMethodEnum 对应)
/// </summary>
public List<CombinedData> AttachWindowInputMethodList { get; } =
private static readonly List<CombinedData> _attachWindowMouseMethodList =
[
new() { Display = LocalizationHelper.GetString("AttachWindowInputSeize"), Value = "1" },
new() { Display = LocalizationHelper.GetString("AttachWindowInputPostWithCursor"), Value = "64" },
new() { Display = LocalizationHelper.GetString("AttachWindowInputSendWithCursor"), Value = "32" },
new() { Display = LocalizationHelper.GetString("AttachWindowInputPostWithWindowPos"), Value = "256" },
new() { Display = LocalizationHelper.GetString("AttachWindowInputSendWithWindowPos"), Value = "128" },
];
private string _attachWindowMouseMethod = ConfigurationHelper.GetValue(ConfigurationKeys.AttachWindowMouseMethod, "64"); // 默认 PostMessageWithCursorPos
public List<CombinedData> AttachWindowMouseMethodList => _attachWindowMouseMethodList;
/// <summary>
/// Win32 键盘输入方式枚举(与 AsstCaller.h 中 AsstWin32InputMethodEnum 对应)
/// </summary>
private static readonly List<CombinedData> _attachWindowKeyboardMethodList =
[
new() { Display = LocalizationHelper.GetString("AttachWindowInputSeize"), Value = "1" },
new() { Display = LocalizationHelper.GetString("AttachWindowInputSendMsg"), Value = "2" },
new() { Display = LocalizationHelper.GetString("AttachWindowInputPostMsg"), Value = "4" },
];
public List<CombinedData> AttachWindowKeyboardMethodList => _attachWindowKeyboardMethodList;
private static string ValidateAttachWindowMethod(string key, string defaultValue, List<CombinedData> list)
{
var stored = ConfigurationHelper.GetValue(key, defaultValue);
if (list.Any(item => item.Value == stored))
{
return stored;
}
ConfigurationHelper.SetValue(key, defaultValue);
return defaultValue;
}
private string _attachWindowMouseMethod = ValidateAttachWindowMethod(
ConfigurationKeys.AttachWindowMouseMethod,
"32",
_attachWindowMouseMethodList); // 默认 SendMessageWithCursorPos
/// <summary>
/// Gets or sets the mouse input method for AttachWindow mode.
@@ -1262,7 +1289,10 @@ public class ConnectSettingsUserControlModel : PropertyChangedBase
}
}
private string _attachWindowKeyboardMethod = ConfigurationHelper.GetValue(ConfigurationKeys.AttachWindowKeyboardMethod, "64"); // 默认 PostMessageWithCursorPos
private string _attachWindowKeyboardMethod = ValidateAttachWindowMethod(
ConfigurationKeys.AttachWindowKeyboardMethod,
"2",
_attachWindowKeyboardMethodList); // 默认 SendMessage
/// <summary>
/// Gets or sets the keyboard input method for AttachWindow mode.

View File

@@ -294,7 +294,7 @@
hc:InfoElement.Title="{DynamicResource AttachWindowMouseMethod}"
hc:TitleElement.HorizontalAlignment="Center"
DisplayMemberPath="Display"
ItemsSource="{Binding AttachWindowInputMethodList}"
ItemsSource="{Binding AttachWindowMouseMethodList}"
SelectedValue="{Binding AttachWindowMouseMethod}"
SelectedValuePath="Value" />
@@ -304,7 +304,7 @@
hc:InfoElement.Title="{DynamicResource AttachWindowKeyboardMethod}"
hc:TitleElement.HorizontalAlignment="Center"
DisplayMemberPath="Display"
ItemsSource="{Binding AttachWindowInputMethodList}"
ItemsSource="{Binding AttachWindowKeyboardMethodList}"
SelectedValue="{Binding AttachWindowKeyboardMethod}"
SelectedValuePath="Value" />
</StackPanel>

View File

@@ -177,7 +177,7 @@
hc:TitleElement.Title="{DynamicResource AttachWindowMouseMethod}"
hc:TitleElement.TitlePlacement="Left"
DisplayMemberPath="Display"
ItemsSource="{Binding AttachWindowInputMethodList}"
ItemsSource="{Binding AttachWindowMouseMethodList}"
SelectedValue="{Binding AttachWindowMouseMethod}"
SelectedValuePath="Value" />
</StackPanel>
@@ -192,7 +192,7 @@
hc:TitleElement.Title="{DynamicResource AttachWindowKeyboardMethod}"
hc:TitleElement.TitlePlacement="Left"
DisplayMemberPath="Display"
ItemsSource="{Binding AttachWindowInputMethodList}"
ItemsSource="{Binding AttachWindowKeyboardMethodList}"
SelectedValue="{Binding AttachWindowKeyboardMethod}"
SelectedValuePath="Value" />
</StackPanel>

View File

@@ -197,7 +197,7 @@
Margin="0,5"
hc:InfoElement.Title="{DynamicResource AttachWindowMouseMethod}"
DisplayMemberPath="Display"
ItemsSource="{Binding AttachWindowInputMethodList}"
ItemsSource="{Binding AttachWindowMouseMethodList}"
SelectedValue="{Binding AttachWindowMouseMethod}"
SelectedValuePath="Value" />
@@ -205,7 +205,7 @@
Margin="0,5"
hc:InfoElement.Title="{DynamicResource AttachWindowKeyboardMethod}"
DisplayMemberPath="Display"
ItemsSource="{Binding AttachWindowInputMethodList}"
ItemsSource="{Binding AttachWindowKeyboardMethodList}"
SelectedValue="{Binding AttachWindowKeyboardMethod}"
SelectedValuePath="Value" />
</StackPanel>