Do built in keyboards use polling or interrupts?

3

I was reading this question which says that USB keyboards use polling to see if keys are being pressed whereas PS/2 keyboards use interrupts.

I was wondering which method built in keyboards on a laptop use?

KNejad

Posted 2017-08-04T16:21:37.887

Reputation: 363

Both use a keyboard controller that scans the keys. For all you know, they could be using the same keyboard controller core. That question is simply not authoritative. The latency seen with USB keyboard is not due to any alleged "polling", but actually due to the inherent latency of USB devices connected on a shared peripheral bus versus a keyboard controller directly connected with the highest interrupt priority. A laptop is likely to have a PS/2 keyboard. – sawdust – 2017-08-04T19:07:17.643

Answers

2

Most classic laptops (with built-in non-detachable keyboards) use a dedicated keyboard controller (direct scanning of key matrix) that comes out of LPC bridge (sometimes called as "Super-I/O"). The LPC (Low Pin Count) bridge also controls all legacy devices, BIOS chip, timers, RTC etc. The LPC bridge comes out of a dedicated PCI unit, and the LPC bus supports all necessary interrupts.

If you check the PC device manager "by connection", and expand "ACPI xxx-based PC", you will eventually see all PCI devices. The keyboard will show up as PS/2, but this is only logically, there is no actual serial interface. So you can say that the laptop keyboard uses interrupts.

Various keyboardless devices as tablets use the USB interface to communicate with keyboard. Detachable keyboards also use USB. The key scanning electronics is local to the keyboard and processes all key-press and key-release events locally. The bus uses USB Periodic Transactions called "Interrupt Pipe" to get keyboard data, which is formally a form of polling.

Ale..chenski

Posted 2017-08-04T16:21:37.887

Reputation: 9 749

1

Built-in keyboards use the method corresponding to the interface they use and that interface is usually either PS/2 or USB.

In Windows 7, you can check by opening up Device Manager and looking under Keyboards. In my sample size of one, I've got a HID Keyboard Device and a Standard PS/2 Keyboard. The former is an external USB keyboard (it disappears when I unplug it), so the latter must be my built-in keyboard.

8bittree

Posted 2017-08-04T16:21:37.887

Reputation: 2 595