mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 09:52:27 -04:00
Merge pull request #50 from eswartz/pr_rocket_keys_before_mice
Send libRocket key events before mouse events
This commit is contained in:
commit
3c9a0f99a9
@ -302,30 +302,6 @@ void RocketInputHandler::
|
||||
update_context(Rocket::Core::Context *context, int xoffs, int yoffs) {
|
||||
MutexHolder holder(_lock);
|
||||
|
||||
if (_mouse_xy_changed) {
|
||||
_mouse_xy_changed = false;
|
||||
|
||||
context->ProcessMouseMove(_mouse_xy.get_x() - xoffs,
|
||||
_mouse_xy.get_y() - yoffs, _modifiers);
|
||||
}
|
||||
|
||||
if (_mouse_buttons.size() > 0) {
|
||||
ButtonActivityMap::const_iterator it;
|
||||
for (it = _mouse_buttons.begin(); it != _mouse_buttons.end(); ++it) {
|
||||
if (it->second) {
|
||||
context->ProcessMouseButtonDown(it->first, _modifiers);
|
||||
} else {
|
||||
context->ProcessMouseButtonUp(it->first, _modifiers);
|
||||
}
|
||||
}
|
||||
_mouse_buttons.clear();
|
||||
}
|
||||
|
||||
if (_wheel_delta != 0) {
|
||||
context->ProcessMouseWheel(_wheel_delta, _modifiers);
|
||||
_wheel_delta = 0;
|
||||
}
|
||||
|
||||
if (_keys.size() > 0) {
|
||||
ButtonActivityMap::const_iterator it;
|
||||
for (it = _keys.begin(); it != _keys.end(); ++it) {
|
||||
@ -356,5 +332,29 @@ update_context(Rocket::Core::Context *context, int xoffs, int yoffs) {
|
||||
_text_input.clear();
|
||||
}
|
||||
|
||||
if (_mouse_xy_changed) {
|
||||
_mouse_xy_changed = false;
|
||||
|
||||
context->ProcessMouseMove(_mouse_xy.get_x() - xoffs,
|
||||
_mouse_xy.get_y() - yoffs, _modifiers);
|
||||
}
|
||||
|
||||
if (_mouse_buttons.size() > 0) {
|
||||
ButtonActivityMap::const_iterator it;
|
||||
for (it = _mouse_buttons.begin(); it != _mouse_buttons.end(); ++it) {
|
||||
if (it->second) {
|
||||
context->ProcessMouseButtonDown(it->first, _modifiers);
|
||||
} else {
|
||||
context->ProcessMouseButtonUp(it->first, _modifiers);
|
||||
}
|
||||
}
|
||||
_mouse_buttons.clear();
|
||||
}
|
||||
|
||||
if (_wheel_delta != 0) {
|
||||
context->ProcessMouseWheel(_wheel_delta, _modifiers);
|
||||
_wheel_delta = 0;
|
||||
}
|
||||
|
||||
context->Update();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user