I think dbInput reads escape key presses into the buffer, so that's why it's going through default.
Put dbClearEntryBuffer() at the end of the loop.
And dbInput, the way that you are using it, is causing a memory leak every call. Use it this way:
char* input = dbInput();
selection = atoi(input);
delete[] input;
Do you expect your program to exit when you press ESC? Because LoopGDK needs to be included in the while loop, because that's what checks for it.
As an alternative to dbInput, you could use dbInKey, which returns a char of the key being pressed.
"A computer once beat me at chess, but it was no match for me at kick boxing."
Emo Philips