libkeybinder/bind.c
void
keybinder_init ()
{
	GdkKeymap *keymap = gdk_keymap_get_default ();
	GdkWindow *rootwin = gdk_get_default_root_window ();
	Display *disp;
	int xkb_opcode;
	int xkb_event_base;
	int xkb_error_base;
	int majver = XkbMajorVersion;
	int minver = XkbMinorVersion;

	if (!keybinder_supported()) {
		return;
	}

	if (!(disp = XOpenDisplay(NULL))) {
		g_warning("keybinder_init: Unable to open display");
		return;
	}

	detected_xkb_extension = XkbQueryExtension(disp,
	                                           &xkb_opcode,
	                                           &xkb_event_base,
	                                           &xkb_error_base,
	                                           &majver, &minver);

	use_xkb_extension = detected_xkb_extension;
	TRACE(g_print("XKB: %d, version: %d, %d\n", use_xkb_extension, majver, minver));

	gdk_window_add_filter (rootwin, filter_func, NULL);

	/* Workaround: Make sure modmap is up to date
	 * There is possibly a bug in GTK+ where virtual modifiers are not
	 * mapped because the modmap is not updated. The following function
	 * updates it.
	 */
	(void) gdk_keymap_have_bidi_layouts(keymap);


	g_signal_connect (keymap, 
			  "keys_changed",
			  G_CALLBACK (keymap_changed),
			  NULL);
}
/**
 * keybinder_init:
 *
 * Initialize the keybinder library.
 *
 * This function must be called after initializing GTK, before calling any
 * other function in the library. Can only be called once.
 */
Initialize the keybinder library.

This function must be called after initializing GTK, before calling any
other function in the library. Can only be called once.
Initialize the keybinder library . This function must be called after initializing GTK before calling any other function in the library . Can only be called once .
void
keybinder_init ()
{
	GdkKeymap *keymap = gdk_keymap_get_default ();
	GdkWindow *rootwin = gdk_get_default_root_window ();
	Display *disp;
	int xkb_opcode;
	int xkb_event_base;
	int xkb_error_base;
	int majver = XkbMajorVersion;
	int minver = XkbMinorVersion;
	if (!keybinder_supported()) {
		return;
	}
	if (!(disp = XOpenDisplay(NULL))) {
		g_warning("keybinder_init: Unable to open display");
		return;
	}
	detected_xkb_extension = XkbQueryExtension(disp,
	                                           &xkb_opcode,
	                                           &xkb_event_base,
	                                           &xkb_error_base,
	                                           &majver, &minver);
	use_xkb_extension = detected_xkb_extension;
	TRACE(g_print("XKB: %d, version: %d, %d\n", use_xkb_extension, majver, minver));
	gdk_window_add_filter (rootwin, filter_func, NULL);
	(void) gdk_keymap_have_bidi_layouts(keymap);
	g_signal_connect (keymap, 
			  "keys_changed",
			  G_CALLBACK (keymap_changed),
			  NULL);
}
void keybinder_init ( ) { GdkKeymap * keymap = gdk_keymap_get_default ( ) ; GdkWindow * rootwin = gdk_get_default_root_window ( ) ; Display * disp ; int xkb_opcode ; int xkb_event_base ; int xkb_error_base ; int majver = XkbMajorVersion ; int minver = XkbMinorVersion ; if ( ! keybinder_supported ( ) ) { return ; } if ( ! ( disp = XOpenDisplay ( NULL ) ) ) { g_warning ( " " ) ; return ; } detected_xkb_extension = XkbQueryExtension ( disp , & xkb_opcode , & xkb_event_base , & xkb_error_base , & majver , & minver ) ; use_xkb_extension = detected_xkb_extension ; TRACE ( g_print ( " \n " , use_xkb_extension , majver , minver ) ) ; gdk_window_add_filter ( rootwin , filter_func , NULL ) ; ( void ) gdk_keymap_have_bidi_layouts ( keymap ) ; g_signal_connect ( keymap , " " , G_CALLBACK ( keymap_changed ) , NULL ) ; }
keybinder_init:
 Initialize the keybinder library.
keybinder_init : Initialize the keybinder library .
/* Workaround: Make sure modmap is up to date
	 * There is possibly a bug in GTK+ where virtual modifiers are not
	 * mapped because the modmap is not updated. The following function
	 * updates it.
	 */