Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Exception due to PyautoGUI's Failsafe feature #5

Open
blazenkits opened this issue Jan 13, 2024 · 0 comments · May be fixed by #6
Open

[BUG] Exception due to PyautoGUI's Failsafe feature #5

blazenkits opened this issue Jan 13, 2024 · 0 comments · May be fixed by #6
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@blazenkits
Copy link

Describe the bug
Because of PyAutoGUI's failsafe feature, set by pyautogui.FAILSAFE, the script breaks when the user pushes towards the top-left corner of the screen.

To Reproduce
Steps to reproduce the behavior:

  1. Move the mouse into the top-left corner of the screen. This bug may also occur commonly on start-up where the mouse is already at the leftmost corner.

Expected behavior
The program should not break due to user input.

Screenshots
A generated error message:

2024-01-13 17:22:14,771 - Unhandled exception in listener callback
Traceback (most recent call last):
  File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\pynput\_util\__init__.py", line 228, in inner
    return f(self, *args, **kwargs)
  File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\pynput\keyboard\_win32.py", line 290, in _process
    self.on_release(key)
  File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\pynput\_util\__init__.py", line 144, in inner
    if f(*args) is False:
  File "C:\Users\User\Desktop\Academics\Projects\MouseYoke\msfs_mouse_yoke\mouse_yoke.py", line 79, in onKeyRelease
    if active: moveTo(last_x_position, last_y_position)
  File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\pyautogui\__init__.py", line 597, in wrapper
    failSafeCheck()
  File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\pyautogui\__init__.py", line 1722, in failSafeCheck
    raise FailSafeException(
pyautogui.FailSafeException: PyAutoGUI fail-safe triggered from mouse moving to a corner of the screen. To disable this fail-safe, set pyautogui.FAILSAFE to False. DISABLING FAIL-SAFE IS NOT RECOMMENDED.

Desktop specs (please complete the following information):

  • OS: Windows 11
  • OS 64 bits
  • CPU Model: Intel i7 11th generation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
2 participants