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

Feature Request - Specify a window/app to pause/unpause instead of active window #177

Closed
JReming85 opened this issue Jul 23, 2023 · 23 comments

Comments

@JReming85
Copy link

Hi there,

Loving the program so far and seems to be better then my previous setup of using Cheat Engine to pause the process or set the speed to 0.01

However could you possible add a new feature to add a hotkey to suspend a predefined window/application?

I mainly use this for gaming, and I generally use a controller while also not having the game window as active.. (browsing web, watching videos or anime, etc) and would like to just pause without needing to click back into the game.

Think this is a feature you would be interested in implementing?

@JReming85 JReming85 changed the title Ability to specify program to suspend without being active Feature Request - Specify a window/app to pause/unpause instead of active window Jul 23, 2023
@Merrit
Copy link
Owner

Merrit commented Jul 24, 2023

We could probably add an optional command line argument, so that it would be possible to specify maybe the executable you want suspended - something like:

nyrna --toggle --exe=darksouls.exe

Then just add that command to a shortcut for your system, and create as many as you like. Would that work for your uses?

@JReming85
Copy link
Author

That would work, but I would also like a hotkey so I can easily trigger it from my controller.

I am sure I can figure a way to run a link/cmd via a macro but would be so much easier if I could just set a special hotkey

Thanks

@Merrit
Copy link
Owner

Merrit commented Jul 24, 2023

I will give it some thought :)

@JReming85
Copy link
Author

Appreciate it

Merrit added a commit that referenced this issue Jul 25, 2023
Allows users to set hotkeys for specific apps. They can choose the
executable name from a list of running apps and set a hotkey for it.

When the hotkey is pressed, all instances of the app will be toggled
between suspended and resumed.

Resolves #177
@Merrit
Copy link
Owner

Merrit commented Aug 1, 2023

I added the ability to assign a hotkey to specific apps.

Please give this a try and let me know if that works for you. :)

Nyrna-Windows-Portable.zip
Nyrna-Linux-Portable.tar.gz

@JReming85
Copy link
Author

JReming85 commented Aug 1, 2023 via email

@JReming85
Copy link
Author

JReming85 commented Aug 1, 2023 via email

@Merrit
Copy link
Owner

Merrit commented Aug 1, 2023

That is weird. I'll spin up a Windows 11 machine so I can test it.

@JReming85
Copy link
Author

JReming85 commented Aug 1, 2023 via email

@Merrit
Copy link
Owner

Merrit commented Aug 2, 2023

Alright, think I have fixed that now. Please give this one a try. 🤞

Nyrna-Windows-Portable.zip
Nyrna-Linux-Portable.tar.gz

@JReming85
Copy link
Author

This is awesome, thank you again for working on this!

@Merrit
Copy link
Owner

Merrit commented Aug 3, 2023

I'll take it that means it works for you 😁

@JReming85
Copy link
Author

JReming85 commented Aug 3, 2023 via email

@JReming85
Copy link
Author

JReming85 commented Aug 4, 2023

2 big issues so far

  1. I can't change the global hotkey. It crashes right before/after it captures the new one
  2. It is extremely slow to pause/unpause, both globally and specific windows.
Log error
  ERROR ┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
  ERROR │ PathAccessException: Cannot delete file, path = 'C:\Users\Jeremyr\AppData\Roaming\com.example\nyrna\log.txt' (OS Error: The process cannot access the file because it is being used by another process.
  ERROR │ , errno = 32)
  ERROR ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
  ERROR │ #0   _checkForErrorResponse (dart:io/common.dart:55)
  ERROR │ #1   _File._delete.<anonymous closure> (dart:io/file_impl.dart:315)
  ERROR │ #2   <asynchronous suspension>
  ERROR │ #3   LoggingManager.initialize (package:nyrna/logs/logging_manager.dart:37)
  ERROR │ #4   <asynchronous suspension>
  ERROR │ #5   _VerboseLoggingTileState.build.<anonymous closure> (package:nyrna/settings/settings_page.dart:114)
  ERROR │ #6   <asynchronous suspension>
  ERROR ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
  ERROR │ ⛔ Uncaught platform error
  ERROR └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

@Merrit
Copy link
Owner

Merrit commented Aug 4, 2023

That's weird. Does it crash if you try to bind different keys, or have you just tried one? Maybe try something like Ctrl + F10? More Windows testing!

Thanks for providing such helpful info to help troubleshoot! 💙

@JReming85
Copy link
Author

JReming85 commented Aug 4, 2023 via email

@Merrit
Copy link
Owner

Merrit commented Aug 4, 2023

Confirmed the crash on my end by using Insert, think I've fixed that bug - should fix the same issue with other keys if it was the same problem.

Also fixed an issue with the logger, at the least it shouldn't cause a crash now.

Please give this build a shot :)

Nyrna-Linux-Portable.tar.gz
Nyrna-Windows-Portable.zip

@JReming85
Copy link
Author

JReming85 commented Aug 4, 2023

Looking good,

Logging just shows There was an issue creating the log file. but I feel you already know that.

Can set/change both global + specific hotkeys just time.

1 thing I noticed, which you might not have implemented yet is the Verbose Logging is not persistent across restarts and the still 3-5 sec actual pause delay.

But great job!

@Merrit
Copy link
Owner

Merrit commented Aug 4, 2023

Logging just shows There was an issue creating the log file. but I feel you already know that.

Yeah, Windows being Windows. I will continue looking into it, thanks for bringing it to my attention! :)

Verbose Logging is not persistent across restarts

That will be in the next build.

pause delay

Might not be a whole lot to do about this, Windows makes this sort of thing nearly impossible. I'll add it to the todo list to see if it can be improved.

Can set/change both global + specific hotkeys just time.

🎉 Glad to hear it is working now! Thanks again for the troubleshooting, you gave great info and it was a big help. 💙

@JReming85
Copy link
Author

JReming85 commented Aug 4, 2023 via email

@Merrit
Copy link
Owner

Merrit commented Aug 7, 2023

Hmm, after testing it some more I can only reproduce the issue on Windows 11; both Windows 10 and Linux suspend instantly, though for me it also happens with the most recent stable build.

@Merrit Merrit closed this as completed in 575d7f1 Aug 10, 2023
@Merrit
Copy link
Owner

Merrit commented Aug 29, 2023

@JReming85

Windows performance should see a marked improvement with v2.17.0. 🎉

@JReming85
Copy link
Author

Awesome, thank you!

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

No branches or pull requests

2 participants