handle WM_MOUSEWHEEL and WM_POINTERUPDATE for the Windows Ink stylus driver
This commit is contained in:
@@ -623,20 +623,6 @@ bool App::mouse_down(int button, float x, float y)
|
||||
e.m_type = button ? kEventType::MouseDownR : kEventType::MouseDownL;
|
||||
e.m_pos = { x / zoom, y / zoom };
|
||||
auto ret = layout[main_id]->on_event(&e);
|
||||
//LOG("mouse click button%d pos %f %f", button, x, y);
|
||||
|
||||
// if (popup)
|
||||
// {
|
||||
// layout[main_id]->remove_child(popup);
|
||||
// popup = nullptr;
|
||||
// }
|
||||
// if (button == 1)
|
||||
// {
|
||||
// popup = (NodePopupMenu*)layout[const_hash("popup-menu")]->m_children[0]->clone();
|
||||
// popup->SetPositioning(YGPositionTypeAbsolute);
|
||||
// popup->SetPosition(x / zoom, y / zoom);
|
||||
// layout[main_id]->add_child(popup);
|
||||
// }
|
||||
layout[main_id]->update();
|
||||
return ret == kEventResult::Consumed;
|
||||
}
|
||||
@@ -657,7 +643,16 @@ bool App::mouse_up(int button, float x, float y)
|
||||
e.m_pos = { x / zoom, y / zoom };
|
||||
auto ret = layout[main_id]->on_event(&e);
|
||||
layout[main_id]->update();
|
||||
//LOG("mouse up button%d pos %f %f", button, x, y);
|
||||
return ret == kEventResult::Consumed;
|
||||
}
|
||||
bool App::mouse_scroll(float x, float y, float delta)
|
||||
{
|
||||
MouseEvent e;
|
||||
e.m_type = kEventType::MouseScroll;
|
||||
e.m_pos = { x / zoom, y / zoom };
|
||||
e.m_scroll_delta = delta;
|
||||
auto ret = layout[main_id]->on_event(&e);
|
||||
layout[main_id]->update();
|
||||
return ret == kEventResult::Consumed;
|
||||
}
|
||||
bool App::key_down(int key)
|
||||
@@ -667,7 +662,6 @@ bool App::key_down(int key)
|
||||
e.m_key = key;
|
||||
auto ret = layout[main_id]->on_event(&e);
|
||||
layout[main_id]->update();
|
||||
//LOG("key down %d '%c'", key, key);
|
||||
return ret == kEventResult::Consumed;
|
||||
}
|
||||
bool App::key_up(int key)
|
||||
@@ -677,7 +671,6 @@ bool App::key_up(int key)
|
||||
e.m_key = key;
|
||||
auto ret = layout[main_id]->on_event(&e);
|
||||
layout[main_id]->update();
|
||||
//LOG("key up %d '%c'", key, key);
|
||||
return ret == kEventResult::Consumed;
|
||||
}
|
||||
bool App::key_char(int key)
|
||||
@@ -687,6 +680,5 @@ bool App::key_char(int key)
|
||||
e.m_key = key;
|
||||
auto ret = layout[main_id]->on_event(&e);
|
||||
layout[main_id]->update();
|
||||
//LOG("key up %d '%c'", key, key);
|
||||
return ret == kEventResult::Consumed;
|
||||
}
|
||||
Reference in New Issue
Block a user