Example #1
0
void
gimp_device_info_set_key (GimpDeviceInfo *info,
                          gint             key,
                          guint            keyval,
                          GdkModifierType  modifiers)
{
  guint           old_keyval;
  GdkModifierType old_modifiers;

  g_return_if_fail (GIMP_IS_DEVICE_INFO (info));
  g_return_if_fail (key >= 0 && key < gimp_device_info_get_n_keys (info));

  gimp_device_info_get_key (info, key, &old_keyval, &old_modifiers);

  if (keyval    != old_keyval ||
      modifiers != old_modifiers)
    {
      if (info->device)
        {
          gdk_device_set_key (info->device, key, keyval, modifiers);
        }
      else
        {
          info->keys[key].keyval    = keyval;
          info->keys[key].modifiers = modifiers;
        }

      g_object_notify (G_OBJECT (info), "keys");
    }
}
Example #2
0
static VALUE
device_set_key(VALUE self, VALUE index, VALUE keyval, VALUE modifiers)
{
    gdk_device_set_key(_SELF(self), NUM2UINT(index), NUM2UINT(keyval),
                       RVAL2GFLAGS(modifiers, GDK_TYPE_MODIFIER_TYPE));
    return self;
}
Example #3
0
JNIEXPORT void JNICALL
Java_org_gnome_gdk_GdkDevice_gdk_1device_1set_1key
(
	JNIEnv* env,
	jclass cls,
	jlong _self,
	jint _index,
	jint _keyval,
	jint _modifiers
)
{
	GdkDevice* self;
	guint index;
	guint keyval;
	GdkModifierType modifiers;

	// convert parameter self
	self = (GdkDevice*) _self;

	// convert parameter index
	index = (guint) _index;

	// convert parameter keyval
	keyval = (guint) _keyval;

	// convert parameter modifiers
	modifiers = (GdkModifierType) _modifiers;

	// call function
	gdk_device_set_key(self, index, keyval, modifiers);

	// cleanup parameter self

	// cleanup parameter index

	// cleanup parameter keyval

	// cleanup parameter modifiers
}