>>also a check to see if the current input is the same as the last

This would prevent the user from typing a strings with the same characters in a row however. An alternate method would be to create a timer. Trip the timer (reset to 0) when a key is pressed. Dont log any further input to your string until the timer has reached a certain delay (maybe 0.2 seconds or something).