boolean parsing = true;
//use a position instead of changing the array
int position = 0;
//if we get a paste or have input lag this should parse it correctly...
while(parsing) {
Key inc = Key.findStartKey(input, position);
if(input.length > inc.getKeyValues().length+position) {
position += inc.getKeyValues().length;
}
else {
parsing = false;
}