Skip to content

input_event: Cope with toolkits which do not report the capslock modifier

Samuel Thibault requested to merge sthibaul/orca:capslock-qt into master

Qt, notably, does not actually record the CapsLock state in its keyboard events (see KeyboardModifier in qnamespace.h). It thus never reports it, and thus Orca can never know that double-Orca should disable capslock. A simple solution is to just make Orca remember when it sets it, to cope with the missing modifier bit.

The only drawback is that if some other application uses XkbLockModifiers to set the caps lock, and the user presses double-capslock to clear it from a Qt application, orca will not know it was already set, and set it again. Pressing double-capslock again will however clear it. Conversely, if some application uses XkbLockModifiers to clear the caps lock, and the user presses double-capslock to set it back, Orca will not know it was already cleared and just clear it again. Here as well, pressing double-capslock again will set it back.

In the end we have a robust way for orca to clear capslock even when the toolkit doesn't allow orca to know whether capslock is set or not: at worse by double-tapping capslock twice.

Merge request reports