Event-driven programming is a programming paradigm in which the flow of the program is determined by external events. UI events from mice, keyboards, touchpads and touchscreens, and external sensor inputs are common cases. Events may also be programmatically generated, such as from messages from other programs, notifications from other threads, or other network events.