What is the difference between keyboard interface ps2 and usb interface
The difference between keyboard interface ps2 and usb interface: 1. A data packet of USB keyboard has only 8 bytes, 2 bytes mark the status, and the remaining 6 bytes are used to record the current press or pop-up Scan code of the key that is activated; 2. PS2 will report whatever is pressed and whatever is popped up. If 10 keys are pressed at the same time, it will be reported 10 times in sequence.
The difference between keyboard interface ps2 and usb interface:
Simply put: a data packet of USB keyboard only 8 bytes (why there are only 8? This is because the protocol stipulates this. The reason why the protocol stipulates this is because the USB speed was slow in the early days, and the maximum number of packets transmitted using interrupts was 8 bytes), of which 2 bytes mark the status. , the remaining 6 bytes are used to record the scan code of the currently pressed or popped-up button, so the USB keyboard can describe the status of up to 6 buttons at the same time.
This deceptive design specification of the USB keyboard results in that it can only achieve up to 6 keys without rollover. To solve this problem, the USB keyboard specifications must be redesigned, but I guess no one is willing to do this, because this thing works well, and most people will not press 6 keys at the same time.
As for the PS/2 keyboard, this specification is not used. PS/2 is: report whatever is pressed, and report whatever is popped up. If 10 keys are pressed at the same time, 10 will be reported in sequence. There is no protocol limit on how many key press events can be recorded at the same time. It depends on the operating system itself. Therefore, the PS/2 keyboard can theoretically achieve unlimited key presses without rollover.
Of course, some people have indeed seen USB keyboards break the 6-key limit. One of the possible reasons is: the USB device built into this keyboard is a multiple keyboard USB HUB, because USB allows multi-level Device connection, so you can break the 6 limit.
Of course, it is also a solution to bring the USB keyboard's own driver, because although the interrupt transmission only has 6 bytes, the Bulk transmission can transmit 256 bytes without any problem. (Note: I searched on Baidu myself and found that although many manufacturers have implemented USB full-key rollover, there seem to be a lot of bugs. It seems that the technology still needs to be developed.) In short, the specifications are the specifications, and there are always those that are not restricted by the specifications. Method.
Related free recommendations: Programming video course
The above is the detailed content of What is the difference between keyboard interface ps2 and usb interface. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 Linux new version
SublimeText3 Linux latest version

Dreamweaver Mac version
Visual web development tools

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

SublimeText3 Mac version
God-level code editing software (SublimeText3)