def Cancel(self) -> bool:
return self.pattern.Cancel() == S_OK<EOL>
Call IUIAutomationSynchronizedInputPattern::Cancel.
Cause the Microsoft UI Automation provider to stop listening for mouse or keyboard input.
Return bool, True if succeed otherwise False.
Refer https://docs.microsoft.com/en-us/windows/desktop/api/uiautomationclient/nf-uiautomationclient-iuiautomationsynchronizedinputpattern-cancel