better input detection and handling

now supports gestures (tap, hold, pan) in addition to mouse up/down and
key events