Function "get_input_id"

FOR DEVS ONLY!! This allows you to easily get the current button ID that is being pressed. This can be used to forward any button to a turbo command etc.
Version1.00
AuthorDarkKiritoV
Publish DateSun, 6 Nov 2022 - 20:05
Last UpdateSun, 6 Nov 2022 - 20:05
Downloads58
RATE


0

0

Release Notes: :]
Code: Select all
/*
Function Made By DarkKiritoV
function_get_input_id.gpc
 
Intructions:
 
Paste the function into any script you want to!
 
Extra info:
I dont require credit but it would be nice!
 
IMPORTANT!!:
FOR SCRIPT DEVELOPERS ONLY NOT FOR CONSUMER USE!!
*/

 
main {
    //This line is for the demo you do not need it
    set_val(TRACE_1, get_input_id());
}
 
//Function Made By DarkKiritoV
function get_input_id() {
    if (get_val(0)) return 0; //XB1_XBOX
    if (get_val(1)) return 1; //XB1_VIEW
    if (get_val(2)) return 2; //XB1_MENU
    if (get_val(3)) return 3; //XB1_RB
    if (get_val(4)) return 4; //XB1_RT
    if (get_val(5)) return 5; //XB1_RS
    if (get_val(6)) return 6; //XB1_LB
    if (get_val(7)) return 7; //XB1_LT
    if (get_val(8)) return 8; //XB1_LS
    if (abs(get_val(9)) >= 20) return 9;    //RX SET TO 20 BECAUSE THATS ABOUT WHEN THE CONSOLE CAN SEE IT
    if (abs(get_val(10)) >= 20) return 10//RY SET TO 20 BECAUSE THATS ABOUT WHEN THE CONSOLE CAN SEE IT
    if (abs(get_val(11)) >= 20) return 11//LX SET TO 20 BECAUSE THATS ABOUT WHEN THE CONSOLE CAN SEE IT
    if (abs(get_val(12)) >= 20) return 12//LY SET TO 20 BECAUSE THATS ABOUT WHEN THE CONSOLE CAN SEE IT
    if (get_val(13)) return 13; //XB1_UP
    if (get_val(14)) return 14; //XB1_DOWN
    if (get_val(15)) return 15; //XB1_LEFT
    if (get_val(16)) return 16; //XB1_RIGHT
    if (get_val(17)) return 17; //XB1_Y
    if (get_val(18)) return 18; //XB1_B
    if (get_val(19)) return 19; //XB1_A
    if (get_val(20)) return 20; //XB1_X
    if (get_val(21)) return 21; //UNUSED
    if (get_val(22)) return 22; //UNUSED
    if (get_val(23)) return 23; //UNUSED
    if (get_val(24)) return 24; //XB1_P1
    if (get_val(25)) return 25; //XB1_P2
    if (get_val(26)) return 26; //XB1_P3
    if (get_val(27)) return 27; //XB1_P4
    if (get_val(28)) return 28; //UNUSED
    if (get_val(29)) return 29; //UNUSED
    //if (get_val(30)) return 30; //TRACE_1
    //if (get_val(31)) return 31; //TRACE_2
    //if (get_val(32)) return 32; //TRACE_3
    //if (get_val(33)) return 33; //TRACE_4
    //if (get_val(34)) return 34; //TRACE_5
    //if (get_val(35)) return 35; //TRACE_6
}