added key support to switch tabs and updated scrolling logic