public char nextKeyTyped(){
synchronized (keyLock) {
    return keysTyped.removeLast();
  }
}

public char nextKeyTyped ( ) { synchronized ( keyLock ) { return keysTyped . removeLast ( ) ; } }
the next key typed by the user .
