Re: [Gtk-osx-users] accelerator problem with GtkOSXApplication
- From: Olivier Sessink <oliviersessink gmail com>
- To: "GTK+-2 OSX Users" <gtk-osx-users lists sourceforge net>
- Subject: Re: [Gtk-osx-users] accelerator problem with GtkOSXApplication
- Date: Mon, 14 Feb 2011 23:36:12 +0100
I ended up with the following function, which replaces <control> with
<command and replaces <control><alt> with <command><control>
accelerators:
static void osx_accel_map_foreach_lcb(gpointer data,const gchar
*accel_path,guint accel_key, GdkModifierType accel_mods, gboolean
changed) {
if (accel_mods & GDK_MOD1_MASK && accel_mods & GDK_CONTROL_MASK) {
accel_mods &= ~ GDK_MOD1_MASK;
accel_mods |= GDK_META_MASK;
if (!gtk_accel_map_change_entry(accel_path,accel_key,accel_mods,FALSE)) {
g_print("could not change accelerator %s\n",accel_path);
}
} else if (accel_mods & GDK_CONTROL_MASK) {
accel_mods &= ~ GDK_CONTROL_MASK;
accel_mods |= GDK_META_MASK;
if (!gtk_accel_map_change_entry(accel_path,accel_key,accel_mods,FALSE)) {
g_print("could not change accelerator %s\n",accel_path);
}
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]