STOP getting Stream Sniped! Easy Fix w_ OBS Studio

# How to Apply a Source on Hold Rather Than Toggle in OBS Studio: A Comprehensive Guide

## Introduction

Getting stream sniped can be frustrating, especially when you want to hide or obscure your in-game map every time you press your map key. In this guide, we’ll explore three potential solutions to help you achieve this, using the full transcription of the video provided.

---

## Solution 1: Using AutoHotkey Script for Hold Hotkeys

AutoHotkey is a powerful scripting system for Windows that can be used to create custom macros and shortcuts. For this solution, we will use an AutoHotkey script to send hotkeys to OBS Studio when you press and hold your map key.

### Steps:

1. **Download and Install AutoHotkey**

Visit the official AutoHotkey website and download the latest version of AutoHotkey for Windows. Follow the installation instructions to set it up on your system.

2. **Create an AutoHotkey Script**

Here’s a basic script template that you can use:

```ahk

; This script sends a hotkey when you press and hold a key.

KeyWait, G ;; Change "G" to your map key.

Loop {

.GetKeyState, G, P

If InStr(GetKeyState("G"), "P") {

Send, ^!t ;; Replace "^!t" with your desired hotkey (Ctrl+Alt+T in this example).

}

Sleep, 10

}

```

- **Explanation**: This script listens for the `G` key to be pressed and held. When you press `G`, it sends the hotkey `^!t` (`Ctrl + Alt + T`) to OBS Studio. You can modify the script to use a different key or hotkey.

3. **Update the Script**

The original script had issues when OBS was not in focus. To fix this, we recommend using function keys (F13-F24) instead of modifier keys like `Ctrl` or `Alt`. This avoids conflicts with other applications.

- **Updated Script**:

```ahk

; This script sends a hotkey when you press and hold F24.

KeyWait, F24 ;; Change "F24" to your desired key.

Loop {

GetKeyState, F24, P

If InStr(GetKeyState("F24"), "P") {

Send, {F24} ;; Replace "{F24}" with your desired hotkey (e.g., F13).

}

Sleep, 10

}

```

- **Save the Script**: Save this script as a `.ahk` file (e.g., `mapblur.ahk`) and ensure AutoHotkey is installed to run it.

4. **Set Up OBS Studio**

- Open OBS Studio and go to **Settings > Hotkeys**.

- Find your source (e.g., an overlay image or a filter) and assign the same hotkey for both showing and hiding it.

- When you press and hold your map key, the script will send the hotkey to OBS, triggering the desired action.

---

## Solution 2: Using an Overlay with OBS Studio

If you prefer not to use AutoHotkey, you can set up an overlay in OBS Studio that appears when you press your map key.

### Steps:

1. **Create an Overlay Image**

- Save a screenshot or create an image that you want to display as an overlay.

- Resize and position the image as desired in OBS Studio.

2. **Set Up the Source**

- Drag the overlay image onto your scene.

- Right-click the source, select **Filters**, and add a filter (e.g., blur) if needed.

- Hide the source initially so it doesn’t appear on your stream.

3. **Assign Hotkeys to Show/Hide the Source**

- Go to **Settings > Hotkeys**.

- Search for your source name and assign hotkeys for showing and hiding it (e.g., `Ctrl + Alt + T`).

4. **Test the Setup**

- Press and hold your map key to trigger the hotkey in OBS Studio, making sure the overlay appears as intended.

---

## Solution 3: Using a Filter with OBS Studio

Another method involves using filters in OBS Studio to obscure your gameplay when you press your map key.

### Steps:

1. **Download OBS Filter Hotkeys**

- Visit the OBS GitHub page and download the OBS Filter Hotkeys script (a Lua script for OBS Studio).

2. **Set Up the Script**

- Extract the script and open OBS Studio.

- Go to **Tools > Scripts**, click **Add New Script**, and select the `obs_filter_hotkeys.lua` file.

3. **Configure Filters**

- Open your game source, go to **Filters**, and add a filter (e.g., Gaussian Blur from StreamFX).

- Name this filter (e.g., “Hide Map”) and apply heavy blur to obscure your gameplay.

4. **Add the Filter Hotkey**

- Go back to the script configuration and assign a hotkey (e.g., `H`) to toggle the filter while holding it down.

5. **Test the Setup**

- Press and hold your map key to trigger the hotkey, ensuring the filter is applied and removed correctly.

---

## Final Thoughts

