| 81 | } |
| 82 | |
| 83 | void KeyPressCatcher::loop() |
| 84 | { |
| 85 | if (!AXIsProcessTrusted()) |
| 86 | { |
| 87 | if (m_accessibility_granted) |
| 88 | { |
| 89 | notifyUserAboutLostPrivileges(); |
| 90 | m_accessibility_granted = false; |
| 91 | } |
| 92 | } |
| 93 | else |
| 94 | { |
| 95 | if (!m_accessibility_granted) |
| 96 | { |
| 97 | notifyAboutSuccessfulStart(); |
| 98 | m_accessibility_granted = true; |
| 99 | } |
| 100 | } |
| 101 | |
| 102 | if (!m_successfully_started) |
| 103 | { |
| 104 | m_successfully_started = init(); |
| 105 | } |
| 106 | |
| 107 | QTimer::singleShot(1000, [this] { loop(); }); |
| 108 | } |
| 109 | |
| 110 | void KeyPressCatcher::sendSystemDefaultChangeLanguageShortcut() |
| 111 | { |
nothing calls this directly
no outgoing calls
no test coverage detected