[fix] fix all unused variables and type conversions

This commit is contained in:
dijunkun
2024-11-26 23:31:06 +08:00
parent 0caa243006
commit 4533d53ba8
19 changed files with 200 additions and 180 deletions

View File

@@ -45,7 +45,7 @@ int KeyboardCapturer::Unhook() {
int KeyboardCapturer::SendKeyboardCommand(int key_code, bool is_down) {
INPUT input = {0};
input.type = INPUT_KEYBOARD;
input.ki.wVk = key_code;
input.ki.wVk = (WORD)key_code;
if (!is_down) {
input.ki.dwFlags = KEYEVENTF_KEYUP;

View File

@@ -20,8 +20,8 @@ int MouseController::SendCommand(RemoteAction remote_action) {
if (remote_action.type == ControlType::mouse) {
ip.type = INPUT_MOUSE;
ip.mi.dx = remote_action.m.x;
ip.mi.dy = remote_action.m.y;
ip.mi.dx = (LONG)remote_action.m.x;
ip.mi.dy = (LONG)remote_action.m.y;
if (remote_action.m.flag == MouseFlag::left_down) {
ip.mi.dwFlags = MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_ABSOLUTE;
} else if (remote_action.m.flag == MouseFlag::left_up) {