Logic UI: reset the value of a key when clicking outside the input button
authorDalai Felinto <dfelinto@gmail.com>
Wed, 15 Sep 2010 04:42:01 +0000 (04:42 +0000)
committerDalai Felinto <dfelinto@gmail.com>
Wed, 15 Sep 2010 04:42:01 +0000 (04:42 +0000)
Otherwise you had no way to set it to none. This doesn't really matter, but it's nice "userwise" to be able to clear the pressed key.

source/blender/makesrna/intern/rna_sensor.c

index d20e5aebcfbbbbd3d901c55ce2c42775f6247e4a..6dddb0425335ea8cbad93066c225616d6435c38e 100644 (file)
@@ -156,6 +156,8 @@ static void rna_Sensor_keyboard_key_set(struct PointerRNA *ptr, int value)
        
        if (ISKEYBOARD(value))
                ks->key = value;
+       else
+               ks->key = 0;
 }
 
 static void rna_Sensor_keyboard_modifier_set(struct PointerRNA *ptr, int value)
@@ -165,6 +167,8 @@ static void rna_Sensor_keyboard_modifier_set(struct PointerRNA *ptr, int value)
        
        if (ISKEYBOARD(value))
                ks->qual = value;
+       else
+               ks->qual = 0;
 }
                
 static void rna_Sensor_keyboard_modifier2_set(struct PointerRNA *ptr, int value)
@@ -174,6 +178,8 @@ static void rna_Sensor_keyboard_modifier2_set(struct PointerRNA *ptr, int value)
        
        if (ISKEYBOARD(value))
                ks->qual2 = value;
+       else
+               ks->qual2 = 0;
 }
 
 static void rna_Sensor_tap_set(struct PointerRNA *ptr, int value)