Event handler for touch devices