maintain key state in key set