Expanded to handle mouse/touch too

Done until I've got something to do with this input