3in1 (Click / Double Click / Press)

Script for 3 buttons on 1 buttons Button PsHome/XboxHome 1 click = Select / Share / Back / View 2 click = Start / Options / Menu Press = PS / XBOX This script based on script Double Click by excalibur2 PS : My wiimote on script is deform but it's pb on post
Version1.00
AuthorWiiMot3
Publish DateSun, 27 Apr 2014 - 21:56
Last UpdateSun, 27 Apr 2014 - 21:56
Downloads71
RATE


1

0

Release Notes: This script based on script Double Click by excalibur2
Code: Select all
 /*WiiMot3
 _____   
|o    |   
| _|_ |   
|  |  |   
| (A) |
|- * +|
| ::: |
| ::: |
| ::: |
|  1  |
|  2  |
|_____|
 
WiiMot3*/

define OPTION = XB1_XBOX;
 
 
int timelimit = 300; // increase if is to fast
int time_to_DblClick_1=0;
 
 
main {
    set_led(LED_1, 0);
    set_led(LED_2, 0);
    set_led(LED_3, 0);
//   time to R buton Double click ( Thanks to device for the 'timer')
    if (time_to_DblClick_1>0) time_to_DblClick_1=time_to_DblClick_1 - get_rtime();
 
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    if (event_release(OPTION) && get_ptime(OPTION)<200 && time_to_DblClick_1<=0 ) {time_to_DblClick_1 = timelimit; combo_run(singleTap);}
    else if (event_press(OPTION)&& time_to_DblClick_1>0 ){combo_run (DoublleTap); combo_stop(singleTap)}
    if(get_val(OPTION) && (get_ptime(OPTION) > 200)) {
      set_val(XB1_XBOX, 100);
      set_led(LED_3, 1);}
    else if (get_val(OPTION) && (get_ptime(OPTION) < 200)) {
    set_val(XB1_XBOX, 0);}
 
}// end of mine
    combo singleTap {
    wait(200);
    set_led(LED_1, 1);
    set_val(XB1_VIEW, 100);
    wait(100)
    }
    combo DoublleTap {
    set_led(LED_2, 1);
    set_val(XB1_MENU, 100);
    wait(200)
    }