Other programs running as administrator

slashinfty

2016-06-23 18:53:41

I'm attempting to use MIDI Translator to control OBS Studio hotkeys, and in OBS Studio, hotkeys can be used globally only if the program is ran as an administrator.

One of my translators changes a MIDI message to the keystroke Ctrl(Alt(Shirt(Insert )))), and if OBS Studio is the active window, I can press the corresponding button on my MIDI controller to send that MIDI message and it triggers that keystroke and the proper hotkey is applied (in this case, muting or unmuting my microphone). Correction: if I run OBS Studio as an administrator, in the hopes to have global hotkeys, this does not work at all, even if OBS Studio is the active window.

If OBS Studio is ran as an administrator and not the active window, and I press the keystroke combination of Ctrl(Alt(Shirt(Insert )))) on my physical keyboard, the hotkey activates and my microphone is muted/unmuted. However, if I attempt to press the button my MIDI controller to send the appropriate MIDI message and have it translated to the correct keystroke combination, it fails to trigger the hotkey.

Summation:
OBS Studio active + MIDI controller pressed = does not work (originally said it did work, but does not if OBS Studio is opened as an administrator)
OBS Studio active + keyboard combination pressed = works
OBS Studio not active + MIDI controller pressed = does not work (want to work)
OBS Studio not active + keyboard combination pressed = works

I have tried to run MIDI Translator as both an administrator and not, and have not had success. Is there anything more than can be done? Thank you.

Scr1pter

2016-06-24 08:53:16

Hi,

by "not active" I guess the window is not on top (e.g. minimized), right?

Have you already tried to login as an Administrator rather than just run the programs as Administrator?
Just to see if this is the actual problem.
Maybe it will generally not work.

If OBS Studio is not minimized but something is covering it (e.g. Notepad),
will it work pressing the MIDI button?

Best regards

slashinfty

2016-06-24 12:54:18

By "not active" I mean not the selected window on top. If I have it open, but another window selected/active (such as Notepad or MIDI Translator), it does not work.

This is the only account on Windows 10, and it is an administrator account.

Update: if I run OBS Studio as an administrator, it does not pick up the MIDI inputs even if it is the active window. My original testing was incorrect. I have updated my original post.

DvlsAdvct

2016-07-18 01:05:18

Hi slashinfty

Sorry for the delay. I'm scrambling to get caught up with everything here.

Some applications don't react well to keystrokes that utilize lots of modifiers (ctrl, alt, shift, etc) because they see all of the key commands happening at the same time and get confused. What I'd like to do is try utilizing timers, and see if we can string them all together manually. This will take a few translators, but I'll map them out below. As far as administrative rights, I don't know what the ideal situation is. What you may want to do is try the "inject" option in MT Pro, which can direct keystrokes to a specific application. Once again, this isn't 100% effective, but it can help.

We need a two translators that will fire off timers, making the keys press down and release separately.

Code: Select all

Translator 1: MIDI Down
Incoming Message: <<Your MIDI message, but ONLY the down message>>
Rules: g0=0
Outgoing: Timer
Activate Timer
Timer Name: Key Press
Multiple Times
Repeat Count: 4
Initial Delay: 0ms
Repeat Delay: 50ms ([i]this can be fine tuned to make sure the signals flow properly)[/i]

Translator 2: Key Press Timer 1
Incoming: Timer
Timer Name: Key Press
Rules: g0=g0+1
if g0!=1 then exit rules, skip outgoing action
Outgoing: Key Stroke
Down
Ctrl

Translator 3: Key Press 2
Incoming: Timer
Timer Name: Key Press
Rules: g0=g0+1
if g0!=2 then exit rules, skip outgoing action
Outgoing: Key Stroke
Down
Shift

Translator 4: Key Press 3
Incoming: Timer
Timer Name: Key Press
Rules: g0=g0+1
if g0!=3 then exit rules, skip outgoing action
Outgoing: Key Stroke
Down
Alt

Translator 5: Key Press 4
Incoming: Timer
Timer Name: Key Press
Rules: g0=g0+1
if g0!=4 then exit rules, skip outgoing action
Outgoing: Key Stroke
Down
Insert

Translator 6: MIDI Up
Incoming Message: <<Your MIDI message, but ONLY the Up message>>
Rules: if g0!=4 then exit rules, skip outgoing action
Outgoing: Timer
Activate Timer
Timer Name: Key Release
Multiple Times
Repeat Count: 4
Initial Delay: 0ms
Repeat Delay: 50ms ([i]this can be fine tuned to make sure the signals flow properly)[/i]

Translator 7: Key Release 1
Incoming: Timer
Timer Name: Key Release
Rules: g0=g0-1
if g0!=3 then exit rules, skip outgoing action
Outgoing: Key Stroke
Up
Ctrl

Translator 8: Key Release 2
Incoming: Timer
Timer Name: Key Release
Rules: g0=g0-1
if g0!=2 then exit rules, skip outgoing action
Outgoing: Key Stroke
Up
Shift

Translator 7: Key Release 3
Incoming: Timer
Timer Name: Key Release
Rules: g0=g0-1
if g0!=1 then exit rules, skip outgoing action
Outgoing: Key Stroke
Up
Alt

Translator 7: Key Release 4
Incoming: Timer
Timer Name: Key Release
Rules: g0=g0-1
if g0!=0 then exit rules, skip outgoing action
Outgoing: Key Stroke
Up
Insert
Let me know if that works
Jared

KVYNgaming

2016-09-30 06:28:07

I stumbled across this post while looking for the same solution that slashinfty was looking for in dealing with OBS Studio only properly registering the hotkeys when the window is active. My solution to this is a bit roundabout but works nonetheless.

What I did was download AutoHotKey and create a script for it that takes in a hotkey, and from that hotkey, can set OBS Studio to the active window, and then press the final desired OBS Hotkey.

For instance, if we set "Ctrl+1" as the OBS hotkey to transition to the main scene and Ctrl+Shift+F1 to trigger the AutoHotKey script, then I just need to map a MIDI button to trigger Ctrl+Shift+F1 using Bome MIDI Translator. Below is an example AutoHotKey script that would accomplish this (note that everything after a ; is a comment):

Code: Select all

program:="obs64.exe" ;For convenience and testing with other windows

^+F1::  ;^ = Ctrl, + = Shift, F1 = F1
	WinWait ahk_exe %program%
	WinActivate ahk_exe %program%
	WinWaitActive ahk_exe %program% ;Wait until the window is active
	Send ^1
Return
Thus, the flow is as follows:
MIDI note -> MIDI translator -> Ctrl+Shift+F1 -> AutoHotKey -> Switch to OBS, Ctrl+1

I have only downloaded and learned AutoHotKey today so ideally what I can do is when AHK is triggered (in this example Ctrl+Shift+F1), I can store the currently active window in a variable, so that I can switch back to it after properly triggering the OBS hotkey (Ctrl+1). I shall update this post if I can figure out how to do so. But in the mean time, this works for me and hopefully does for anyone else with this problem as well.

florian

2016-10-01 15:44:04

Hi, great, thanks for posting!
Florian