The main purpose is to monitor which key is pressed on the keyboard and convert it into ASCII code;
So how to use carriage return to replace the carriage return on the numeric keyboard? First of all, we need to know that the ASCII code of the carriage return is 13 and the ASCII code of the TAB key is 9, then it is easy to handle;
In the above code we used keyCode is used to implement Enter instead of the TAB key. It just makes a simple judgment. If the Enter (13) is pressed, we assign the value of TAB (9) to it (to deceive the computer). These small The accumulation of details is also a lot of wealth!