mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 09:52:27 -04:00
better handle touchscreens
This commit is contained in:
parent
b13c210550
commit
928aec618d
@ -1409,11 +1409,7 @@ do_transmit_data(DataGraphTraverser *trav, const DataNodeTransmit &input,
|
||||
output.set_data(_pixel_size_output, pixel_size);
|
||||
_pixel_size = pixel_size;
|
||||
|
||||
if (!input.has_data(_xy_input)) {
|
||||
// No mouse in the window.
|
||||
set_no_mouse();
|
||||
|
||||
} else {
|
||||
if (input.has_data(_xy_input)) {
|
||||
// The mouse is within the window. Get the current mouse position.
|
||||
const EventStoreVec2 *xy, *pixel_xy;
|
||||
DCAST_INTO_V(xy, input.get_data(_xy_input).get_ptr());
|
||||
@ -1570,6 +1566,14 @@ do_transmit_data(DataGraphTraverser *trav, const DataNodeTransmit &input,
|
||||
}
|
||||
}
|
||||
|
||||
if (!input.has_data(_xy_input)) {
|
||||
// No mouse in the window. We check this down here, below the
|
||||
// button checking, in case the mouse left the window in the same
|
||||
// frame it released a button (particularly likely with a
|
||||
// touchscreen input that's emulating a mouse).
|
||||
set_no_mouse();
|
||||
}
|
||||
|
||||
// Now check the inactivity timer.
|
||||
if (_has_inactivity_timeout) {
|
||||
if (activity) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user