captureMouse
Capture the mouse for this widget's data.
(i.e. eventMatch return true for this widget and false for all others)
and capture is explicitly released when passing null.
Tracks the widget's id / subwindow / rect, so that .position mouse events can still
be presented to widgets who's rect overlap with the widget holding the capture.
(which is what you would expect for e.g. background highlight)
Only valid between Window.beginand Window.end.
Parameters
- wd:?*const WidgetData
- ?*const WidgetData
- event_num:u16
- u16
Source
Implementation
pub fn captureMouse(wd: ?*const WidgetData, event_num: u16) void {
const cm = if (wd) |wdata| CaptureMouse{
.id = wdata.id,
.rect = wdata.borderRectScale().r,
.subwindow_id = subwindowCurrentId(),
} else null;
captureMouseCustom(cm, event_num);
}