载入中...
搜索中...
未找到
InputInjection.h
浏览该文件的文档.
1#pragma once
2
13#include "common/Export.h"
14#include "common/Result.h"
15
16#include <string>
17#include <string_view>
18
19namespace eve {
20
29public:
30 static constexpr const char* capabilityName = "IInputInjection";
31
33 virtual ~IInputInjection() = default;
34
42 [[nodiscard]] virtual Result<void> injectKey(std::string_view key, bool down, bool repeat = false) = 0;
43
51 [[nodiscard]] virtual Result<void> injectMouseButton(int button, bool down, float x, float y) = 0;
52
60 [[nodiscard]] virtual Result<void> injectMouseMove(float x, float y, float dx = 0.f, float dy = 0.f) = 0;
61
67 [[nodiscard]] virtual Result<void> injectWheel(float x, float y) = 0;
68
73 [[nodiscard]] virtual Result<void> injectText(std::string_view text) = 0;
74};
75
76} // namespace eve
double y
double x
SQObjectPtr key
Definition ECS.cpp:155
#define EVENGINE_API_FOUNDATION_INLINE
仅供"只有内联成员"的类型使用的组宏:拥有者 dllexport,消费方不导入。
Definition Export.h:170
glm::dvec3 dx
Move-only, checked operation results for the common layer.
std::string text
float dy
Definition Shadow.cpp:151
Inject synthetic device input into the live platform event stream. @thread Owner game-loop / MCP poll...
virtual ~IInputInjection()=default
Releases IInputInjection resources.
virtual Result< void > injectMouseMove(float x, float y, float dx=0.f, float dy=0.f)=0
Queue absolute mouse motion (and optional relative deltas).
virtual Result< void > injectWheel(float x, float y)=0
Queue a mouse wheel tick.
virtual Result< void > injectKey(std::string_view key, bool down, bool repeat=false)=0
Queue a key press or release.
virtual Result< void > injectMouseButton(int button, bool down, float x, float y)=0
Queue a mouse button press or release at a window position.
virtual Result< void > injectText(std::string_view text)=0
Queue a UTF-8 text input event (IME / text fields).
Move-only operation result carrying either a value or Status.
Definition Result.h:176
Build metadata (engine git commit, build time, third-party version).
Definition Build.cpp:16