1. Chapter 4 -- Basics of Event HandlingAt the heart of user interface software is the event model for communication between interactive objects and the input/output system.…