Commit 6663a03a authored by Martijn Braam's avatar Martijn Braam Committed by Evangelos Ribeiro Tzaras
Browse files

Trigger capture with spacebar

parent 4c84fc8e
......@@ -420,6 +420,12 @@ on_shutter_clicked(GtkWidget *widget, gpointer user_data)
mp_io_pipeline_capture();
}
void
on_capture_shortcut(void)
{
on_shutter_clicked(NULL, NULL);
}
static bool
check_point_inside_bounds(int x, int y, int *bounds_x, int *bounds_y)
{
......@@ -760,6 +766,17 @@ main(int argc, char *argv[])
gtk_style_context_add_provider(context, GTK_STYLE_PROVIDER(provider),
GTK_STYLE_PROVIDER_PRIORITY_USER);
GClosure* capture_shortcut = g_cclosure_new(on_capture_shortcut, 0, 0);
GtkAccelGroup* accel_group = gtk_accel_group_new();
gtk_accel_group_connect(accel_group,
GDK_KEY_space,
0,
0,
capture_shortcut);
gtk_window_add_accel_group(GTK_WINDOW(window), accel_group);
mp_io_pipeline_start();
camera = mp_get_camera_config(0);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment