Improved handling of multi-scancode sequences