From 141c6073ca39f0d59c67ebef89b094395b903a4a Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 2 Feb 2019 15:14:51 +1100 Subject: WM: Event simulation support for Python This feature is intended only for testing, to automate simulating user input. - Enabled by '--enable-event-simulate'. - Disables handling all real input events. - Access by calling `Window.event_simulate(..)` - Disabling `bpy.app.use_event_simulate` to allow handling real events (can only disable). Currently only mouse & keyboard events work well, NDOF, IME... etc could be added as needed. See D4286 for example usage. --- source/blender/blenkernel/BKE_global.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source/blender/blenkernel/BKE_global.h') diff --git a/source/blender/blenkernel/BKE_global.h b/source/blender/blenkernel/BKE_global.h index 045fc772426..706dec7580c 100644 --- a/source/blender/blenkernel/BKE_global.h +++ b/source/blender/blenkernel/BKE_global.h @@ -109,6 +109,8 @@ enum { G_FLAG_RENDER_VIEWPORT = (1 << 0), G_FLAG_BACKBUFSEL = (1 << 1), G_FLAG_PICKSEL = (1 << 2), + /** Support simulating events (for testing). */ + G_FLAG_EVENT_SIMULATE = (1 << 3), G_FLAG_SCRIPT_AUTOEXEC = (1 << 13), /** When this flag is set ignore the prefs #USER_SCRIPT_AUTOEXEC_DISABLE. */ @@ -119,7 +121,7 @@ enum { /** Don't overwrite these flags when reading a file. */ #define G_FLAG_ALL_RUNTIME \ - (G_FLAG_SCRIPT_AUTOEXEC | G_FLAG_SCRIPT_OVERRIDE_PREF) + (G_FLAG_SCRIPT_AUTOEXEC | G_FLAG_SCRIPT_OVERRIDE_PREF | G_FLAG_EVENT_SIMULATE) /** Flags to read from blend file. */ #define G_FLAG_ALL_READFILE 0 -- cgit v1.2.3