mirror of
https://github.com/minetest/irrlicht.git
synced 2025-06-30 23:30:27 +02:00
CIrrDeviceLinux: Add support For TouchInput.touchedCount
This commit is contained in:
@ -112,6 +112,9 @@ CIrrDeviceLinux::CIrrDeviceLinux(const SIrrlichtCreationParameters& param)
|
||||
XDisplay(0), VisualInfo(0), Screennr(0), XWindow(0), StdHints(0), SoftwareImage(0),
|
||||
XInputMethod(0), XInputContext(0),
|
||||
HasNetWM(false),
|
||||
#endif
|
||||
#if defined(_IRR_LINUX_X11_XINPUT2_)
|
||||
currentTouchedCount(0),
|
||||
#endif
|
||||
Width(param.WindowSize.Width), Height(param.WindowSize.Height),
|
||||
WindowHasFocus(false), WindowMinimized(false),
|
||||
@ -1051,6 +1054,14 @@ bool CIrrDeviceLinux::run()
|
||||
irrevent.TouchInput.X = de->event_x;
|
||||
irrevent.TouchInput.Y = de->event_y;
|
||||
|
||||
if (irrevent.TouchInput.Event == ETIE_PRESSED_DOWN) {
|
||||
currentTouchedCount++;
|
||||
}
|
||||
irrevent.TouchInput.touchedCount = currentTouchedCount;
|
||||
if (currentTouchedCount > 0 && irrevent.TouchInput.Event == ETIE_LEFT_UP) {
|
||||
currentTouchedCount--;
|
||||
}
|
||||
|
||||
postEventFromUser(irrevent);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user