logo

Live Production Software Forums


Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
visioneimmagine  
#1 Posted : Wednesday, April 2, 2025 1:27:04 AM(UTC)
visioneimmagine

Rank: Newbie

Groups: Registered
Joined: 8/23/2020(UTC)
Posts: 4
Italy

Good evening, first of all I am not a programmer but I would like to learn slowly and so I am trying with visual basic to create some scripts for Vmix. As a test script I am trying to make it so that when I press the v key on the keyboard the output switches from camera 1 to the first video contained in a list. The script code however seems to absolutely not want to digest the End Sub closure, even if it seems to be regular. Who can help me? This is the code:
Tks Andrew


Dim HD_Webcam_PC_Frontale As String = "HD Webcam PC Frontale"
Dim listInputName As String = "List" ' Assicurati che il nome della tua lista sia proprio "List"

'-- Imposta la telecamera all'inizio
API.Function("CutDirect", Input:=HD_Webcam_PC_Frontale)

'-- Gestione degli eventi della tastiera
Sub OnKeyDown(Key)
If Key = 86 Then ' 86 è il codice ASCII per il tasto "v"
API.Function("ListPlayIndex", Input:=List, Value:="0") ' Riproduce il primo video (indice 0)
End If
End Sub

doggy  
#2 Posted : Wednesday, April 2, 2025 2:02:08 AM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 5,354
Belgium
Location: Belgium

Thanks: 300 times
Was thanked: 989 time(s) in 821 post(s)
Originally Posted by: visioneimmagine Go to Quoted Post
Good evening, first of all I am not a programmer but I would like to learn slowly and so I am trying with visual basic to create some scripts for Vmix. As a test script I am trying to make it so that when I press the v key on the keyboard the output switches from camera 1 to the first video contained in a list. The script code however seems to absolutely not want to digest the End Sub closure, even if it seems to be regular. Who can help me? This is the code:
Tks Andrew


Dim HD_Webcam_PC_Frontale As String = "HD Webcam PC Frontale"
Dim listInputName As String = "List" ' Assicurati che il nome della tua lista sia proprio "List"

'-- Imposta la telecamera all'inizio
API.Function("CutDirect", Input:=HD_Webcam_PC_Frontale)

'-- Gestione degli eventi della tastiera
Sub OnKeyDown(Key)
If Key = 86 Then ' 86 è il codice ASCII per il tasto "v"
API.Function("ListPlayIndex", Input:=List, Value:="0") ' Riproduce il primo video (indice 0)
End If
End Sub




you can not have subs or functions within a vMix vb.net script !

There is post regarding scripting with lots of examples , https://forums.vmix.com/...86-Scripting-for-Dummies
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.