Added function and logic for keyboard based selection for next/prev