[Bf-blender-cvs] [62c60385315] master: Docs: explain logic behind wm_event_modalkeymap

Campbell Barton noreply at git.blender.org
Fri Jan 10 05:49:59 CET 2020


Commit: 62c60385315f207c3e744adc8787e569ee0d3204
Author: Campbell Barton
Date:   Fri Jan 10 15:10:13 2020 +1100
Branches: master
https://developer.blender.org/rB62c60385315f207c3e744adc8787e569ee0d3204

Docs: explain logic behind wm_event_modalkeymap

===================================================================

M	source/blender/windowmanager/intern/wm_event_system.c

===================================================================

diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index 98ed908377c..0041143f93e 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -2073,7 +2073,16 @@ static wmKeyMapItem *wm_eventmatch_modal_keymap_items(const wmKeyMap *keymap,
   return NULL;
 }
 
-/* operator exists */
+/**
+ * This function prepares events for use with #wmOperatorType.modal by:
+ *
+ * - Matching keymap items with the operators modal keymap.
+ * - Converting double click events into press events,
+ *   allowing them to be restored when the events aren't handled.
+ *
+ *   This is done since we only want to use double click events to match key-map items,
+ *   allowing modal functions to check for press/release events without having to interpret them.
+ */
 static void wm_event_modalkeymap(const bContext *C,
                                  wmOperator *op,
                                  wmEvent *event,



More information about the Bf-blender-cvs mailing list