Kobo single touch protocol and runtime detection

I've added input support for Kobo devices. Actually coordinates for X and Y are reported swapped, I swap them back in gesturedetector.lua but this way swiping is still wrong. Any idea on where to do this correctly?