I've just glanced over this post whilst eating a sandwhich quickly but as long as I understand you right then you may gain the knowledge you need from this snippet from Iro's console code:
if (dbScanCode() != 0 && dbScanCode() != KEY_BACKSPACE && dbScanCode() != KEY_ENTER) {
szUserInput += dbGetEntry();
} else {
if (dbScanCode() == KEY_BACKSPACE) {
if (dbTimer() - nBackspaceTimer > BACKSPACE_PAUSE) {
if (szUserInput.size() > 0) {
szUserInput.resize(szUserInput.size() - 1);
nBackspaceTimer = dbTimer();
}
}
}
if (dbScanCode() == KEY_ENTER) {
if (dbTimer() - nNewLineTimer > NEWLINE_PAUSE) {
if (szUserInput.size() > 0) {
DoConsoleCommand(szUserInput);
szUserInput.clear();
nConsoleBufferIndex = 0;
nNewLineTimer = dbTimer();
}
}
}
}
dbClearEntryBuffer();
the variables with the word Timer in them are simply integers used to stop the same command repeating really fast when a user holds down a key.
the KEY_blah variables are constants holding the scan codes of the keys im checking. (Backspace = 14, enter/return = 28)
Hopefully that helps. If you dont understand some part, just ask
EDIT:
should point out that szUserInput is a c++ string object.