diff options
Diffstat (limited to 'source/blender/windowmanager/intern/wm_event_system.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_system.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index b500370d34d..2123a424be8 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -4162,6 +4162,19 @@ static void wm_eventemulation(wmEvent *event, bool test_only) } } +static const wmTabletData wm_event_tablet_data_default = { + .active = EVT_TABLET_NONE, + .pressure = 1.0f, + .x_tilt = 0.0f, + .y_tilt = 0.0f, + .is_motion_absolute = false, +}; + +void WM_event_tablet_data_default_set(wmTabletData *tablet_data) +{ + *tablet_data = wm_event_tablet_data_default; +} + void wm_tablet_data_from_ghost(const GHOST_TabletData *tablet_data, wmTabletData *wmtab) { if ((tablet_data != NULL) && tablet_data->Active != GHOST_kTabletModeNone) { @@ -4174,11 +4187,7 @@ void wm_tablet_data_from_ghost(const GHOST_TabletData *tablet_data, wmTabletData // printf("%s: using tablet %.5f\n", __func__, wmtab->pressure); } else { - wmtab->active = EVT_TABLET_NONE; - wmtab->pressure = 1.0f; - wmtab->x_tilt = 0.0f; - wmtab->y_tilt = 0.0f; - wmtab->is_motion_absolute = false; + *wmtab = wm_event_tablet_data_default; // printf("%s: not using tablet\n", __func__); } } |