Detecting user input via event listening