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

Main window focus #9

Closed
wants to merge 35 commits into from
Closed

Conversation

Foundit3923
Copy link
Contributor

@Foundit3923 Foundit3923 commented Aug 23, 2024

@Foundit3923
Copy link
Contributor Author

I think this is ready.

  • closes Add easy way to set the game to be in focus #6
  • adds pywinctl to dependencies in .toml
  • gets main window handle on startup
  • adds imports for pywinctl, win32gui, win32process, and _internal
  • adds a function to focus main window with set_main_window_focus()
  • adds a function to evaluate if the main window is the foreground with is_main_window_foreground()
  • adds a function to retrieve the main window as a Window object with get_main_window

import logging
from typing import Optional
import logging
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logging is imported twice

@@ -260,7 +260,8 @@ def on_update(_, app_data, user_data):
source=tag,
callback=on_update,
user_data=(cls, variable),
**extra_args,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these changes are not required. If you want to have on_enter=True, then specify it in the STRING variable decorator as an extra arg and it will come through to here (cf. lines 257 & 258)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add easy way to set the game to be in focus
2 participants