浏览代码

update ios, android and windows

/main
siyao 3 年前
当前提交
16e43000
共有 6 个文件被更改,包括 15 次插入13 次删除
  1. 8
      engine/src/shell/platform/unity/android/uiwidgets_panel.cc
  2. 2
      engine/src/shell/platform/unity/android/uiwidgets_panel.h
  3. 2
      engine/src/shell/platform/unity/darwin/ios/uiwidgets_panel.h
  4. 7
      engine/src/shell/platform/unity/darwin/ios/uiwidgets_panel.mm
  5. 7
      engine/src/shell/platform/unity/windows/uiwidgets_panel.cc
  6. 2
      engine/src/shell/platform/unity/windows/uiwidgets_panel.h

8
engine/src/shell/platform/unity/android/uiwidgets_panel.cc


return PointerData::DeviceKind::kTouch;
}
void UIWidgetsPanel::OnKeyDown(int keyCode, bool isKeyDown)
void UIWidgetsPanel::OnKeyDown(int keyCode, bool isKeyDown, int64_t modifier)
{
if (process_events_)
{

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)

2
engine/src/shell/platform/unity/android/uiwidgets_panel.h


void VSyncCallback(intptr_t baton);
void OnKeyDown(int keyCode, bool isKeyDown);
void OnKeyDown(int keyCode, bool isKeyDown, int64_t modifier);
void OnMouseMove(float x, float y, int button);

2
engine/src/shell/platform/unity/darwin/ios/uiwidgets_panel.h


void SetEventLocationFromCursorPosition(UIWidgetsPointerEvent* event_data);
void OnKeyDown(int keyCode, bool isKeyDown);
void OnKeyDown(int keyCode, bool isKeyDown, int64_t modifier);
void OnMouseMove(float x, float y, int button);

7
engine/src/shell/platform/unity/darwin/ios/uiwidgets_panel.mm


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)

7
engine/src/shell/platform/unity/windows/uiwidgets_panel.cc


}
}
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)

2
engine/src/shell/platform/unity/windows/uiwidgets_panel.h


void SetEventLocationFromCursorPosition(UIWidgetsPointerEvent* event_data);
void OnKeyDown(int keyCode, bool isKeyDown);
void OnKeyDown(int keyCode, bool isKeyDown, int64_t modifier);
void OnMouseMove(float x, float y);

正在加载...
取消
保存