Improved scroll and keyboard management