|
|
|
|
|
|
return PointerData::DeviceKind::kTouch; |
|
|
|
} |
|
|
|
|
|
|
|
void UIWidgetsPanel::OnKeyDown(int keyCode, bool isKeyDown) { |
|
|
|
void UIWidgetsPanel::OnKeyDown(int keyCode, bool isKeyDown, int64_t modifier) { |
|
|
|
if (process_events_) { |
|
|
|
UIWidgetsPointerEvent event = {}; |
|
|
|
event.phase = isKeyDown ? UIWidgetsPointerPhase::kMouseDown : UIWidgetsPointerPhase::kMouseUp; |
|
|
|
|
|
|
std::chrono::duration_cast<std::chrono::microseconds>( |
|
|
|
std::chrono::high_resolution_clock::now().time_since_epoch()) |
|
|
|
.count(); |
|
|
|
event.modifier = modifier; |
|
|
|
|
|
|
|
UIWidgetsEngineSendPointerEvent(engine_, &event, 1); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UIWIDGETS_API(void) |
|
|
|
UIWidgetsPanel_onKey(UIWidgetsPanel* panel, int keyCode, bool isKeyDown) { |
|
|
|
panel->OnKeyDown(keyCode, isKeyDown); |
|
|
|
UIWidgetsPanel_onKey(UIWidgetsPanel* panel, int keyCode, bool isKeyDown, int64_t modifier) { |
|
|
|
panel->OnKeyDown(keyCode, isKeyDown, modifier); |
|
|
|
} |
|
|
|
|
|
|
|
UIWIDGETS_API(void) |
|
|
|