How to make a select form element with textfields for the array id and key? In a custom module which I'm working on, I have a select list which currently has a hard-coded array of key=>value which could change and I would like to expose these options to the user. 

I would like to be able to have a select form element which contains one textfield for the user to enter the ID of the option and another for the user to enter the value of the option. I could make a separate form for these options, but I'd like to keep all the configurations on one page since there aren't too many. 

Does anyone know how I can make a select form element where the key and value of each option is keyed in by the user?
Do you know of Drupal's core field type "List" or what it's called and its "Allowed Values" field? Where admins can enter key|value pairs divided by a pipe character?

It's exactly what you seem to describe.

I'd start by mimicking exactly that. But all in one form. Maybe multi-step. Maybe peppered with some Ajax...