Lets start over. You said you wanted to send a text message using the Arduino, GSM shield, and PS/2 keyboard.
I guess the keyboard answers the question of where the data is coming from.
The thing that triggers the Arduino to send the command to the GSM and the thing that triggers the GSM to send the text message do not have to be the same event.
The Arduino will need to collect the phone number in a String object. How will the Arduino know when the phone number entry is complete? Carriage return?
The Arduino will need to collect the message in a String object. How will the Arduino know that the message is complete? Carriage return?
When the phone number entry is complete, and the message entry is complete, the Arduino needs to construct a command to send to the SMS module.That command string needs to include the phone number, a carriage return, the message, and a control Z.
The control Z is required because messages can have carriage returns in them, so carriage return is not a good end of message marker.
If you want to limit yourself to messages without carriage returns, so that you can use the carriage return as an end of message marker, that's fine with me. The command sent to the SMS module still needs to end with a control Z. The Arduino has no problem generating the control Z.