Skip to content

Commit 89e14e9

Browse files
1 parent 834ca8f commit 89e14e9

4 files changed

Lines changed: 17 additions & 13 deletions

File tree

source/MaaAdbControlUnit/EmulatorExtras/AndrowsExtras.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ bool AndrowsExtras::parse(const json::value& config)
4040
return false;
4141
}
4242

43-
app_package_ = config.get("extras", "androws", "app_package", std::string {});
43+
app_package_ = config.get("extras", "androws", "app_package", std::string { });
4444
LogInfo << VAR(app_package_);
4545

4646
// ADB shell command generator: {ADB} -s {ADB_SERIAL} shell {ANDROWS_SHELL_CMD}
@@ -118,8 +118,12 @@ bool AndrowsExtras::request_display_info()
118118
}
119119

120120
auto trim = [](std::string_view s) {
121-
while (!s.empty() && s.front() == ' ') s.remove_prefix(1);
122-
while (!s.empty() && s.back() == ' ') s.remove_suffix(1);
121+
while (!s.empty() && s.front() == ' ') {
122+
s.remove_prefix(1);
123+
}
124+
while (!s.empty() && s.back() == ' ') {
125+
s.remove_suffix(1);
126+
}
123127
return s;
124128
};
125129
// Parse width and height from output (take the last "WxH" pattern to prefer Override size)

source/MaaAdbControlUnit/EmulatorExtras/AndrowsExtras.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class AndrowsExtras
2525
public:
2626
// agent_path: path to the minitouch agent directory.
2727
// Pass empty path (default) when only screencap functionality is needed.
28-
explicit AndrowsExtras(std::filesystem::path agent_path = {});
28+
explicit AndrowsExtras(std::filesystem::path agent_path = { });
2929

3030
virtual ~AndrowsExtras() override;
3131

source/MaaWin32ControlUnit/Input/MessageInput.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -833,7 +833,7 @@ std::pair<int, int> MessageInput::get_target_pos() const
833833
}
834834

835835
// 未设置时返回窗口客户区中心
836-
RECT rect = {};
836+
RECT rect = { };
837837
if (hwnd_ && GetClientRect(hwnd_, &rect)) {
838838
return { (rect.right - rect.left) / 2, (rect.bottom - rect.top) / 2 };
839839
}
@@ -1194,7 +1194,7 @@ bool MessageInput::relative_move(int dx, int dy)
11941194
// 标记:这次 SendInput 产生的 WM_INPUT 不要被 RawInput handler 对冲
11951195
counter_pending_++;
11961196

1197-
INPUT input = {};
1197+
INPUT input = { };
11981198
input.type = INPUT_MOUSE;
11991199
input.mi.dx = dx;
12001200
input.mi.dy = dy;
@@ -1483,7 +1483,7 @@ void MessageInput::process_mouse_lock_follow_frame()
14831483

14841484
bool MessageInput::create_rawinput_window()
14851485
{
1486-
WNDCLASSEXW wc = {};
1486+
WNDCLASSEXW wc = { };
14871487
wc.cbSize = sizeof(wc);
14881488
wc.lpfnWndProc = RawInputWndProc;
14891489
wc.hInstance = GetModuleHandleW(NULL);
@@ -1499,7 +1499,7 @@ bool MessageInput::create_rawinput_window()
14991499
}
15001500

15011501
// 注册接收鼠标 RawInput(RIDEV_INPUTSINK 确保后台也能收到)
1502-
RAWINPUTDEVICE rid = {};
1502+
RAWINPUTDEVICE rid = { };
15031503
rid.usUsagePage = 0x01; // HID_USAGE_PAGE_GENERIC
15041504
rid.usUsage = 0x02; // HID_USAGE_GENERIC_MOUSE
15051505
rid.dwFlags = RIDEV_INPUTSINK;
@@ -1521,7 +1521,7 @@ void MessageInput::destroy_rawinput_window()
15211521
return;
15221522
}
15231523

1524-
RAWINPUTDEVICE rid = {};
1524+
RAWINPUTDEVICE rid = { };
15251525
rid.usUsagePage = 0x01;
15261526
rid.usUsage = 0x02;
15271527
rid.dwFlags = RIDEV_REMOVE;
@@ -1540,7 +1540,7 @@ void MessageInput::send_counter_move(int raw_dx, int raw_dy)
15401540

15411541
counter_pending_++;
15421542

1543-
INPUT counter = {};
1543+
INPUT counter = { };
15441544
counter.type = INPUT_MOUSE;
15451545
counter.mi.dx = -raw_dx;
15461546
counter.mi.dy = -raw_dy;
@@ -1563,7 +1563,7 @@ bool MessageInput::handle_rawinput_message(LPARAM lParam)
15631563
return false;
15641564
}
15651565

1566-
RAWINPUT raw = {};
1566+
RAWINPUT raw = { };
15671567
UINT copied = size;
15681568
if (GetRawInputData(reinterpret_cast<HRAWINPUT>(lParam), RID_INPUT, &raw, &copied, sizeof(RAWINPUTHEADER)) != size) {
15691569
return false;

source/MaaWin32ControlUnit/Input/MessageInput.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,8 @@ class MessageInput : public RelativeMoveInput
176176
std::atomic<bool> mouse_lock_follow_active_ = false;
177177
bool tracking_thread_started_for_lock_follow_ = false;
178178

179-
POINT lock_anchor_cursor_ = {};
180-
RECT lock_anchor_window_ = {};
179+
POINT lock_anchor_cursor_ = { };
180+
RECT lock_anchor_window_ = { };
181181
int lock_offset_x_ = 0;
182182
int lock_offset_y_ = 0;
183183
};

0 commit comments

Comments
 (0)