Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What happens from the moment we press a key on the keyboard, until it appears in your word document [closed]

This question was in my job interview.. I just to see whether I gave all the details...

like image 690
Protostome Avatar asked Jun 21 '10 09:06

Protostome


People also ask

What does happen when you pressed a key on the keyboard?

What happens in your computer when you press a key on your keyboard? First, a switch beneath the key closes, and current flows into a small chip in a keyboard. Each key has a scan code number, which corresponds to its position on the keyboard. The keyboard transmits this number as binary data to the computer's CPU.

When a key is pressed on keyboard which standard is used?

Detailed Solution. The correct answer is option 2, i.e. ASCII. The "ASCII", short for "American Standard Code for Information Interchange", is a "character encoding standard" format for electronic communication.

When a key is pressed on the keyboard the computer stores the ascii?

13 When a key is pressed on the keyboard, the computer stores the ASCII representation of the character typed into main memory.


1 Answers

  • mechanical switch short-circuits pull up R1 resistor end to the ground
  • a special multiplexor translates it into a message, to reduce the number of wires
  • the message interpreted by a CPU embedded in the keyboard
  • message translated to a USB protocol message, and modulated as a series of electric impulses of alternating voltage between zero and 5 volts
  • USB receiving hub measures samples line voltage periodically
  • host hub controller translates the message to data
  • data enters PC thru USB bus controller, connected to PCIE bus, thru a combination of IRQ notificaitons and a DMA transfer, issued by the bus driver
  • Bus driver interprets the message and forwards it along the driver stack, ultimately to an HID driver
  • HID driver talks to windows, ultimately resulting in a window message sent to a window belonging to msword process
  • WM_KEYDOWN is translated to WM_CHAR by DefWindowProc(). While key is down, multiple WM_CHARs may be created.
  • Word application catches WM_CHAR to add another character to the document model and issue re-rendering of UI
  • UI rendering engine translates unicode codepoint to graphical image by loading respective font
  • graphics engine computes the new image of the whole area to avoid flicker, and puts it pixel-by-pixel to the screen
like image 192
Pavel Radzivilovsky Avatar answered Nov 15 '22 22:11

Pavel Radzivilovsky