Keyboard function

Hello,

you sound very confused.

If your car has an Arduino mounted and you control it remotely from your PC, why should the Arduino provide you with keyboard codes for a device it doesn't have? That sounds more like you should look up in the documentation of your PC-Programming platform and not on the Arduino side how to handle keyboard input.

As a general note, you should first clean make at least a rough concept about how your system is going to work. Get rid of all the "Magic happens here" parts. My guess is you're going to need about 4 ports in your software:

[1] On your PC something to handle the key commands you issue.
[2] On your PC something to send the commands read in Step 1 to the Arduino
[3] On the Arduino something to handle the received commands from the PC created in Step 2
[4] On the Arduino something to execute the received commands from step 3 on the car hardware to change direction or speed.

Each of these modules can be refined and tested individually, usually quite independent of the rest. In Step [1] you will work only on your PC and work on the user interface, Step [4] will deal with your car hardware and how to attach it to the Arduino, in Steps [2] and [3] you will mess around with the communication between the PC and the Arduino.

Good luck.

Korman