Added support for keypress threshold value.