diff options
author | Joshua Allen <axlecrusher@gmail.com> | 2017-03-18 20:23:40 -0400 |
---|---|---|
committer | Joshua Allen <axlecrusher@gmail.com> | 2017-03-18 20:23:40 -0400 |
commit | 079ef4516edee08da8a129a0d84249ccb79bbf23 (patch) | |
tree | 9e7b109a98957526ceca63b0ddd07fc96f8697a6 /test.c | |
parent | 4e3ac12016cc489c818709412acd293cac54cb78 (diff) | |
parent | 0f94e39d96fbc2744e61b85d2884250d0783eb11 (diff) | |
download | libsurvive-079ef4516edee08da8a129a0d84249ccb79bbf23.tar.gz libsurvive-079ef4516edee08da8a129a0d84249ccb79bbf23.tar.bz2 |
Merge branch 'master' of github.com:cnlohr/libsurvive
Diffstat (limited to 'test.c')
-rwxr-xr-x | test.c | 28 |
1 files changed, 28 insertions, 0 deletions
@@ -1,4 +1,6 @@ +#ifdef __linux__ #include <unistd.h> +#endif #include <stdio.h> #include <stdlib.h> #include <stdint.h> @@ -9,6 +11,31 @@ struct SurviveContext * ctx; +void HandleKey( int keycode, int bDown ) +{ + if( !bDown ) return; + + if( keycode == 'O' || keycode == 'o' ) + { + survive_send_magic(ctx,1,0,0); + } + if( keycode == 'F' || keycode == 'f' ) + { + survive_send_magic(ctx,0,0,0); + } +} + +void HandleButton( int x, int y, int button, int bDown ) +{ +} + +void HandleMotion( int x, int y, int mask ) +{ +} + +void HandleDestroy() +{ +} static void dump_iface( struct SurviveObject * so, const char * prefix ) @@ -56,6 +83,7 @@ int main() dump_iface( survive_get_so_by_name( ctx, "WM0" ), "WM0" ); dump_iface( survive_get_so_by_name( ctx, "WM1" ), "WM1" ); dump_iface( survive_get_so_by_name( ctx, "TR0" ), "TR0" ); + dump_iface( survive_get_so_by_name( ctx, "WW0" ), "WW0" ); while(survive_poll(ctx) == 0) { |