edit keyselect function

Signed-off-by: Alexandr <yakovlev@primepix.ru>