Modeling user input as event streams