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

Add Keyboard Shortcuts For Pausing Game & Not Requeuing Next Match #48

Merged
merged 5 commits into from
Oct 3, 2024

Conversation

Kyrluckechuck
Copy link
Contributor

Description

This re-adds the keyboard shortcuts functionality from https://github.com/Kyrluckechuck/TFT-Bot, adding initially just two functions:

  • To pause the bot so that the "next" action won't occur
  • To stop the bot from re-queing next game, which is useful for if you want it to finish up the game but not start another so you can use it, etc.

I'm open to suggestions on cleaner implementations, but basically just ripped it right out of the old bot for simplicity 😅

@Kyrluckechuck Kyrluckechuck requested a review from akshualy October 1, 2024 23:52
Copy link
Contributor

@akshualy akshualy left a comment

Choose a reason for hiding this comment

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

There probably can be logic improvements but I trust you that this will work :p Feel free to merge after the sleep changes

main.py Outdated Show resolved Hide resolved
main.py Outdated Show resolved Hide resolved
Setup hotkey listeners
"""
keyboard.add_hotkey("alt+p", lambda: toggle_pause()) # pylint: disable=unnecessary-lambda
keyboard.add_hotkey("alt+n", lambda: toggle_play_next_game()) # pylint: disable=unnecessary-lambda
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this compatible with MacOS? I'm on mobile so can't look it up that well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great question -- unfortunately I'm not sure! 😬

@Kyrluckechuck Kyrluckechuck merged commit e3a8290 into main Oct 3, 2024
4 checks passed
@Kyrluckechuck Kyrluckechuck deleted the ky/add-keyboard-shortcuts branch October 3, 2024 00:30
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.

2 participants