• Jarkko Koivikko's avatar
    Clear toggle shift timer when appropriate · dc4e962f
    Jarkko Koivikko authored
    
    The timer in the ShiftHandler is used for detecting double
    click events for shift key. A double click event will trigger
    caps lock if the initial shift state is lower case.
    
    However, the implementation did not handle a case where
    the keyboard layout changes between the first and second
    press. This can be done with multitouch.
    
    The second problem was with the automatic test cases, where
    the test code toggles the shift to see if there is a secondary
    layout triggered by the shift key, e.g. in Arabic and Farsi.
    However, if the keyboard layout does not contain secondary
    layout, rapid shift state change will trigger caps lock
    instead. This issue was identified with certain test case for
    Hebrew layout.
    
    This change fixes the issue by clearing the shift toggle timer
    when the layout changes and in the automatic tests while
    checking for the secondary layout with the shift key.
    
    Also, update test code so that the shift press is simulated
    with mouse. This will ensure the key exists in the layout
    and that the key is enabled.
    
    Change-Id: I2a528f1b82c30e8b8d9746d380b32ee370b38004
    Reviewed-by: default avatarMitch Curtis <mitch.curtis@qt.io>
    dc4e962f