While OBS Studio doesn’t natively support hold hotkeys for sources, these workarounds can help you achieve the desired functionality. Whether you use AutoHotkey scripts or OBS filters, both methods provide effective solutions for hiding your map during gameplay.

If you enjoyed this tutorial or have any questions, join our Discord server at **Discord.gg/eposvox** for support and updates. Don’t forget to like, subscribe, and share the video!

---

This article provides a detailed explanation of each solution, ensuring that every part of the transcription is fully utilized without summarizing or condensing the content.

"WEBVTTKind: captionsLanguage: enwe've all been there getting stream sniped is no fun and you want to be able to just hide obscure or otherwise get away from your in-game map every time you press your map key when you're in your game right i have two put well kind of three potential solutions for you here in this video that apply depending on the different directions you want to take with it and i'm excited to show it with you today i love solving problems for you all i wasn't going to have three videos this week but when your boy gets some inspiration for a tutorial you're getting a tutorial and we're answering a question from our discord server today hi friends does anyone know how i can apply a source to show on hold rather than toggle in obs studio it turns out i did some digging into this i didn't know this but apparently in streamlabs obs or whatever they're calling it now they had a hold hotkey option and obs studio doesn't have this however this functionality is something you can recreate in obs studio the goal here is to be able to when you hold down your map key in a video game especially a battle royale or a first person shooter it blurs the screen or shows an overlay or does something else so that your viewers don't see your map that way you don't get stream sniped and things like that and i have a solution it's not the perfect solution but it's a solution and actually i'm going to reference two solutions here so first and foremost i did post a video back in july of last year featuring a plug-in for obs studio that will actually detect whenever a certain image a certain visual whatever is shown on your screen you have to be very careful with your screenshot mapping and it will automatically just like blur your screen or do any action that you want it can switch scenes it can blur it whatever that's pretty cool but it requires basically forking obs and it's not the ideal workflow we can do better for this i'm using a program called autohotkey autohotkey is a scripting system for windows that i use for everything i've talked about it in past years how i use it for my video editing macros i have some of these icons i have a bunch of different autohotkey scripts running in the background of my computer at pretty much any point in time it is awesome so for this we're using autohotkey download and install it and then you don't really need to touch anything related to autohotkey we're gonna make our own script i will have a link to this script posted in the description down below but this is the gist of the script the code itself is fairly straightforward ignore the stuff at the top that's just required auto hotkey stuff but effectively what we're doing is whenever you press the g key it sends your hotkey which in this case is ctrl t g is just your map key you use in game you can change g to be whatever key you want and then you can change your hotkey to be whatever you want in this case the caret is ctrl the exclamation point is alt so ctrl alt t is our hotkey that we're using to show or hide a filter or overlay or what have you okay editing epos coming in here to update this script i have actually updated the script over on github the original script that i showed was not working properly when obs was out of focus and this is because auto hotkey has some weird issue when it comes to sending hotkeys to obs when obs isn't in focus it's just a big issue there's a lot of threads on it and my dummy trying to rush and make the video didn't notice that when i was testing it with obs and focus however we can now showcase here if i unfocus obs if i have discord pulled up for example and hold g as i hold g it still shows the image there is a caveat here though however in that you cannot use modifier keys so when i originally showed the script it had like ctrl alt t the modifier keys if i try to do that it will send and start activating the alt menus and things like that so that does not work so instead i recommend using f13 through f24 that is the extended set of function keys which no other application really uses and so in auto hotkey itself you can literally just put f24 in the little squiggly brackets and that's fine and then once you run your script in order to set it as the hotkey you just press the key you pressed and it'll send f24 to obs so that is the fix the script has been updated from what you see throughout most of this video but the functionality is still there i have fixed it so it sends this thing waits while you hold it down waits for you to let it up and then sends that command again so the entire time that you were holding like from the moment you press g it sends the hotkey and then it just waits until you let go of g and then it sends the hotkey again so the workflow here is that a script is running in the background it detects when you're holding down that key and then it fires off a hotkey to obs and then when you let go of that key it fires the hotkey again and then in obs studio we can just set the show and hide to be the same hotkey or even different hotkeys and autohotkey will do the switching for you it is fairly straightforward but since obs doesn't natively support it this is the workaround fairly straightforward hopefully easy to understand like that's literally all it's doing it's listening for you to hold down this key and then as soon as you start holding it down fires off a high key as soon as you let go fires off a hotkey so we take the script we save it as a dot ahk file so i'm going to say map blur dot ahk depending on your text editor you may need to choose no file type here but that's fine dot ahk and again keep in mind you do need auto hotkey installed and then you have a dot ahk file here it should read it as an auto hotkey script now we double click it it's going to show up as the default auto hotkey logo in the bottom right corner in your system tray it's going to say map blur dot ahk is running in the background so now every time we press or hold the g key it's gonna send that hotkey so now that that's running in the background we can work our magic i'm gonna open up obs studio and get a scene set up for us to kind of demo this on okay here we have some basic gameplay nothing fancy doesn't need to be we're going to display an image over top of the gameplay which is maybe not what you want to do but the comment reference is showing an overlay so we're going to do this method first i'm actually going to save this comment as the image just as the example here so i saved it as an image i'm going to drag that onto our scene as our overlay and just kind of resize it to take up part of the screen okay so i have that source i'm going to hide the source now we're going to go into our hotkey settings settings hotkeys we're going to find our source which by the way if you're on the obs version 27.2 update you can search for sources so i'm going to say rx that's going to find our image here so show and hide you have the option of setting hotkeys here the cool thing is you can set the same hotkey for each other you can just edit your script to have different hotkeys but i'm going to say control alt t and control alt t that will show and hide our image we click apply and click ok and now we can test this out control alt t shows control t hides so now when i press the g key i pressed and held it down it's showing this image and then i let go and it hides the image press hide do it really fast hold let go hold let go hold oh go but there's a better way to do this that we're going to talk about after this video's sponsor this video is brought to you by riverside.fm my new favorite podcast and video recording platform and what i will be using for future episodes of my behind the streams podcast riverside.fm is used by garyvee guy razz spotify disney and many more creators it records audio and video locally on each participant's device and uploads these local files automatically to the riverside dashboard and ooh man the recordings look like they came straight out of camera which is bonkers and a huge step up from what i was previously using no more coordinating recording with your guests or anything like that as it's all really done for them you can receive separate audio in uncompressed 48 kilohertz wave and video up to 4k tracks for all participants and by all i mean all up to eight co-hosts or guests are allowed which is wild riverside uses progressive uploading so that uploads while the show goes on so you can download your files within seconds of hitting stop record with the magic editor you can save hours of editing work with a few clicks change your size positioning backgrounds layouts add a logo and more plus you can export the video ready to upload to video sites and download a transcription in seconds as well guests can even join from ipad and iphone too did i forget to mention the cool part riverside.fm is also a streaming tool meaning that while you're recording you can also live stream to most major platforms which is pretty neat but streaming does not get in the way of recording it is a recording first platform with quality as its focus which i can really appreciate plans start from just seven dollars and fifty cents per month go to riverside dot fm slash eposvox and use code eposvox to get 15 off a plan today that was just to answer the question in the comment asking how to apply an image overlay if you want to apply a filter instead for example to blur out your gameplay without using an image or an overlay or anything like that you can actually use hold hotkeys but we're going to use a script to do it that's an obs script so it's going to be pretty cool first and foremost you want to download obs filter hotkeys this is a lua script for obs studio click download and extract it and then go to tools scripts add a new script find it we're going to use a video filter for this specifically click open and you can see here it gives you some instructions we're going to go to your specific source you want to blur which is probably your game capture go to filters add whatever filter you want to obscure it so i'm going to use a blur filter from stream fx we're going to call it hide map and then we're going to use gaussian blur and just like crank it up so no one can really see much of anything cool well now we need to go back to filters i shouldn't close it because we're going to add the obs filters hotkey filter you add it as a filter and then it detects all of the other filters on your scene here so we're going to come over here to filter hotkeys we're going to say hide map hotkey and just leave that alone now we're gonna come over here to settings we're gonna go to hotkeys and find your source name so it's desktop blah blah blah blah for me it'll be your game capture source or whatever it's right here now you have three different settings you've got disable the source uh hide it toggle it and then hold they actually have a hold hotkey option that is number three here so for example we're going to use h for this one click apply and now well yeah now i hold the h key and it keeps that filter applied while i'm holding that key so when you're playing your game when you hold down your map button it blurs your source just an alternative way to do it that i think is pretty cool i know this is a little complicated there's unfortunately there's currently no just direct hold hotkey option in obs studio i do hope they add it but hopefully i made it a little easier for you i do hope you enjoyed this tutorial found it helpful etc if you want to get help for your streams and things like that i have an awesome community over on our discord server at discord.gg eposvox go check us out join us get help with your stream prompt cool video ideas like this that was my wrist popping dear god and otherwise hit the like button subscribe and remember be kind rewindwe've all been there getting stream sniped is no fun and you want to be able to just hide obscure or otherwise get away from your in-game map every time you press your map key when you're in your game right i have two put well kind of three potential solutions for you here in this video that apply depending on the different directions you want to take with it and i'm excited to show it with you today i love solving problems for you all i wasn't going to have three videos this week but when your boy gets some inspiration for a tutorial you're getting a tutorial and we're answering a question from our discord server today hi friends does anyone know how i can apply a source to show on hold rather than toggle in obs studio it turns out i did some digging into this i didn't know this but apparently in streamlabs obs or whatever they're calling it now they had a hold hotkey option and obs studio doesn't have this however this functionality is something you can recreate in obs studio the goal here is to be able to when you hold down your map key in a video game especially a battle royale or a first person shooter it blurs the screen or shows an overlay or does something else so that your viewers don't see your map that way you don't get stream sniped and things like that and i have a solution it's not the perfect solution but it's a solution and actually i'm going to reference two solutions here so first and foremost i did post a video back in july of last year featuring a plug-in for obs studio that will actually detect whenever a certain image a certain visual whatever is shown on your screen you have to be very careful with your screenshot mapping and it will automatically just like blur your screen or do any action that you want it can switch scenes it can blur it whatever that's pretty cool but it requires basically forking obs and it's not the ideal workflow we can do better for this i'm using a program called autohotkey autohotkey is a scripting system for windows that i use for everything i've talked about it in past years how i use it for my video editing macros i have some of these icons i have a bunch of different autohotkey scripts running in the background of my computer at pretty much any point in time it is awesome so for this we're using autohotkey download and install it and then you don't really need to touch anything related to autohotkey we're gonna make our own script i will have a link to this script posted in the description down below but this is the gist of the script the code itself is fairly straightforward ignore the stuff at the top that's just required auto hotkey stuff but effectively what we're doing is whenever you press the g key it sends your hotkey which in this case is ctrl t g is just your map key you use in game you can change g to be whatever key you want and then you can change your hotkey to be whatever you want in this case the caret is ctrl the exclamation point is alt so ctrl alt t is our hotkey that we're using to show or hide a filter or overlay or what have you okay editing epos coming in here to update this script i have actually updated the script over on github the original script that i showed was not working properly when obs was out of focus and this is because auto hotkey has some weird issue when it comes to sending hotkeys to obs when obs isn't in focus it's just a big issue there's a lot of threads on it and my dummy trying to rush and make the video didn't notice that when i was testing it with obs and focus however we can now showcase here if i unfocus obs if i have discord pulled up for example and hold g as i hold g it still shows the image there is a caveat here though however in that you cannot use modifier keys so when i originally showed the script it had like ctrl alt t the modifier keys if i try to do that it will send and start activating the alt menus and things like that so that does not work so instead i recommend using f13 through f24 that is the extended set of function keys which no other application really uses and so in auto hotkey itself you can literally just put f24 in the little squiggly brackets and that's fine and then once you run your script in order to set it as the hotkey you just press the key you pressed and it'll send f24 to obs so that is the fix the script has been updated from what you see throughout most of this video but the functionality is still there i have fixed it so it sends this thing waits while you hold it down waits for you to let it up and then sends that command again so the entire time that you were holding like from the moment you press g it sends the hotkey and then it just waits until you let go of g and then it sends the hotkey again so the workflow here is that a script is running in the background it detects when you're holding down that key and then it fires off a hotkey to obs and then when you let go of that key it fires the hotkey again and then in obs studio we can just set the show and hide to be the same hotkey or even different hotkeys and autohotkey will do the switching for you it is fairly straightforward but since obs doesn't natively support it this is the workaround fairly straightforward hopefully easy to understand like that's literally all it's doing it's listening for you to hold down this key and then as soon as you start holding it down fires off a high key as soon as you let go fires off a hotkey so we take the script we save it as a dot ahk file so i'm going to say map blur dot ahk depending on your text editor you may need to choose no file type here but that's fine dot ahk and again keep in mind you do need auto hotkey installed and then you have a dot ahk file here it should read it as an auto hotkey script now we double click it it's going to show up as the default auto hotkey logo in the bottom right corner in your system tray it's going to say map blur dot ahk is running in the background so now every time we press or hold the g key it's gonna send that hotkey so now that that's running in the background we can work our magic i'm gonna open up obs studio and get a scene set up for us to kind of demo this on okay here we have some basic gameplay nothing fancy doesn't need to be we're going to display an image over top of the gameplay which is maybe not what you want to do but the comment reference is showing an overlay so we're going to do this method first i'm actually going to save this comment as the image just as the example here so i saved it as an image i'm going to drag that onto our scene as our overlay and just kind of resize it to take up part of the screen okay so i have that source i'm going to hide the source now we're going to go into our hotkey settings settings hotkeys we're going to find our source which by the way if you're on the obs version 27.2 update you can search for sources so i'm going to say rx that's going to find our image here so show and hide you have the option of setting hotkeys here the cool thing is you can set the same hotkey for each other you can just edit your script to have different hotkeys but i'm going to say control alt t and control alt t that will show and hide our image we click apply and click ok and now we can test this out control alt t shows control t hides so now when i press the g key i pressed and held it down it's showing this image and then i let go and it hides the image press hide do it really fast hold let go hold let go hold oh go but there's a better way to do this that we're going to talk about after this video's sponsor this video is brought to you by riverside.fm my new favorite podcast and video recording platform and what i will be using for future episodes of my behind the streams podcast riverside.fm is used by garyvee guy razz spotify disney and many more creators it records audio and video locally on each participant's device and uploads these local files automatically to the riverside dashboard and ooh man the recordings look like they came straight out of camera which is bonkers and a huge step up from what i was previously using no more coordinating recording with your guests or anything like that as it's all really done for them you can receive separate audio in uncompressed 48 kilohertz wave and video up to 4k tracks for all participants and by all i mean all up to eight co-hosts or guests are allowed which is wild riverside uses progressive uploading so that uploads while the show goes on so you can download your files within seconds of hitting stop record with the magic editor you can save hours of editing work with a few clicks change your size positioning backgrounds layouts add a logo and more plus you can export the video ready to upload to video sites and download a transcription in seconds as well guests can even join from ipad and iphone too did i forget to mention the cool part riverside.fm is also a streaming tool meaning that while you're recording you can also live stream to most major platforms which is pretty neat but streaming does not get in the way of recording it is a recording first platform with quality as its focus which i can really appreciate plans start from just seven dollars and fifty cents per month go to riverside dot fm slash eposvox and use code eposvox to get 15 off a plan today that was just to answer the question in the comment asking how to apply an image overlay if you want to apply a filter instead for example to blur out your gameplay without using an image or an overlay or anything like that you can actually use hold hotkeys but we're going to use a script to do it that's an obs script so it's going to be pretty cool first and foremost you want to download obs filter hotkeys this is a lua script for obs studio click download and extract it and then go to tools scripts add a new script find it we're going to use a video filter for this specifically click open and you can see here it gives you some instructions we're going to go to your specific source you want to blur which is probably your game capture go to filters add whatever filter you want to obscure it so i'm going to use a blur filter from stream fx we're going to call it hide map and then we're going to use gaussian blur and just like crank it up so no one can really see much of anything cool well now we need to go back to filters i shouldn't close it because we're going to add the obs filters hotkey filter you add it as a filter and then it detects all of the other filters on your scene here so we're going to come over here to filter hotkeys we're going to say hide map hotkey and just leave that alone now we're gonna come over here to settings we're gonna go to hotkeys and find your source name so it's desktop blah blah blah blah for me it'll be your game capture source or whatever it's right here now you have three different settings you've got disable the source uh hide it toggle it and then hold they actually have a hold hotkey option that is number three here so for example we're going to use h for this one click apply and now well yeah now i hold the h key and it keeps that filter applied while i'm holding that key so when you're playing your game when you hold down your map button it blurs your source just an alternative way to do it that i think is pretty cool i know this is a little complicated there's unfortunately there's currently no just direct hold hotkey option in obs studio i do hope they add it but hopefully i made it a little easier for you i do hope you enjoyed this tutorial found it helpful etc if you want to get help for your streams and things like that i have an awesome community over on our discord server at discord.gg eposvox go check us out join us get help with your stream prompt cool video ideas like this that was my wrist popping dear god and otherwise hit the like button subscribe and remember be kind rewind\n"