Shortcuts/Hotkeys not working with "virtual" keyboard

xaer_dev

New Member
Hello everyone!

I am trying to create from scratch a 4 key controller to use it as a scene controller using an arduino uno and some python scripting, but I am having a little problem.

When pressing a button on my controller I translate that key press in 4 different "shortcuts" using the library pynput.
The handling of the key presses is inside a loop so its always listening to changes.
Here is a little snipped of the code I wrote that handles the key presses.
Python:
keyboard = pynput.keyboard.Controller()
[...]
def scene_1(keyboard):
    keyboard.press(Key.ctrl)
    keyboard.press('1')
    keyboard.release('1')
    keyboard.release(Key.ctrl)
    
if button_1.isPressed():
    scene_1(keyboard)
[...]

As you can read from the code, the shortcut for the scene_1 is "CTRL + 1", and on my OBS Shortcut Settings I've mapped it to the correct scene:
obs64_kfyy74YEm6.png

I've done the same for each button and each scene
(I've got 3, so the shortcuts are "CTRL+1", "CTRL+2", "CTRL+3")
This works just fine with any application (tested on Chrome, Firefox and some others..) but NOT with OBS Studio.
The shortcuts from my actual keyboard work just fine.

Before Reading the log file:
From the time stamp [11:51:07.758] to [11:52:11.409] you can see various scene switches, for these I used my actual keyboard, and not the buttons mapped to the exact same shortcut.


Log File: logfile


I've already tried running OBS as administrator, restarted multiple times the code and the PC.
Is there anything I can do more?
 

BluePeer

Member
you need to send them to the applikation
other it will not work there exist similary request for the most popular macro softwares
there all work only if the keys send to the applikations , its related to the style how obs listen for them if i remember right
 

xaer_dev

New Member
you need to send them to the applikation
other it will not work there exist similary request for the most popular macro softwares
there all work only if the keys send to the applikations , its related to the style how obs listen for them if i remember right
I need to send a request to OBS even if the python script just simulates key presses?
 

BluePeer

Member
Visual Key registry in a system

KeypressPhysical A->b->c->d->e->

A is the Input signal arrive PC
C is where your script/software simulate (its a security feature from windows to set all virtuals on C and not on B)
B is the point where OBS Listen
 

xaer_dev

New Member
Visual Key registry in a system

KeypressPhysical A->b->c->d->e->

A is the Input signal arrive PC
C is where your script/software simulate (its a security feature from windows to set all virtuals on C and not on B)
B is the point where OBS Listen
Thanks for the simple explaination!
So I presume that what I actually have to do is find how to send requests using the OBS Scripting API, correct?
 
You can use AutoIt to create a script that can be triggered, or Noobs CMDR tool (fairly new here) can be used to create a bat/vbs file do obswebsocket functionality.

Once you have a script that works, you can figure out how to trigger it.
 
Top