T
T
Tsuzukeru2019-10-23 08:23:37
Java
Tsuzukeru, 2019-10-23 08:23:37

What happens after pressing the button (interview question)?

An event listener just fires, which calls the call back function, comes to mind. Can you explain the complete sequence? What does the OS, iron in more detail.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2019-10-23
@Tsuzukeru

Depends on the operating system. In a rough and general way, then:

  1. The mouse controller sends a signal to the processor;
  2. The processor causes an interrupt;
  3. An interrupt handler in the operating system kernel sends a signal to the graphics subsystem;
  4. The graphics subsystem checks where the cursor was at the time the signal occurred;
  5. The graphics subsystem writes a message to the queue of the window whose coordinates match the cursor coordinates;
  6. The application's graphics library in a loop reads messages from the queue, processes them, creates the appropriate events and passes them to the appropriate listeners;
  7. The listener executes your button click handler.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question