#define VOLUME_INTERVAL 10
-void send_mouse_event_efl(int x, int y){
- efl_util_input_generate_pointer(my_cursor, 1, EFL_UTIL_INPUT_POINTER_MOVE, x, y);
+void send_mouse_event_efl(int x, int y, efl_util_input_pointer_type_e event){
+ efl_util_input_generate_pointer(my_cursor, 1, event, x, y);
}
struct timespec diff(struct timespec start, struct timespec end)
{
cairo_set_source_rgba(cr, 0.0, 0.0, 1.0, 0.7);
cairo_set_line_width(cr, 2.0);
-
if (!humanSkeleton.IsDetected)
return;
cairo_move_to(cr, 320.0, 48.0);
cairo_show_text(cr, gHandGestureLabel[humanSkeleton.label]);
}*/
+
#define MOUSE_CONTROLLER
#ifdef MOUSE_CONTROLLER
static int move_x = 0;
static int move_y = 0;
+ static bool flag = true;
+ static bool click_flag = true;
+
move_x = (WIDTH - humanSkeleton.pose[9].x)*3;
- move_y = humanSkeleton.pose[9].y*2;
+ move_y = humanSkeleton.pose[9].y*2.5;
+
+ send_mouse_event_efl(move_x, move_y, EFL_UTIL_INPUT_POINTER_MOVE);
+
+ if(!g_strcmp0(gHandGestureLabel[humanSkeleton.label], "One") && click_flag){
+ send_mouse_event_efl(move_x, move_y, EFL_UTIL_INPUT_POINTER_BUTTON_DOWN);
+ send_mouse_event_efl(move_x, move_y, EFL_UTIL_INPUT_POINTER_BUTTON_UP);
+ click_flag = false;
+ }
- send_mouse_event_efl(move_x, move_y);
+ if (g_strcmp0(gHandGestureLabel[humanSkeleton.label], "One")){
+ click_flag = true;
+ }
+
+ if (flag && (!g_strcmp0(gHandGestureLabel[humanSkeleton.label], "DisLike") || !g_strcmp0(gHandGestureLabel[humanSkeleton.label], "Fist") )) {
+ send_mouse_event_efl(move_x, move_y, EFL_UTIL_INPUT_POINTER_BUTTON_DOWN);
+ flag = false;
+ }
+
+ if (!flag && !g_strcmp0(gHandGestureLabel[humanSkeleton.label], "Five")) {
+ send_mouse_event_efl(move_x, move_y, EFL_UTIL_INPUT_POINTER_BUTTON_UP);
+ flag = true;
+ }
-#elif REMOTE_CONTROLLER
+#elif REMOTE_CONTROLLER
int fd = -1;
//int signal = 8;
g_signal_connect (coverlay, "caps-changed", G_CALLBACK (prepare_overlay), overlay_state);
if (!ad->filename) {
- g_object_set(G_OBJECT(source), "device", "/dev/video252", NULL); // 252
+ g_object_set(G_OBJECT(source), "device", "/dev/video8", NULL);
} else {
g_object_set(G_OBJECT(source), "location", ad->filename, NULL);
//g_object_set(G_OBJECT(source), "num-buffers", ad->numbuffers, NULL);