Skip to content

Error with screen_size() in Windows #12

@gsbabil

Description

@gsbabil

Hi, I am getting errors as following on Windows when calling screen_size():

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "pymouse\windows.py", line 49, in screen_size
    def screen_size(self):
NameError: global name 'GetSystemMetrics' is not defined

It was fixed by replacing the screen_size() inside window.py with the following:

    def screen_size(self):
        width = windll.user32.GetSystemMetrics(0)
        height = windll.user32.GetSystemMetrics(1)
        return width, height

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions