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

OBS not responding unless infocus #57

Open
Blaze99 opened this issue Sep 9, 2018 · 12 comments
Open

OBS not responding unless infocus #57

Blaze99 opened this issue Sep 9, 2018 · 12 comments

Comments

@Blaze99
Copy link

Blaze99 commented Sep 9, 2018

hey, concept of intercept is amazing, but for me unless i alt tab to obs the hotkeys dont work. im not able to start or stop recording or send any hotkey to obs while using chrome or any other window even if im staring at the desktop with obs minimised.

i've tried running obs as administrator didnt help

@TaranVH
Copy link
Owner

TaranVH commented Sep 10, 2018

Okay, so I'm not entirely sure what you're trying to do.
Your original message mentioned the super function keys (F13-24)
_"i don't know if this matters. but im trying to use keys that are not there on most keyboards.
like f13-f23 keys. everything other than obs works with those keys

i've also checked that f1-f12 works thruough intercept.
but i want to use the f13-24 keys.

thing is if i use hid macros obs is fine with f13-f24 keys. only doesn't detect it (when not in focus) with intercept"_

Did you try to assign one of those keys in OBS itself?
OBS's hotkeys SHOULD be global by default. And I did try F18 and it totally worked. (see screenshot.)

You can always use your secondary keyboard to just send regular keystrokes. Like this:

#if (getKeyState("F23", "P"))
F23::return
k::sendinput, !{F8} ;obs shortcut for "Start Recording" and "Stop Recording."
#if

image

If a program does not have global hotkeys, you can still send keystrokes to it using ControlSend. You might have to activate it first, using ControlFocus. You can figure out the info that you need for those commands, using Window Spy. (it comes with autohotkey.)

https://autohotkey.com/docs/commands/ControlSend.htm
https://autohotkey.com/docs/commands/ControlFocus.htm

For example, I created a global key to start/stop playback in premiere. Here is that code:

though, I tried this for OBS, (shortcut is ctrl alt shift R) and it actually did not work:
controlsend, Qt5QWindowIcon2, ^!+r, ahk_exe obs64.exe

But it does work if you just use sendinput, ^!+r because, again, OBS uses global hotkeys.
Just make sure you aren't using that shortcut for anything else.

This is all the help I can provide. If you are still stuck, you must figure it out yourself.

@Blaze99
Copy link
Author

Blaze99 commented Sep 11, 2018

yeah, im sorry. i acutally did not test it properly. but my latest findings were that OBS would not detect the macro input of intercept if it was not in focus. irrespective of what keystrokes i use as macros.
i will try to make a video of the issue im facing and link it here

@Blaze99
Copy link
Author

Blaze99 commented Sep 11, 2018

also, i should've mentioned this. but im using intercept on its own. im not using autohotkey because some forums and reddit post say that BattleEye (anitcheat for Rainbow Six Siege) issues ban against the use of AutoHotkey

@Blaze99 Blaze99 closed this as completed Sep 11, 2018
@Blaze99 Blaze99 reopened this Sep 11, 2018
@Blaze99
Copy link
Author

Blaze99 commented Sep 11, 2018

OK. did a little googling about OBS Global Hotkeys. turns out if the keystrokes are sent at a high frequency OBS doesnt catch them. i confirmed this by using HIDMacros. i set one button to send F13 first using

  1. "HIDMacros.SendKeysSlow "{F15}", 50"
  2. "HIDMacros.SendKeysSlow "{F15}", 0"

when the delay is 0 OBS doesnt catch it.
so now i need to find a way to add delay between keystrokes for intercept.
any idea how to do that?

@TaranVH
Copy link
Owner

TaranVH commented Sep 11, 2018

I have no idea. It's possible that a delay function is not even supported.
Ask Kamaz - he created it.
https://www.orbiter-forum.com/showthread.php?t=30829
IDK if he is even still around on the Orbiter forums (you need an account to see other user's activities.)
If you do find an answer, please post it in this thread for the sake of anyone else who might have this problem.

@Blaze99
Copy link
Author

Blaze99 commented Sep 17, 2018

Recap of issue: OBS would not detect macro sent by intercept when obs window is not infocus
Reason for issue: OBS ignores (when not in focus) keystrokes that come too fast.
Solution: I tweaked intercept to add 50ms delay to keystrokes from all keyboards but 1 main keyboard.

Download intercept from the link below. theres a readme file which hopefully helps get it setup.

https://drive.google.com/open?id=11eZdG-1bjx9vcXL25K_ybdXBXyASEswI

@Blaze99
Copy link
Author

Blaze99 commented Sep 17, 2018

@TaranVH on a different note. do you know the code for F24 key?
for F23 it is --> 6e,0,0|6e,0,1
but 6f,0,0|6f,0,1 is not F24.

@Blaze99
Copy link
Author

Blaze99 commented Sep 17, 2018

Recap of issue: OBS would not detect macro sent by intercept when obs window is not infocus
Reason for issue: OBS ignores (when not in focus) keystrokes that come too fast.
Solution: I tweaked intercept to add 50ms delay to keystrokes from all keyboards but 1 main keyboard.

Download intercept from the link below. theres a readme file which hopefully helps get it setup.

https://drive.google.com/open?id=11eZdG-1bjx9vcXL25K_ybdXBXyASEswI

Forgive me. there is some issue with this solution. I will try to fix it and get back

@Blaze99
Copy link
Author

Blaze99 commented Sep 17, 2018

ok. i fixed it. for some reason reading the keyboard file more than once caused intercept to crash. i've made it such that it reads it only once. it's working for now.

Side Note: you dont want to hold down any key on keyboards other than your main keyboard. it will lead to a HUGE delay (and possibly freeze intercept and hence rendering all keyboards useless).

the file in the link should have been updated

@TaranVH
Copy link
Owner

TaranVH commented Dec 20, 2018

@TaranVH on a different note. do you know the code for F24 key?
for F23 it is --> 6e,0,0|6e,0,1
but 6f,0,0|6f,0,1 is not F24.

F24 is SC076.
So, 76,0,0|76,0,1
you can find all scan codes here: https://github.com/TaranVH/2nd-keyboard/blob/master/INFO_and_PROFILES/Table_of_all_scan_codes.xlsx

@DennysOliveira-2
Copy link

Well, found myself in this same issue.
Same objectives, but trying to use it with StreamLabs OBS.
Not detecting global, but it does detect HIDMacros.
I would use HIDMacros if it wasn't blocking my ´´^^~~ inputs as my language uses it.

@Blaze99 Hope you still around so perhaps you can reup your intercept or give me guidance.

--
If I get any results, i'll be posting here

@DennysOliveira-2
Copy link

Alright, I found a solution really as @Blaze99 mentioned that the problem was the speed from keystrokes, it was relatively easy to manage this;
Instead of messing up with intercept, I started using SendEvend , {F13~F22} on my F23 keyboard;

Also, with this on top to change the keystroke delay;

SetWorkingDir %A_ScriptDir%
if not A_IsAdmin
	Run *RunAs "%A_ScriptFullPath%"
SetKeyDelay , 30 , 30

Running as admin to guarantee that everything works while unfocused cause Win10 sucks at this.
Well, problem solved, if anyone needs any directions there it is.

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

3 participants