Trigger capture with spacebar
This commit is contained in:
17
main.c
17
main.c
@@ -420,6 +420,12 @@ on_shutter_clicked(GtkWidget *widget, gpointer user_data)
|
|||||||
mp_io_pipeline_capture();
|
mp_io_pipeline_capture();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
on_capture_shortcut(void)
|
||||||
|
{
|
||||||
|
on_shutter_clicked(NULL, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
check_point_inside_bounds(int x, int y, int *bounds_x, int *bounds_y)
|
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_context_add_provider(context, GTK_STYLE_PROVIDER(provider),
|
||||||
GTK_STYLE_PROVIDER_PRIORITY_USER);
|
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();
|
mp_io_pipeline_start();
|
||||||
|
|
||||||
camera = mp_get_camera_config(0);
|
camera = mp_get_camera_config(0);
|
||||||
|
Reference in New Issue
Block a user