| 130 | } |
| 131 | |
| 132 | std::shared_ptr<InputBase> Win32ControlUnitMgr::make_input(MaaWin32InputMethod method) const |
| 133 | { |
| 134 | switch (method) { |
| 135 | case MaaWin32InputMethod_Seize: |
| 136 | return std::make_shared<SeizeInput>(hwnd_, false); |
| 137 | case MaaWin32InputMethod_SendMessage: |
| 138 | return std::make_shared<MessageInput>(hwnd_, MessageInput::Config { .mode = MessageInput::Mode::SendMessage }); |
| 139 | case MaaWin32InputMethod_PostMessage: |
| 140 | return std::make_shared<MessageInput>(hwnd_, MessageInput::Config { .mode = MessageInput::Mode::PostMessage }); |
| 141 | case MaaWin32InputMethod_LegacyEvent: |
| 142 | return std::make_shared<LegacyEventInput>(hwnd_, true); |
| 143 | case MaaWin32InputMethod_PostThreadMessage: |
| 144 | LogError << "MaaWin32InputMethod_PostThreadMessage is deprecated and no longer implemented"; |
| 145 | return nullptr; |
| 146 | case MaaWin32InputMethod_SendMessageWithCursorPos: |
| 147 | return std::make_shared<MessageInput>( |
| 148 | hwnd_, |
| 149 | MessageInput::Config { .mode = MessageInput::Mode::SendMessage, .with_cursor_pos = true, .block_input = true }); |
| 150 | case MaaWin32InputMethod_PostMessageWithCursorPos: |
| 151 | return std::make_shared<MessageInput>( |
| 152 | hwnd_, |
| 153 | MessageInput::Config { .mode = MessageInput::Mode::PostMessage, .with_cursor_pos = true, .block_input = true }); |
| 154 | case MaaWin32InputMethod_SendMessageWithWindowPos: |
| 155 | return std::make_shared<MessageInput>( |
| 156 | hwnd_, |
| 157 | MessageInput::Config { .mode = MessageInput::Mode::SendMessage, .with_window_pos = true, .block_input = false }); |
| 158 | case MaaWin32InputMethod_PostMessageWithWindowPos: |
| 159 | return std::make_shared<MessageInput>( |
| 160 | hwnd_, |
| 161 | MessageInput::Config { .mode = MessageInput::Mode::PostMessage, .with_window_pos = true, .block_input = false }); |
| 162 | default: |
| 163 | LogError << "Unknown input method: " << static_cast<int>(method); |
| 164 | return nullptr; |
| 165 | } |
| 166 | } |
| 167 | |
| 168 | std::shared_ptr<ScreencapBase> |
| 169 | Win32ControlUnitMgr::speed_test(const std::unordered_map<ScreencapMethod, std::shared_ptr<ScreencapBase>>& units) const |
nothing calls this directly
no outgoing calls
no test coverage detected