浏览代码

update android release & buttons -> previous_buttons

/main
siyao 3 年前
当前提交
5c4848b9
共有 3 个文件被更改,包括 5 次插入5 次删除
  1. 8
      engine/src/lib/ui/window/pointer_data_packet_converter.cc
  2. 2
      engine/src/lib/ui/window/pointer_data_packet_converter.h

8
engine/src/lib/ui/window/pointer_data_packet_converter.cc


PointerData synthesized_hover_event = pointer_data;
synthesized_hover_event.change = PointerData::Change::kHover;
synthesized_hover_event.synthesized = 1;
synthesized_hover_event.buttons = state.buttons;
synthesized_hover_event.buttons = state.previous_buttons;
UpdateDeltaAndState(synthesized_hover_event, state);
converted_pointers.push_back(synthesized_hover_event);

PointerData synthesized_move_event = pointer_data;
synthesized_move_event.change = PointerData::Change::kMove;
synthesized_move_event.synthesized = 1;
synthesized_move_event.buttons = state.buttons;
synthesized_move_event.buttons = state.previous_buttons;
UpdateDeltaAndState(synthesized_move_event, state);
converted_pointers.push_back(synthesized_move_event);

PointerState state;
state.pointer_identifier = 0;
state.isDown = false;
state.buttons = pointer_data.buttons;
state.previous_buttons = pointer_data.buttons;
state.physical_x = pointer_data.physical_x;
state.physical_y = pointer_data.physical_y;
states_[pointer_data.device] = state;

PointerState& state) {
pointer_data.physical_delta_x = pointer_data.physical_x - state.physical_x;
pointer_data.physical_delta_y = pointer_data.physical_y - state.physical_y;
state.buttons = pointer_data.buttons;
state.previous_buttons = pointer_data.buttons;
state.physical_x = pointer_data.physical_x;
state.physical_y = pointer_data.physical_y;
states_[pointer_data.device] = state;

2
engine/src/lib/ui/window/pointer_data_packet_converter.h


struct PointerState {
int32_t pointer_identifier;
bool isDown;
int64_t buttons;
int64_t previous_buttons;
float physical_x;
float physical_y;
};

部分文件因为文件数量过多而无法显示

正在加载...
取消
保存