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

Tips, tricks, and Q&A #13

Open
AziRizvi opened this issue Sep 30, 2023 · 2 comments
Open

Tips, tricks, and Q&A #13

AziRizvi opened this issue Sep 30, 2023 · 2 comments
Labels
discussion This is not an issue or a request, but an informative discussion

Comments

@AziRizvi
Copy link

AziRizvi commented Sep 30, 2023

Admin edit: This issue thread is not an issue/bug/question per se, but also not something I want to close and put out of sight of new users. A wiki is overkill for this project, so I figured a single pinned thread is a nice, low-barrier-of-entry, and visible approach for simple tricks, tips, and questions. Feel free to share ideas and converse about the project here.

--@detuur

original post:

Nifty way to use Boss-Key.lua with AutoHotKey

This is not an issue thread. I Just thought I'd share something.

I'm using your Boss-Key.lua script with an Autohotkey software combination.

Just in case if you didn't know, AutoHotkey is a free program aimed at providing easy keyboard shortcuts, hotkeys and fast macro-creation.

https://en.wikipedia.org/wiki/AutoHotkey

So the way I'm using your script in conjunction with AutoHotKey is like this:

Whenever the escape button is pressed on my keyboard First the AutoHotKey script that I've set up intercepts that input, modifies it and then sends it in whatever combination you wish/prefer.

So the way I've set it up is that when the escape button is pressed it sends in the Escape Button Command which pauses and minimizes MPV and after that it sends in another command which initiates a second script that removes the window from the windows taskbar effectively hiding whatever you were watching from prying eyes.

Source for the hide window script:
https://www.computoredge.com/AutoHotkey/Downloads/HideWindow.ahk

My AutoHotkey Escape Button Script:

Esc::
sleep 1
Send {Esc}
sleep 3
Send #h
return
@detuur detuur changed the title Nifty way to use Boss-Key.lua with AutoHotKey. Tips, tricks, and Q&A Oct 5, 2023
@detuur detuur pinned this issue Oct 5, 2023
@detuur
Copy link
Owner

detuur commented Oct 5, 2023

That's very neat. I'll keep the issue open but tag it with a discussion tag. I've added a little explainer to the top of your post.

As for some trivia, originally I made the boss-key script in AutoHotkey as well, but it wasn't very portable as you needed the AutoHotkey software and it would be tied to Windows. This is how I arrived at the solution of embedding a PowerShell script that calls the native win32 api. It's incredible how difficult it is to script for Windows without using third-party tools.

@detuur detuur added the discussion This is not an issue or a request, but an informative discussion label Oct 5, 2023
@AziRizvi
Copy link
Author

AziRizvi commented Oct 5, 2023

Here's a video of just the Boss-key.lua script in action and the Boss-Key.lua the script in action with combination with AutoHotkey.

2023-10-05.18-08-26.mp4

First I show how the Boss Key script behaves normally when the video gets paused and the player gets minimized, that's how the Boss-Key script behaves by default but when I add in the combination with AutoHotkey, it pauses and minimizes the player first and then sends in the command to initiate the second script that removes the player from the taskbar and hides it then I restore it using another command in the script which is Windows Key + U.

Anyone can change the keybinds to whatever they wish.
But they'd have to modify my script to accommodate the Keybind change too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion This is not an issue or a request, but an informative discussion
Projects
None yet
Development

No branches or pull requests

2 participants