|
ShitEngine
基于 C++20 与 SDL3 的轻量级 2D 游戏引擎
|
文本输入聚焦门(进程级单例) 更多...
#include <TextInputGate.h>
Public 成员函数 | |
| TextInputGate (const TextInputGate &)=delete | |
| TextInputGate & | operator= (const TextInputGate &)=delete |
| void | requestFocus (UITextInput *control) |
| 请求聚焦某控件:失焦当前控件,启动新控件的文本输入模式 | |
| void | releaseFocus (UITextInput *control) |
| 失焦指定控件(仅当它当前正在聚焦时才生效) | |
| void | clearFocus () |
| 强制清空焦点(例如场景销毁时) | |
| void | updateCursorRect (const SDL_Rect &rect, int cursor) |
| 通知 IME 光标位置变化(用窗口坐标的 SDL_Rect) | |
静态 Public 成员函数 | |
| static TextInputGate & | GetInstance () |
| static bool | HandleEvent (const SDL_Event &event) |
| 获取原生事件转发入口(由 Game 在 PollEvent 后调用) | |
| static bool | HasFocus () |
| 当前是否有聚焦控件 | |
友元 | |
| class | EngineContext |
文本输入聚焦门(进程级单例)
在任意时刻至多有一个 UITextInput 控件处于"聚焦"状态,负责:
UIRenderSystem 通过 setFocus / clearFocus 管理聚焦;UITextInput 析构时自动解绑。
|
delete |
| void clearFocus | ( | ) |
强制清空焦点(例如场景销毁时)
|
static |
|
inlinestatic |
|
static |
当前是否有聚焦控件
|
delete |
| void releaseFocus | ( | UITextInput * | control | ) |
失焦指定控件(仅当它当前正在聚焦时才生效)
| void requestFocus | ( | UITextInput * | control | ) |
请求聚焦某控件:失焦当前控件,启动新控件的文本输入模式
| void updateCursorRect | ( | const SDL_Rect & | rect, |
| int | cursor ) |
通知 IME 光标位置变化(用窗口坐标的 SDL_Rect)
|
friend |