Handlers/keymaps, some tweaks for previous commits:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Fri, 18 Sep 2009 15:48:49 +0000 (15:48 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Fri, 18 Sep 2009 15:48:49 +0000 (15:48 +0000)
* Screen keymap is now split up in two, some of the area/region
  manipulation operators here need to be handled before others.
* Moved paint/sculpt/sketch out of the 3d view keymap, these were
  there as a workaround, now with keymap poll no longer needed.
* Also fixes #19297, 3d cursor moves when combing in particle mode.

17 files changed:
source/blender/editors/armature/armature_ops.c
source/blender/editors/include/ED_sculpt.h
source/blender/editors/screen/screen_ops.c
source/blender/editors/sculpt_paint/paint_image.c
source/blender/editors/sculpt_paint/paint_intern.h
source/blender/editors/sculpt_paint/paint_ops.c
source/blender/editors/sculpt_paint/paint_vertex.c
source/blender/editors/sculpt_paint/sculpt.c
source/blender/editors/sculpt_paint/sculpt_intern.h
source/blender/editors/space_api/spacetypes.c
source/blender/editors/space_image/space_image.c
source/blender/editors/space_view3d/space_view3d.c
source/blender/editors/space_view3d/view3d_edit.c
source/blender/editors/space_view3d/view3d_ops.c
source/blender/makesdna/DNA_windowmanager_types.h
source/blender/windowmanager/intern/wm_event_system.c
source/blender/windowmanager/intern/wm_window.c

index 4a61c8d..9076b53 100644 (file)
@@ -279,6 +279,15 @@ void ED_keymap_armature(wmWindowManager *wm)
        WM_keymap_add_item(keymap, "SKETCH_OT_cancel_stroke", ESCKEY, KM_PRESS, 0, 0);
        WM_keymap_add_item(keymap, "SKETCH_OT_select", SELECTMOUSE, KM_PRESS, 0, 0);
 
+       /* sketch poll checks mode */   
+       WM_keymap_add_item(keymap, "SKETCH_OT_gesture", ACTIONMOUSE, KM_PRESS, KM_SHIFT, 0);
+       WM_keymap_add_item(keymap, "SKETCH_OT_draw_stroke", ACTIONMOUSE, KM_PRESS, 0, 0);
+       kmi = WM_keymap_add_item(keymap, "SKETCH_OT_draw_stroke", ACTIONMOUSE, KM_PRESS, KM_CTRL, 0);
+       RNA_boolean_set(kmi->ptr, "snap", 1);
+       WM_keymap_add_item(keymap, "SKETCH_OT_draw_preview", MOUSEMOVE, KM_ANY, 0, 0);
+       kmi = WM_keymap_add_item(keymap, "SKETCH_OT_draw_preview", MOUSEMOVE, KM_ANY, KM_CTRL, 0);
+       RNA_boolean_set(kmi->ptr, "snap", 1);
+
        /* Pose ------------------------ */
        /* only set in posemode, by space_view3d listener */
        keymap= WM_keymap_find(wm, "Pose", 0, 0);
index c6a8881..a08f057 100644 (file)
@@ -33,10 +33,10 @@ struct wmWindowManager;
 
 /* sculpt.c */
 void ED_operatortypes_sculpt(void);
-void ED_keymap_sculpt(struct wmWindowManager *wm);
 
 /* paint_ops.c */
 void ED_operatortypes_paint(void);
+void ED_keymap_paint(struct wmWindowManager *wm);
 
 /* paint_image.c */
 void undo_imagepaint_step(int step);
index 6107d41..b7e7fd1 100644 (file)
@@ -3293,17 +3293,13 @@ void ED_keymap_screen(wmWindowManager *wm)
 {
        wmKeyMap *keymap;
        
-       /* Screen General ------------------------------------------------ */
-       keymap= WM_keymap_find(wm, "Screen", 0, 0);
-       
-       
-       /* standard timers */
-       WM_keymap_add_item(keymap, "SCREEN_OT_animation_step", TIMER0, KM_ANY, KM_ANY, 0);
+       /* Screen Editing ------------------------------------------------ */
+       keymap= WM_keymap_find(wm, "Screen Editing", 0, 0);
        
        RNA_int_set(WM_keymap_add_item(keymap, "SCREEN_OT_actionzone", LEFTMOUSE, KM_PRESS, 0, 0)->ptr, "modifier", 0);
        RNA_int_set(WM_keymap_add_item(keymap, "SCREEN_OT_actionzone", LEFTMOUSE, KM_PRESS, KM_SHIFT, 0)->ptr, "modifier", 1);
        RNA_int_set(WM_keymap_add_item(keymap, "SCREEN_OT_actionzone", LEFTMOUSE, KM_PRESS, KM_ALT, 0)->ptr, "modifier", 2);
-       
+
        /* screen tools */
        WM_keymap_verify_item(keymap, "SCREEN_OT_area_split", EVT_ACTIONZONE_AREA, 0, 0, 0);
        WM_keymap_verify_item(keymap, "SCREEN_OT_area_join", EVT_ACTIONZONE_AREA, 0, 0, 0);
@@ -3312,6 +3308,14 @@ void ED_keymap_screen(wmWindowManager *wm)
        WM_keymap_verify_item(keymap, "SCREEN_OT_region_scale", EVT_ACTIONZONE_REGION, 0, 0, 0);
                        /* area move after action zones */
        WM_keymap_verify_item(keymap, "SCREEN_OT_area_move", LEFTMOUSE, KM_PRESS, 0, 0);
+
+
+       /* Screen General ------------------------------------------------ */
+       keymap= WM_keymap_find(wm, "Screen", 0, 0);
+       
+       /* standard timers */
+       WM_keymap_add_item(keymap, "SCREEN_OT_animation_step", TIMER0, KM_ANY, KM_ANY, 0);
+       
        
        RNA_int_set(WM_keymap_add_item(keymap, "SCREEN_OT_screen_set", RIGHTARROWKEY, KM_PRESS, KM_CTRL, 0)->ptr, "delta", 1);
        RNA_int_set(WM_keymap_add_item(keymap, "SCREEN_OT_screen_set", LEFTARROWKEY, KM_PRESS, KM_CTRL, 0)->ptr, "delta", -1);
index d3cd49a..b425667 100644 (file)
@@ -5240,6 +5240,11 @@ static int texture_paint_poll(bContext *C)
        return 0;
 }
 
+int image_texture_paint_poll(bContext *C)
+{
+       return (texture_paint_poll(C) || image_paint_poll(C));
+}
+
 void PAINT_OT_texture_paint_radial_control(wmOperatorType *ot)
 {
        WM_OT_radial_control_partial(ot);
index ba1b57a..8251d1a 100644 (file)
@@ -57,7 +57,10 @@ int paint_poll(bContext *C);
 void paint_cursor_start(struct bContext *C, int (*poll)(struct bContext *C));
 
 /* paint_vertex.c */
-int vertex_paint_mode_poll(bContext *C);
+int weight_paint_poll(struct bContext *C);
+int vertex_paint_poll(struct bContext *C);
+int vertex_paint_mode_poll(struct bContext *C);
+
 void clear_vpaint(Scene *scene, int selected);
 
 void PAINT_OT_weight_paint_toggle(struct wmOperatorType *ot);
@@ -69,6 +72,8 @@ void PAINT_OT_vertex_paint_toggle(struct wmOperatorType *ot);
 void PAINT_OT_vertex_paint(struct wmOperatorType *ot);
 
 /* paint_image.c */
+int image_texture_paint_poll(struct bContext *C);
+
 void PAINT_OT_image_paint(struct wmOperatorType *ot);
 void PAINT_OT_image_paint_radial_control(struct wmOperatorType *ot);
 void PAINT_OT_grab_clone(struct wmOperatorType *ot);
index 19b46f5..514c80d 100644 (file)
@@ -38,6 +38,7 @@
 #include "RNA_enum_types.h"
 
 #include "paint_intern.h"
+#include "sculpt_intern.h"
 
 #include <string.h>
 
@@ -133,3 +134,48 @@ void ED_operatortypes_paint(void)
        WM_operatortype_append(PAINT_OT_vertex_color_set);
 }
 
+void ED_keymap_paint(wmWindowManager *wm)
+{
+       wmKeyMap *keymap;
+       
+       /* Sculpt mode */
+       keymap= WM_keymap_find(wm, "Sculpt", 0, 0);
+       keymap->poll= sculpt_poll;
+
+       RNA_enum_set(WM_keymap_add_item(keymap, "SCULPT_OT_radial_control", FKEY, KM_PRESS, 0, 0)->ptr, "mode", WM_RADIALCONTROL_SIZE);
+       RNA_enum_set(WM_keymap_add_item(keymap, "SCULPT_OT_radial_control", FKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "mode", WM_RADIALCONTROL_STRENGTH);
+       RNA_enum_set(WM_keymap_add_item(keymap, "SCULPT_OT_radial_control", FKEY, KM_PRESS, KM_CTRL, 0)->ptr, "mode", WM_RADIALCONTROL_ANGLE);
+
+       WM_keymap_add_item(keymap, "SCULPT_OT_brush_stroke", LEFTMOUSE, KM_PRESS, 0, 0);
+       WM_keymap_add_item(keymap, "SCULPT_OT_brush_stroke", LEFTMOUSE, KM_PRESS, KM_SHIFT, 0);
+
+       /* Vertex Paint mode */
+       keymap= WM_keymap_find(wm, "Vertex Paint", 0, 0);
+       keymap->poll= vertex_paint_poll;
+
+       RNA_enum_set(WM_keymap_add_item(keymap, "PAINT_OT_vertex_paint_radial_control", FKEY, KM_PRESS, 0, 0)->ptr, "mode", WM_RADIALCONTROL_SIZE);
+       RNA_enum_set(WM_keymap_add_item(keymap, "PAINT_OT_vertex_paint_radial_control", FKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "mode", WM_RADIALCONTROL_STRENGTH);
+       WM_keymap_verify_item(keymap, "PAINT_OT_vertex_paint", LEFTMOUSE, KM_PRESS, 0, 0);
+       WM_keymap_add_item(keymap, "PAINT_OT_sample_color", RIGHTMOUSE, KM_PRESS, 0, 0);
+
+       /* Weight Paint mode */
+       keymap= WM_keymap_find(wm, "Weight Paint", 0, 0);
+       keymap->poll= weight_paint_poll;
+
+       RNA_enum_set(WM_keymap_add_item(keymap, "PAINT_OT_weight_paint_radial_control", FKEY, KM_PRESS, 0, 0)->ptr, "mode", WM_RADIALCONTROL_SIZE);
+       RNA_enum_set(WM_keymap_add_item(keymap, "PAINT_OT_weight_paint_radial_control", FKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "mode", WM_RADIALCONTROL_STRENGTH);
+
+       WM_keymap_verify_item(keymap, "PAINT_OT_weight_paint", LEFTMOUSE, KM_PRESS, 0, 0);
+
+       /* Image/Texture Paint mode */
+       keymap= WM_keymap_find(wm, "Image Paint", 0, 0);
+       keymap->poll= image_texture_paint_poll;
+
+       RNA_enum_set(WM_keymap_add_item(keymap, "PAINT_OT_texture_paint_radial_control", FKEY, KM_PRESS, 0, 0)->ptr, "mode", WM_RADIALCONTROL_SIZE);
+       RNA_enum_set(WM_keymap_add_item(keymap, "PAINT_OT_texture_paint_radial_control", FKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "mode", WM_RADIALCONTROL_STRENGTH);
+
+       WM_keymap_add_item(keymap, "PAINT_OT_image_paint", LEFTMOUSE, KM_PRESS, 0, 0);
+       WM_keymap_add_item(keymap, "PAINT_OT_sample_color", RIGHTMOUSE, KM_PRESS, 0, 0);
+       WM_keymap_add_item(keymap, "PAINT_OT_clone_cursor_set", LEFTMOUSE, KM_PRESS, KM_CTRL, 0);
+}
+
index 17fd1d4..5afc495 100644 (file)
@@ -119,7 +119,7 @@ int vertex_paint_mode_poll(bContext *C)
        return ob && ob->mode == OB_MODE_VERTEX_PAINT;
 }
 
-static int vp_poll(bContext *C)
+int vertex_paint_poll(bContext *C)
 {
        if(vertex_paint_mode_poll(C) && 
           paint_brush(&CTX_data_tool_settings(C)->vpaint->paint)) {
@@ -133,7 +133,7 @@ static int vp_poll(bContext *C)
        return 0;
 }
 
-static int wp_poll(bContext *C)
+int weight_paint_poll(bContext *C)
 {
        Object *ob = CTX_data_active_object(C);
 
@@ -1060,7 +1060,7 @@ static int set_wpaint(bContext *C, wmOperator *op)                /* toggle */
                        wp= scene->toolsettings->wpaint= new_vpaint(1);
 
                paint_init(&wp->paint, PAINT_CURSOR_WEIGHT_PAINT);
-               paint_cursor_start(C, wp_poll);
+               paint_cursor_start(C, weight_paint_poll);
                
                mesh_octree_table(ob, NULL, NULL, 's');
                
@@ -1129,7 +1129,7 @@ static int vpaint_radial_control_modal(bContext *C, wmOperator *op, wmEvent *eve
 {
        int ret = WM_radial_control_modal(C, op, event);
        if(ret != OPERATOR_RUNNING_MODAL)
-               paint_cursor_start(C, vp_poll);
+               paint_cursor_start(C, vertex_paint_poll);
        return ret;
 }
 
@@ -1158,7 +1158,7 @@ static int wpaint_radial_control_modal(bContext *C, wmOperator *op, wmEvent *eve
 {
        int ret = WM_radial_control_modal(C, op, event);
        if(ret != OPERATOR_RUNNING_MODAL)
-               paint_cursor_start(C, wp_poll);
+               paint_cursor_start(C, weight_paint_poll);
        return ret;
 }
 
@@ -1182,7 +1182,7 @@ void PAINT_OT_weight_paint_radial_control(wmOperatorType *ot)
        ot->invoke= wpaint_radial_control_invoke;
        ot->modal= wpaint_radial_control_modal;
        ot->exec= wpaint_radial_control_exec;
-       ot->poll= wp_poll;
+       ot->poll= weight_paint_poll;
        
        /* flags */
        ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
@@ -1198,7 +1198,7 @@ void PAINT_OT_vertex_paint_radial_control(wmOperatorType *ot)
        ot->invoke= vpaint_radial_control_invoke;
        ot->modal= vpaint_radial_control_modal;
        ot->exec= vpaint_radial_control_exec;
-       ot->poll= vp_poll;
+       ot->poll= vertex_paint_poll;
        
        /* flags */
        ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
@@ -1520,7 +1520,7 @@ void PAINT_OT_weight_paint(wmOperatorType *ot)
        ot->invoke= wpaint_invoke;
        ot->modal= paint_stroke_modal;
        /* ot->exec= vpaint_exec; <-- needs stroke property */
-       ot->poll= wp_poll;
+       ot->poll= weight_paint_poll;
        
        /* flags */
        ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
@@ -1567,7 +1567,7 @@ static int set_vpaint(bContext *C, wmOperator *op)                /* toggle */
                if(vp==NULL)
                        vp= scene->toolsettings->vpaint= new_vpaint(0);
                
-               paint_cursor_start(C, vp_poll);
+               paint_cursor_start(C, vertex_paint_poll);
 
                paint_init(&vp->paint, PAINT_CURSOR_VERTEX_PAINT);
        }
@@ -1792,7 +1792,7 @@ void PAINT_OT_vertex_paint(wmOperatorType *ot)
        ot->invoke= vpaint_invoke;
        ot->modal= paint_stroke_modal;
        /* ot->exec= vpaint_exec; <-- needs stroke property */
-       ot->poll= vp_poll;
+       ot->poll= vertex_paint_poll;
        
        /* flags */
        ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
index 89cd055..64af39e 100644 (file)
@@ -1039,7 +1039,7 @@ static int sculpt_mode_poll(bContext *C)
        return ob && ob->mode & OB_MODE_SCULPT;
 }
 
-static int sculpt_poll(bContext *C)
+int sculpt_poll(bContext *C)
 {
        return sculpt_mode_poll(C) && paint_poll(C);
 }
index 25f97b8..15ccacc 100644 (file)
@@ -33,6 +33,7 @@
 #include "DNA_listBase.h"
 #include "DNA_vec_types.h"
 
+struct bContext;
 struct Brush;
 struct Mesh;
 struct Object;
@@ -53,6 +54,8 @@ struct Brush *sculptmode_brush(void);
 char sculpt_modifiers_active(struct Object *ob);
 void sculpt(Sculpt *sd);
 
+int sculpt_poll(struct bContext *C);
+
 /* Stroke */
 struct SculptStroke *sculpt_stroke_new(const int max);
 void sculpt_stroke_free(struct SculptStroke *);
index edd5da4..18bc7ec 100644 (file)
@@ -129,6 +129,7 @@ void ED_spacetypes_keymap(wmWindowManager *wm)
        ED_keymap_armature(wm);
        ED_keymap_particle(wm);
        ED_keymap_metaball(wm);
+       ED_keymap_paint(wm);
        ED_marker_keymap(wm);
 
        UI_view2d_keymap(wm);
index e325a82..f222499 100644 (file)
@@ -404,7 +404,7 @@ static void image_main_area_init(wmWindowManager *wm, ARegion *ar)
        // UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_STANDARD, ar->winx, ar->winy);
 
        /* image paint polls for mode */
-       keymap= WM_keymap_find(wm, "ImagePaint", SPACE_IMAGE, 0);
+       keymap= WM_keymap_find(wm, "Image Paint", SPACE_IMAGE, 0);
        WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
 
        keymap= WM_keymap_find(wm, "UVEdit", 0, 0);
index 12c2b27..5ea633a 100644 (file)
@@ -279,14 +279,7 @@ static SpaceLink *view3d_duplicate(SpaceLink *sl)
 static void view3d_main_area_init(wmWindowManager *wm, ARegion *ar)
 {
        wmKeyMap *keymap;
-       
-       /* own keymap */
-       keymap= WM_keymap_find(wm, "View3D Generic", SPACE_VIEW3D, 0);
-       WM_event_add_keymap_handler(&ar->handlers, keymap);
 
-       keymap= WM_keymap_find(wm, "View3D", SPACE_VIEW3D, 0);
-       WM_event_add_keymap_handler(&ar->handlers, keymap);
-       
        /* object ops. */
        keymap= WM_keymap_find(wm, "Object Non-modal", 0, 0);
        WM_event_add_keymap_handler(&ar->handlers, keymap);
@@ -295,11 +288,19 @@ static void view3d_main_area_init(wmWindowManager *wm, ARegion *ar)
        keymap= WM_keymap_find(wm, "Pose", 0, 0);
        WM_event_add_keymap_handler(&ar->handlers, keymap);
        
-       /* operator poll checks for modes */
-       keymap= WM_keymap_find(wm, "ImagePaint", 0, 0);
+       keymap= WM_keymap_find(wm, "Object Mode", 0, 0);
        WM_event_add_keymap_handler(&ar->handlers, keymap);
 
-       keymap= WM_keymap_find(wm, "Object Mode", 0, 0);
+       keymap= WM_keymap_find(wm, "Image Paint", 0, 0);
+       WM_event_add_keymap_handler(&ar->handlers, keymap);
+
+       keymap= WM_keymap_find(wm, "Vertex Paint", 0, 0);
+       WM_event_add_keymap_handler(&ar->handlers, keymap);
+
+       keymap= WM_keymap_find(wm, "Weight Paint", 0, 0);
+       WM_event_add_keymap_handler(&ar->handlers, keymap);
+
+       keymap= WM_keymap_find(wm, "Sculpt", 0, 0);
        WM_event_add_keymap_handler(&ar->handlers, keymap);
        
        keymap= WM_keymap_find(wm, "EditMesh", 0, 0);
@@ -330,6 +331,13 @@ static void view3d_main_area_init(wmWindowManager *wm, ARegion *ar)
        /* editfont keymap swallows all... */
        keymap= WM_keymap_find(wm, "Font", 0, 0);
        WM_event_add_keymap_handler(&ar->handlers, keymap);
+
+       /* own keymap, last so modes can override it */
+       keymap= WM_keymap_find(wm, "View3D Generic", SPACE_VIEW3D, 0);
+       WM_event_add_keymap_handler(&ar->handlers, keymap);
+
+       keymap= WM_keymap_find(wm, "View3D", SPACE_VIEW3D, 0);
+       WM_event_add_keymap_handler(&ar->handlers, keymap);
 }
 
 /* type callback, not region itself */
index d287894..0faa1f8 100644 (file)
@@ -1850,8 +1850,7 @@ static int set_3dcursor_invoke(bContext *C, wmOperator *op, wmEvent *event)
        // XXX notifier for scene */
        ED_area_tag_redraw(CTX_wm_area(C));
 
-       /* prevent other mouse ops to fail */
-       return OPERATOR_PASS_THROUGH;
+       return OPERATOR_FINISHED;
 }
 
 void VIEW3D_OT_cursor3d(wmOperatorType *ot)
index 9ffdef4..3569e2a 100644 (file)
@@ -114,26 +114,6 @@ void view3d_keymap(wmWindowManager *wm)
        /* only for region 3D window */
        keymap= WM_keymap_find(wm, "View3D", SPACE_VIEW3D, 0);
        
-       /* paint poll checks mode */
-       WM_keymap_verify_item(keymap, "PAINT_OT_vertex_paint", LEFTMOUSE, KM_PRESS, 0, 0);
-       WM_keymap_verify_item(keymap, "PAINT_OT_weight_paint", LEFTMOUSE, KM_PRESS, 0, 0);
-
-       WM_keymap_add_item(keymap, "PAINT_OT_image_paint", LEFTMOUSE, KM_PRESS, 0, 0);
-       WM_keymap_add_item(keymap, "PAINT_OT_sample_color", RIGHTMOUSE, KM_PRESS, 0, 0);
-       WM_keymap_add_item(keymap, "PAINT_OT_clone_cursor_set", LEFTMOUSE, KM_PRESS, KM_CTRL, 0);
-
-       WM_keymap_add_item(keymap, "SCULPT_OT_brush_stroke", LEFTMOUSE, KM_PRESS, 0, 0);
-       WM_keymap_add_item(keymap, "SCULPT_OT_brush_stroke", LEFTMOUSE, KM_PRESS, KM_SHIFT, 0);
-
-       /* sketch poll checks mode */   
-       WM_keymap_add_item(keymap, "SKETCH_OT_gesture", ACTIONMOUSE, KM_PRESS, KM_SHIFT, 0);
-       WM_keymap_add_item(keymap, "SKETCH_OT_draw_stroke", ACTIONMOUSE, KM_PRESS, 0, 0);
-       km = WM_keymap_add_item(keymap, "SKETCH_OT_draw_stroke", ACTIONMOUSE, KM_PRESS, KM_CTRL, 0);
-       RNA_boolean_set(km->ptr, "snap", 1);
-       WM_keymap_add_item(keymap, "SKETCH_OT_draw_preview", MOUSEMOVE, KM_ANY, 0, 0);
-       km = WM_keymap_add_item(keymap, "SKETCH_OT_draw_preview", MOUSEMOVE, KM_ANY, KM_CTRL, 0);
-       RNA_boolean_set(km->ptr, "snap", 1);
-       
        WM_keymap_verify_item(keymap, "VIEW3D_OT_manipulator", LEFTMOUSE, KM_PRESS, 0, 0); /* manipulator always on left mouse, not on action mouse*/
        
        WM_keymap_verify_item(keymap, "VIEW3D_OT_cursor3d", ACTIONMOUSE, KM_PRESS, 0, 0);
@@ -234,18 +214,6 @@ void view3d_keymap(wmWindowManager *wm)
        WM_keymap_add_item(keymap, "VIEW3D_OT_camera_to_view", PAD0, KM_PRESS, KM_ALT|KM_CTRL, 0);
        
        WM_keymap_add_item(keymap, "VIEW3D_OT_snap_menu", SKEY, KM_PRESS, KM_SHIFT, 0);
-       
-       /* radial control */
-       RNA_enum_set(WM_keymap_add_item(keymap, "SCULPT_OT_radial_control", FKEY, KM_PRESS, 0, 0)->ptr, "mode", WM_RADIALCONTROL_SIZE);
-       RNA_enum_set(WM_keymap_add_item(keymap, "SCULPT_OT_radial_control", FKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "mode", WM_RADIALCONTROL_STRENGTH);
-       RNA_enum_set(WM_keymap_add_item(keymap, "SCULPT_OT_radial_control", FKEY, KM_PRESS, KM_CTRL, 0)->ptr, "mode", WM_RADIALCONTROL_ANGLE);
-
-       RNA_enum_set(WM_keymap_add_item(keymap, "PAINT_OT_vertex_paint_radial_control", FKEY, KM_PRESS, 0, 0)->ptr, "mode", WM_RADIALCONTROL_SIZE);
-       RNA_enum_set(WM_keymap_add_item(keymap, "PAINT_OT_weight_paint_radial_control", FKEY, KM_PRESS, 0, 0)->ptr, "mode", WM_RADIALCONTROL_SIZE);
-       RNA_enum_set(WM_keymap_add_item(keymap, "PAINT_OT_texture_paint_radial_control", FKEY, KM_PRESS, 0, 0)->ptr, "mode", WM_RADIALCONTROL_SIZE);
-       RNA_enum_set(WM_keymap_add_item(keymap, "PAINT_OT_vertex_paint_radial_control", FKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "mode", WM_RADIALCONTROL_STRENGTH);
-       RNA_enum_set(WM_keymap_add_item(keymap, "PAINT_OT_weight_paint_radial_control", FKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "mode", WM_RADIALCONTROL_STRENGTH);
-       RNA_enum_set(WM_keymap_add_item(keymap, "PAINT_OT_texture_paint_radial_control", FKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "mode", WM_RADIALCONTROL_STRENGTH);
 
        transform_keymap_for_space(wm, keymap, SPACE_VIEW3D);
 
index ee2b0ab..f1ce349 100644 (file)
@@ -163,7 +163,7 @@ typedef struct wmWindow {
        
        ListBase queue;                         /* all events (ghost level events were handled) */
        ListBase handlers;                      /* window+screen handlers, handled last */
-       ListBase modalhandlers;         /* modal handlers, overriding all queues */
+       ListBase modalhandlers;         /* priority handlers, handled first */
        
        ListBase subwindows;    /* opengl stuff for sub windows, see notes in wm_subwindow.c */
        ListBase gesture;               /* gesture stuff */
index e570a73..40026d2 100644 (file)
@@ -1165,7 +1165,7 @@ void wm_event_do_handlers(bContext *C)
                        /* MVC demands to not draw in event handlers... but we need to leave it for ogl selecting etc */
                        wm_window_make_drawable(C, win);
                        
-                       /* first we do modal handlers */
+                       /* first we do priority handlers, modal + some limited keymaps */
                        action= wm_handlers_do(C, event, &win->modalhandlers);
                        
                        /* fileread case */
index 2eee11c..9d3d0a9 100644 (file)
@@ -373,6 +373,9 @@ void wm_window_add_ghostwindows(wmWindowManager *wm)
                
                keymap= WM_keymap_find(wm, "Screen", 0, 0);
                WM_event_add_keymap_handler(&win->handlers, keymap);
+
+               keymap= WM_keymap_find(wm, "Screen Editing", 0, 0);
+               WM_event_add_keymap_handler(&win->modalhandlers, keymap);
                
                wm_window_title(wm, win);
        }