Created
January 19, 2016 07:22
-
-
Save vdudouyt/e5ac51d0295e2264c463 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <gtkhotkey.h> | |
void hotkey_activated_callback (GtkHotkeyInfo *hotkey, guint event_time, void *data) | |
{ | |
g_message("activated"); | |
} | |
int main(int argc, char **argv) | |
{ | |
gtk_init (&argc, &argv); | |
GtkHotkeyInfo *hotkey = gtk_hotkey_info_new("clicks-emulator", "hotkey1", "<Control>F12", NULL); | |
GError *error = NULL; | |
gtk_hotkey_info_bind(hotkey, &error); | |
if (error) | |
{ | |
g_critical ("Error binding hotkey: %s", | |
error->message); | |
} | |
g_signal_connect(hotkey, "activated", G_CALLBACK(hotkey_activated_callback), NULL); | |
gtk_main(); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment