listen to keyboard events
resolve conflicts