When ever I use the touchscreen on the sdl window, it would always crash, and I found that in src/javascript/events/index.js, for the touch case, it determines the device variable using Globals.touchState, but when I looked through the code, Globals.touchState is not found anywhere, but when I tried using Globals.touchDevices, it did not crash and it seemed to work properly.
Here is my fixed version for the touch case:
case 'touch': {
const { touchId } = event
delete event.touchId
let device = Globals.touchDevices.find(({ id }) => id === touchId)
if (device === undefined) {
Globals.touchDevices = Bindings.touch_getDevices()
device = Globals.touchDevices.find(({ id }) => id === touchId)
}
const { windowId } = event
delete event.windowId
const window = Globals.windows.all.get(windowId)
if (!window) { return }
event.device = device
window.emit(type, event)
} break
When ever I use the touchscreen on the sdl window, it would always crash, and I found that in
src/javascript/events/index.js, for thetouchcase, it determines the device variable usingGlobals.touchState, but when I looked through the code,Globals.touchStateis not found anywhere, but when I tried usingGlobals.touchDevices, it did not crash and it seemed to work properly.Here is my fixed version for the
touchcase: