I want to create a drop down list with keyboard keys as the options but I don't want to hardcode all of the keys and their codes.
Based on w3schools docs here I think you'll have to hardcode it. Why don't you just listen to a keyboard input from the user and save its value instead of the dropdown?