Event handler

From Free net encyclopedia

(Difference between revisions)

Current revision

Template:Mergeto Template:Cleanup-date An event handler is a subroutine in a computer program or operating system that allows handling of asynchronous hardware and software events using a generalized procedural interface (i.e., a computer software process is initiated). "Events" may be considered a form of input in a computer system (e.g., as a signal of some change of state). Events are typically generated by interrupts from hardware devices, software interrupt instructions, e.g., from the operating system, and computer user interfaces. For example, events may include network interface cards requesting service, the clicking of a mouse, a clock/timer reaching some predetermined time, the dragging of a scrollbar within a windowing system, or the pressing of a button on a keyboard. Without event handlers, few computers could operate, as even bootstrap loaders are simple forms of event handlers.

Events may first be processed by an event dispatcher within an operating system. An event dispatcher typically manages the associations between events and event handlers, and may queue event handlers or events for later processing. Event dispatchers may call event handlers directly, or wait for events to be dequeued with information about the handler to be executed.

How any particular event handling system functions is highly dependent on the computer hardware, the operating system, the programming language, and the application program's environment. A programmer will need to consult the documentation provided in order to understand exactly how to use an event handling system. Users typically need only know how the interface to applications, windowing systems, and console terminals function.

See also


External links