User interaction and event handling