diff options
author | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2013-01-15 08:46:13 +0100 |
---|---|---|
committer | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2013-01-15 08:46:13 +0100 |
commit | 7fe60435bce6595a9c58a9bfd8244d74b5320e96 (patch) | |
tree | 1ac714a916e02fc90901ddac8bc2a3c6d051d28c /Source/DiVine/examples/divine-test.c | |
download | directfb-voodoo-7fe60435bce6595a9c58a9bfd8244d74b5320e96.tar.gz directfb-voodoo-7fe60435bce6595a9c58a9bfd8244d74b5320e96.tar.bz2 directfb-voodoo-7fe60435bce6595a9c58a9bfd8244d74b5320e96.zip |
Import DirectFB141_2k11R3_beta5
Diffstat (limited to 'Source/DiVine/examples/divine-test.c')
-rwxr-xr-x | Source/DiVine/examples/divine-test.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/Source/DiVine/examples/divine-test.c b/Source/DiVine/examples/divine-test.c new file mode 100755 index 0000000..dcad89e --- /dev/null +++ b/Source/DiVine/examples/divine-test.c @@ -0,0 +1,38 @@ +#include <unistd.h> +#include <string.h> + +#include <divine.h> + +int +main( int argc, char *argv[] ) +{ + int i; + DiVine *divine; + const char *msg = "DiVine Test!"; + int len = strlen( msg ); + + /* open the connection to the input driver */ + divine = divine_open( "/tmp/divine" ); + if (!divine) + return -1; + + /* wait a bit */ + sleep( 3 ); + + /* write a string */ + for (i=0; i<len; i++) { + /* simulate typing each character */ + divine_send_symbol( divine, msg[i] ); + + /* wait a second */ + sleep( 1 ); + } + + /* simulate a press/release of escape */ + divine_send_symbol( divine, DIKS_ESCAPE ); + + /* close the connection */ + divine_close( divine ); + + return 0; +} |