solves the keypress problem
allows custom thread to manage the scanKeys function