Connect your MIDI keyboard to your computer and head to Layout Mode inside MainStage. This can be found on the top-left corner of your screen.
Once in Layout Mode, click on the image of the keyboard in the workspace. Click 'Assign' in the list of controls to the left of your screen. Once 'Assign' appears red, play any note on your keyboard. You should see the MIDI Port section display the name of your connected keyboard. Click 'Assign' to exit learn mode.
Repeat the process for your sustain pedal. Select the image of the sustain pedal to the right of the keyboard and click 'Assign' again. Now, step on your sustain pedal and MainStage will learn the input. Click 'Assign' to exit learn mode.
Note: Your MainStage window may look slightly different if you're not using our StageReady template, but all the steps above are the same.