Fixing the shift key mask and cleaning up the scrolling code.