diff options
Diffstat (limited to 'source/blender/makesrna/intern/rna_wm.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_wm.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c index 21df596dec2..996d2d2882d 100644 --- a/source/blender/makesrna/intern/rna_wm.c +++ b/source/blender/makesrna/intern/rna_wm.c @@ -568,7 +568,19 @@ static int rna_Event_unicode_length(PointerRNA *ptr) static float rna_Event_pressure_get(PointerRNA *ptr) { wmEvent *event = ptr->data; - return WM_event_tablet_data(event, NULL); + return WM_event_tablet_data(event, NULL, NULL); +} + +static int rna_Event_is_tablet_get(PointerRNA *ptr) +{ + wmEvent *event = ptr->data; + return WM_event_is_tablet(event); +} + +static void rna_Event_tilt_get(PointerRNA *ptr, float *values) +{ + wmEvent *event = ptr->data; + WM_event_tablet_data(event, NULL, values); } static PointerRNA rna_PopupMenu_layout_get(PointerRNA *ptr) @@ -1619,6 +1631,17 @@ static void rna_def_event(BlenderRNA *brna) RNA_def_property_float_funcs(prop, "rna_Event_pressure_get", NULL, NULL); RNA_def_property_ui_text(prop, "Tablet Pressure", "The pressure of the tablet or 1.0 if no tablet present"); + prop = RNA_def_property(srna, "tilt", PROP_FLOAT, PROP_XYZ_LENGTH); + RNA_def_property_array(prop, 2); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_float_funcs(prop, "rna_Event_tilt_get", NULL, NULL); + RNA_def_property_ui_text(prop, "Tablet Tilt", "The pressure of the tablet or zeroes if no tablet present"); + + prop = RNA_def_property(srna, "is_tablet", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_boolean_funcs(prop, "rna_Event_is_tablet_get", NULL); + RNA_def_property_ui_text(prop, "Tablet Pressure", "The pressure of the tablet or 1.0 if no tablet present"); + /* modifiers */ prop = RNA_def_property(srna, "shift", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "shift", 1); |