How can I trigger this combo via keyboard input?

GPC2 script programming for Titan Two. Code examples, questions, requests.

How can I trigger this combo via keyboard input?

Postby TheBruhhh » Tue Apr 11, 2023 11:35 am

I currently have this combo running when Button 8 (L3) is held. I'd love it if I could plug a footpedal into my Titan Two and then use that footpedal (key is Numpad1) to run this combo instead.

Is there a way I can add keyboard support to this script so that this is possible? Thanks for any help :smile0517:

Code: Select all
#pragma METAINFO("YY", 1, 0, "<author_name>")
 
main {
    if (get_val(8)) {
        if (!get_val(4) && !get_val(7)) combo_run(YY);
    }
}
combo YY {     
    set_val(13, 100.0);
    wait(89);
    set_val(13, 0.0);
    wait(39);
    set_val(13, 100.0);
    wait(89);
    set_val(13, 0.0);
    wait(39);
}
User avatar
TheBruhhh
First Sergeant
First Sergeant
 
Posts: 65
Joined: Sun Nov 24, 2019 1:28 pm

Re: How can I trigger this combo via keyboard input?

Postby Scachi » Tue Apr 11, 2023 1:27 pm

untested code:

add to the top: #include <keyboard.gph>

then add
Code: Select all
 
 
 
if (key_status(KEY_PAD1)) combo_run(YY);
 
 
User avatar
Scachi
Brigadier General
Brigadier General
 
Posts: 3044
Joined: Wed May 11, 2016 6:25 am
Location: Germany

Re: How can I trigger this combo via keyboard input?

Postby TheBruhhh » Tue Apr 11, 2023 4:12 pm

Awesome, tested and working, thanks boss!
User avatar
TheBruhhh
First Sergeant
First Sergeant
 
Posts: 65
Joined: Sun Nov 24, 2019 1:28 pm


Return to GPC2 Script Programming

Who is online

Users browsing this forum: No registered users and 116 guests