载入中...
搜索中...
未找到
eve::IInputInjection类 参考abstract

Inject synthetic device input into the live platform event stream. @thread Owner game-loop / MCP poll thread only. @reentrancy Does not invoke scripts or unknown callbacks. @ownership Implementations are owned by the providing module; callers must not retain the pointer across frames or capability revoke. 更多...

#include <InputInjection.h>

Public 成员函数

virtual ~IInputInjection ()=default
 Releases IInputInjection resources.
 
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 > 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 > injectText (std::string_view text)=0
 Queue a UTF-8 text input event (IME / text fields).
 

静态 Public 属性

static constexpr const char * capabilityName = "IInputInjection"
 

详细描述

Inject synthetic device input into the live platform event stream. @thread Owner game-loop / MCP poll thread only. @reentrancy Does not invoke scripts or unknown callbacks. @ownership Implementations are owned by the providing module; callers must not retain the pointer across frames or capability revoke.

在文件 InputInjection.h 第 28 行定义.

构造及析构函数说明

◆ ~IInputInjection()

virtual eve::IInputInjection::~IInputInjection ( )
virtualdefault

Releases IInputInjection resources.

成员函数说明

◆ injectKey()

virtual Result< void > eve::IInputInjection::injectKey ( std::string_view  key,
bool  down,
bool  repeat = false 
)
pure virtual

Queue a key press or release.

参数
keySDL key name (e.g. "A", "Return", "Left Ctrl").
downTrue for keydown, false for keyup.
repeatWhether the keydown is a repeat event.
返回
Success, or ParseError / Unsupported / Failed with diagnostics.

◆ injectMouseButton()

virtual Result< void > eve::IInputInjection::injectMouseButton ( int  button,
bool  down,
float  x,
float  y 
)
pure virtual

Queue a mouse button press or release at a window position.

参数
buttonSDL button index (1=left, 2=middle, 3=right).
downTrue for button down, false for button up.
xWindow X in logical pixels.
yWindow Y in logical pixels.

◆ injectMouseMove()

virtual Result< void > eve::IInputInjection::injectMouseMove ( float  x,
float  y,
float  dx = 0.f,
float  dy = 0.f 
)
pure virtual

Queue absolute mouse motion (and optional relative deltas).

参数
xWindow X in logical pixels.
yWindow Y in logical pixels.
dxRelative X delta reported to relative-mode consumers.
dyRelative Y delta reported to relative-mode consumers.

◆ injectText()

virtual Result< void > eve::IInputInjection::injectText ( std::string_view  text)
pure virtual

Queue a UTF-8 text input event (IME / text fields).

参数
textNon-empty UTF-8 payload; truncated by the provider if needed.

◆ injectWheel()

virtual Result< void > eve::IInputInjection::injectWheel ( float  x,
float  y 
)
pure virtual

Queue a mouse wheel tick.

参数
xHorizontal scroll amount (SDL wheel units).
yVertical scroll amount (SDL wheel units).

类成员变量说明

◆ capabilityName

constexpr const char* eve::IInputInjection::capabilityName = "IInputInjection"
staticconstexpr

在文件 InputInjection.h 第 30 行定义.


该类的文档由以下文件生成: