pub enum ScriptEvent {
PointerMove {
x: f32,
y: f32,
},
Mouse {
x: f32,
y: f32,
button: String,
pressed: bool,
modifiers: u8,
},
Wheel {
x: f32,
y: f32,
dx: f32,
dy: f32,
modifiers: u8,
},
Key {
key: String,
pressed: bool,
modifiers: u8,
},
Ime {
kind: String,
text: String,
cursor: Option<usize>,
},
Focus {
focused: bool,
},
CursorLeft,
Command {
source: String,
id: u64,
},
}Expand description
脚本事件枚举。字段名与真实 ShellEvent 对齐,便于 Agent 生成脚本。
Variants§
PointerMove
光标移动:{"type":"pointer_move","x":10,"y":20}
Mouse
鼠标按下/抬起:{"type":"mouse","x":10,"y":20,"button":"left","pressed":true}
Wheel
滚轮:{"type":"wheel","x":10,"y":20,"dx":0,"dy":16}
Key
键盘:{"type":"key","key":"Enter","pressed":true}
Ime
IME:{"type":"ime","kind":"commit","text":"你好"}
Focus
窗口焦点:{"type":"focus","focused":false}
CursorLeft
光标离开客户区:{"type":"cursor_left"}
Command
统一命令路由投递:{"type":"command","source":"menu","id":1}
不是 ShellEvent:真实来源(菜单/托盘/快捷键/第二实例)本来就不走窗口事件管线。
由 Agent 宿主直接投递到场景的 CommandRouter,并把统计写进语义摘要。
Implementations§
Source§impl ScriptEvent
impl ScriptEvent
Trait Implementations§
Source§impl Clone for ScriptEvent
impl Clone for ScriptEvent
Source§impl Debug for ScriptEvent
impl Debug for ScriptEvent
Source§impl<'de> Deserialize<'de> for ScriptEvent
impl<'de> Deserialize<'de> for ScriptEvent
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ScriptEvent
impl PartialEq for ScriptEvent
impl StructuralPartialEq for ScriptEvent
Auto Trait Implementations§
impl Forget for ScriptEvent
impl Freeze for ScriptEvent
impl Move for ScriptEvent
impl RefUnwindSafe for ScriptEvent
impl Send for ScriptEvent
impl Sync for ScriptEvent
impl Unpin for ScriptEvent
impl UnsafeUnpin for ScriptEvent
impl UnwindSafe for ScriptEvent
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more