https://bitbucket.org/hudson/magic-lantern
Raw File
Tip revision: 661537581171c7c5b65a1186143bc5596b953403 authored by dmilligan on 09 August 2015, 13:45:18 UTC
Close branch daniel_fort/added-sounddevshutdownin-1435698205057.
Tip revision: 6615375
keys.c
/** Key emulation demo */

printf("Let's fake some buttons :)\n");

// click means "press and release"
// press means "press and hold" (you need to call unpress too)

printf("Press any key to start.\n");
wait_key();

sleep(2);

console_hide();

click(MENU);
sleep(1);

click(LEFT);
sleep(1);

click(RIGHT);
sleep(1);

// notice the difference between press and click
press(RIGHT);
sleep(1);
unpress(RIGHT);
sleep(1);

click(MENU);
sleep(1);

click(PLAY);
sleep(1);

click(ZOOM_IN);
sleep(1);

click(PLAY);
sleep(1);

click(PLAY);
sleep(1);

press(SHOOT_HALF);
press(SHOOT_FULL);
sleep(1);
unpress(SHOOT_FULL);
unpress(SHOOT_HALF);

sleep(2);
console_show();
    
do {
    printf("Press SET to continue.\n");
} while (wait_key() != SET);

printf("That's all, folks!\n");
back to top