svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r21908:22075
[blender.git] / source / blender / editors / mesh / mesh_ops.c
index 2a9357ed0f0c9e55d67e75c63e683babe078fa94..edb131d7da2e9f556a5462b098c8fda0dc3a420a 100644 (file)
 #include "WM_api.h"
 #include "WM_types.h"
 
-#include "ED_screen.h"
 #include "ED_mesh.h"
+#include "ED_screen.h"
+#include "ED_transform.h"
 #include "ED_view3d.h"
 
-#include "BIF_transform.h"
+#include "UI_interface.h"
 
 #include "mesh_intern.h"
 
+/******************************** menus *************************************/
 
-static int mesh_add_duplicate_exec(bContext *C, wmOperator *op)
+static int vertex_specials_invoke(bContext *C, wmOperator *op, wmEvent *event)
 {
-       Object *ob= CTX_data_edit_object(C);
-       EditMesh *em= BKE_mesh_get_editmesh(ob->data);
+       uiPopupMenu *pup;
+       uiLayout *layout;
+
+       pup= uiPupMenuBegin(C, "Vertex Specials", 0);
+       layout= uiPupMenuLayout(pup);
+       uiLayoutSetOperatorContext(layout, WM_OP_INVOKE_REGION_WIN);
+
+       uiItemO(layout, "Remove Doubles", 0, "MESH_OT_remove_doubles");
+       uiItemO(layout, "Merge...", 0, "MESH_OT_merge");
+       uiItemO(layout, "Smooth", 0, "MESH_OT_vertices_smooth");
+       uiItemO(layout, "Select Vertex Path", 0, "MESH_OT_select_vertex_path"); 
+       //uiItemO(layout, "Blend From Shape", 0, "MESH_OT_blend_from_shape");
+       //uiItemO(layout, "Propagate to All Shapes", 0, "MESH_OT_shape_propagate_to_all");
 
-       adduplicateflag(em, SELECT);
+       uiPupMenuEnd(C, pup);
        
-       BKE_mesh_end_editmesh(ob->data, em);
-       return OPERATOR_FINISHED;
+       return OPERATOR_CANCELLED;
 }
 
-static int mesh_add_duplicate_invoke(bContext *C, wmOperator *op, wmEvent *event)
+static void MESH_OT_vertex_specials(wmOperatorType *ot)
 {
-       WM_cursor_wait(1);
-       mesh_add_duplicate_exec(C, op);
-       WM_cursor_wait(0);
+       /* identifiers */
+       ot->name= "Vertex Specials";
+       ot->idname= "MESH_OT_vertex_specials";
        
-       RNA_int_set(op->ptr, "mode", TFM_TRANSLATION);
-       WM_operator_name_call(C, "TFM_OT_transform", WM_OP_INVOKE_REGION_WIN, op->ptr);
+       /* api callbacks */
+       ot->invoke= vertex_specials_invoke;
+       ot->poll= ED_operator_editmesh;
+}
+
+static int edge_specials_invoke(bContext *C, wmOperator *op, wmEvent *event)
+{
+       uiPopupMenu *pup;
+       uiLayout *layout;
+
+       pup= uiPupMenuBegin(C, "Edge Specials", 0);
+       layout= uiPupMenuLayout(pup);
+       uiLayoutSetOperatorContext(layout, WM_OP_INVOKE_REGION_WIN);
+
+       uiItemO(layout, "Mark Seam", 0, "MESH_OT_mark_seam");
+       uiItemBooleanO(layout, "Clear Seam", 0, "MESH_OT_mark_seam", "clear", 1);
+       uiItemEnumO(layout, "Rotate Edge CW", 0, "MESH_OT_edge_rotate", "direction", 1);
+       uiItemEnumO(layout, "Rotate Edge CCW", 0, "MESH_OT_edge_rotate", "direction", 2);
+       //uiItemO(layout, "Loopcut", 0, "MESH_OT_loop_cut"); // CutEdgeloop(em, 1);
+       //uiItemO(layout, "Edge Slide", 0, "MESH_OT_edge_slide"); // EdgeSlide(em, 0,0.0);
+       uiItemO(layout, "Edge Loop", 0, "MESH_OT_loop_multi_select");
+       uiItemBooleanO(layout, "Edge Ring", 0, "MESH_OT_loop_multi_select", "ring", 1);
+       uiItemO(layout, NULL, 0, "MESH_OT_loop_to_region");
+       uiItemO(layout, NULL, 0, "MESH_OT_region_to_loop");
+       uiItemO(layout, "Mark Sharp", 0, "MESH_OT_mark_sharp");
+       uiItemBooleanO(layout, "Clear Sharp", 0, "MESH_OT_mark_sharp", "clear", 1);
+
+       uiPupMenuEnd(C, pup);
+
+       return OPERATOR_CANCELLED;
+}
+
+static void MESH_OT_edge_specials(wmOperatorType *ot)
+{
+       /* identifiers */
+       ot->name= "Edge Specials";
+       ot->idname= "MESH_OT_edge_specials";
        
-       return OPERATOR_FINISHED;
+       /* api callbacks */
+       ot->invoke= edge_specials_invoke;
+       ot->poll= ED_operator_editmesh;
 }
 
-static void MESH_OT_duplicate_add(wmOperatorType *ot)
+static int face_specials_invoke(bContext *C, wmOperator *op, wmEvent *event)
 {
+       uiPopupMenu *pup;
+       uiLayout *layout;
+
+       pup= uiPupMenuBegin(C, "Face Specials", 0);
+       layout= uiPupMenuLayout(pup);
+       uiLayoutSetOperatorContext(layout, WM_OP_INVOKE_REGION_WIN);
+
+       uiItemO(layout, NULL, 0, "MESH_OT_flip_normals");
+       // uiItemO(layout, "Bevel", 0, "MESH_OT_bevel"); // bevelmenu(em)
+       uiItemO(layout, NULL, 0, "MESH_OT_faces_shade_smooth");
+       uiItemO(layout, NULL, 0, "MESH_OT_faces_shade_flat");
+       uiItemO(layout, NULL, 0, "MESH_OT_quads_convert_to_tris");
+       uiItemO(layout, NULL, 0, "MESH_OT_tris_convert_to_quads");
+       uiItemO(layout, NULL, 0, "MESH_OT_edge_flip");
+
+       uiItemS(layout);
+
+       uiItemO(layout, NULL, 0, "MESH_OT_fill");
+       uiItemO(layout, NULL, 0, "MESH_OT_beauty_fill");
+
+       uiItemS(layout);
+
+       // uiItemO(layout, NULL, 0, "MESH_OT_face_mode"); // mesh_set_face_flags(em, 1);
+       // uiItemBooleanO(layout, NULL, 0, "MESH_OT_face_mode", "clear", 1); // mesh_set_face_flags(em, 0);
+       //
+       // uiItemS(layout);
+
+       uiItemMenuEnumO(layout, NULL, 0, "MESH_OT_uvs_rotate", "direction");
+       uiItemMenuEnumO(layout, NULL, 0, "MESH_OT_uvs_mirror", "axis");
+       uiItemMenuEnumO(layout, NULL, 0, "MESH_OT_colors_rotate", "direction");
+       uiItemMenuEnumO(layout, NULL, 0, "MESH_OT_colors_mirror", "axis");
+
+       uiPupMenuEnd(C, pup);
        
+       return OPERATOR_CANCELLED;
+}
+
+static void MESH_OT_face_specials(wmOperatorType *ot)
+{
        /* identifiers */
-       ot->name= "Add Duplicate";
-       ot->idname= "MESH_OT_duplicate_add";
+       ot->name= "Face Specials";
+       ot->idname= "MESH_OT_face_specials";
        
        /* api callbacks */
-       ot->invoke= mesh_add_duplicate_invoke;
-       ot->exec= mesh_add_duplicate_exec;
-       
+       ot->invoke= face_specials_invoke;
        ot->poll= ED_operator_editmesh;
+}
+
+static int specials_invoke(bContext *C, wmOperator *op, wmEvent *event)
+{
+       uiPopupMenu *pup;
+       uiLayout *layout;
+
+       pup= uiPupMenuBegin(C, "Specials", 0);
+       layout= uiPupMenuLayout(pup);
+       uiLayoutSetOperatorContext(layout, WM_OP_INVOKE_REGION_WIN);
+
+       uiItemO(layout, "Subdivide", 0, "MESH_OT_subdivide");
+       uiItemFloatO(layout, "Subdivide Smooth", 0, "MESH_OT_subdivide", "smoothness", 1.0f);
+       uiItemO(layout, "Merge...", 0, "MESH_OT_merge");
+       uiItemO(layout, "Remove Doubles", 0, "MESH_OT_remove_doubles");
+       uiItemO(layout, "Hide", 0, "MESH_OT_hide");
+       uiItemO(layout, "Reveal", 0, "MESH_OT_reveal");
+       uiItemO(layout, "Select Inverse", 0, "MESH_OT_select_inverse");
+       uiItemO(layout, NULL, 0, "MESH_OT_flip_normals");
+       uiItemO(layout, "Smooth", 0, "MESH_OT_vertices_smooth");
+       // uiItemO(layout, "Bevel", 0, "MESH_OT_bevel"); // bevelmenu(em)
+       uiItemO(layout, NULL, 0, "MESH_OT_faces_shade_smooth");
+       uiItemO(layout, NULL, 0, "MESH_OT_faces_shade_flat");
+       //uiItemO(layout, "Blend From Shape", 0, "MESH_OT_blend_from_shape");
+       //uiItemO(layout, "Propagate to All Shapes", 0, "MESH_OT_shape_propagate_to_all");
+       uiItemO(layout, "Select Vertex Path", 0, "MESH_OT_select_vertex_path"); 
        
-       /* to give to transform */
-       RNA_def_int(ot->srna, "mode", TFM_TRANSLATION, 0, INT_MAX, "Mode", "", 0, INT_MAX);
+       uiPupMenuEnd(C, pup);
+       
+       return OPERATOR_CANCELLED;
 }
 
+static void MESH_OT_specials(wmOperatorType *ot)
+{
+       /* identifiers */
+       ot->name= "Specials";
+       ot->idname= "MESH_OT_specials";
+       
+       /* api callbacks */
+       ot->invoke= specials_invoke;
+       ot->poll= ED_operator_editmesh;
+}
 
-/* ************************** registration **********************************/
+/**************************** registration **********************************/
 
 void ED_operatortypes_mesh(void)
 {
+       wmOperatorType *ot;
+       
        WM_operatortype_append(MESH_OT_select_all_toggle);
        WM_operatortype_append(MESH_OT_select_more);
        WM_operatortype_append(MESH_OT_select_less);
-       WM_operatortype_append(MESH_OT_select_invert);
+       WM_operatortype_append(MESH_OT_select_inverse);
        WM_operatortype_append(MESH_OT_select_non_manifold);
        WM_operatortype_append(MESH_OT_select_linked);
        WM_operatortype_append(MESH_OT_select_linked_pick);
@@ -119,12 +243,10 @@ void ED_operatortypes_mesh(void)
        WM_operatortype_append(MESH_OT_selection_type);
        WM_operatortype_append(MESH_OT_hide);
        WM_operatortype_append(MESH_OT_reveal);
+       WM_operatortype_append(MESH_OT_select_by_number_vertices);
        WM_operatortype_append(MESH_OT_normals_make_consistent);
+       WM_operatortype_append(MESH_OT_merge);
        WM_operatortype_append(MESH_OT_subdivide);
-       WM_operatortype_append(MESH_OT_subdivide_multi);
-       WM_operatortype_append(MESH_OT_subdivide_multi_fractal);
-       WM_operatortype_append(MESH_OT_subdivide_smooth);
-       WM_operatortype_append(MESH_OT_subdivs);
        WM_operatortype_append(MESH_OT_faces_select_linked_flat);
        WM_operatortype_append(MESH_OT_edges_select_sharp);
        WM_operatortype_append(MESH_OT_primitive_plane_add);
@@ -139,7 +261,7 @@ void ED_operatortypes_mesh(void)
        WM_operatortype_append(MESH_OT_primitive_ico_sphere_add);
        WM_operatortype_append(MESH_OT_fgon_clear);
        WM_operatortype_append(MESH_OT_fgon_make);
-       WM_operatortype_append(MESH_OT_duplicate_add);
+       WM_operatortype_append(MESH_OT_duplicate);
        WM_operatortype_append(MESH_OT_remove_doubles);
        WM_operatortype_append(MESH_OT_extrude);
        WM_operatortype_append(MESH_OT_spin);
@@ -149,6 +271,7 @@ void ED_operatortypes_mesh(void)
        WM_operatortype_append(MESH_OT_split);
        WM_operatortype_append(MESH_OT_extrude_repeat);
        WM_operatortype_append(MESH_OT_edge_rotate);
+       WM_operatortype_append(MESH_OT_select_vertex_path);
        WM_operatortype_append(MESH_OT_loop_to_region);
        WM_operatortype_append(MESH_OT_region_to_loop);
        
@@ -163,7 +286,7 @@ void ED_operatortypes_mesh(void)
        WM_operatortype_append(MESH_OT_tris_convert_to_quads);
        WM_operatortype_append(MESH_OT_edge_flip);
        WM_operatortype_append(MESH_OT_faces_shade_smooth);
-       WM_operatortype_append(MESH_OT_faces_shade_solid);
+       WM_operatortype_append(MESH_OT_faces_shade_flat);
 
        WM_operatortype_append(MESH_OT_delete);
 
@@ -172,14 +295,12 @@ void ED_operatortypes_mesh(void)
        WM_operatortype_append(MESH_OT_loop_select);
        WM_operatortype_append(MESH_OT_edge_face_add);
        WM_operatortype_append(MESH_OT_select_shortest_path);
-       WM_operatortype_append(MESH_OT_vertices_select_similar);
-       WM_operatortype_append(MESH_OT_edges_select_similar);
-       WM_operatortype_append(MESH_OT_faces_select_similar);
+       WM_operatortype_append(MESH_OT_select_similar);
        WM_operatortype_append(MESH_OT_loop_multi_select);
        WM_operatortype_append(MESH_OT_mark_seam);
        WM_operatortype_append(MESH_OT_mark_sharp);
        WM_operatortype_append(MESH_OT_vertices_smooth);
-       WM_operatortype_append(MESH_OT_flip_editnormals);
+       WM_operatortype_append(MESH_OT_flip_normals);
        WM_operatortype_append(MESH_OT_knife_cut);
        WM_operatortype_append(MESH_OT_rip);
        
@@ -189,6 +310,25 @@ void ED_operatortypes_mesh(void)
        WM_operatortype_append(MESH_OT_vertex_color_remove);
        WM_operatortype_append(MESH_OT_sticky_add);
        WM_operatortype_append(MESH_OT_sticky_remove);
+
+       WM_operatortype_append(MESH_OT_vertex_specials);
+       WM_operatortype_append(MESH_OT_edge_specials);
+       WM_operatortype_append(MESH_OT_face_specials);
+       WM_operatortype_append(MESH_OT_specials);
+       
+       /* macros */
+       ot= WM_operatortype_append_macro("MESH_OT_duplicate_move", "Add Duplicate", OPTYPE_UNDO|OPTYPE_REGISTER);
+       WM_operatortype_macro_define(ot, "MESH_OT_duplicate");
+       WM_operatortype_macro_define(ot, "TFM_OT_translate");
+
+       ot= WM_operatortype_append_macro("MESH_OT_rip_move", "Rip", OPTYPE_UNDO|OPTYPE_REGISTER);
+       WM_operatortype_macro_define(ot, "MESH_OT_rip");
+       WM_operatortype_macro_define(ot, "TFM_OT_translate");
+
+       ot= WM_operatortype_append_macro("MESH_OT_extrude_move", "Extrude", OPTYPE_UNDO|OPTYPE_REGISTER);
+       WM_operatortype_macro_define(ot, "MESH_OT_extrude");
+       WM_operatortype_macro_define(ot, "TFM_OT_translate");
+       
 }
 
 /* note mesh keymap also for other space? */
@@ -213,7 +353,7 @@ void ED_keymap_mesh(wmWindowManager *wm)
        WM_keymap_add_item(keymap, "MESH_OT_select_all_toggle", AKEY, KM_PRESS, 0, 0);
        WM_keymap_add_item(keymap, "MESH_OT_select_more", PADPLUSKEY, KM_PRESS, KM_CTRL, 0);
        WM_keymap_add_item(keymap, "MESH_OT_select_less", PADMINUS, KM_PRESS, KM_CTRL, 0);
-       WM_keymap_add_item(keymap, "MESH_OT_select_invert", IKEY, KM_PRESS, KM_CTRL, 0);
+       WM_keymap_add_item(keymap, "MESH_OT_select_inverse", IKEY, KM_PRESS, KM_CTRL, 0);
        WM_keymap_add_item(keymap, "MESH_OT_select_non_manifold", MKEY, KM_PRESS, (KM_CTRL|KM_SHIFT|KM_ALT), 0);
        
        WM_keymap_add_item(keymap, "MESH_OT_select_linked", LKEY, KM_PRESS, KM_CTRL, 0);
@@ -223,19 +363,9 @@ void ED_keymap_mesh(wmWindowManager *wm)
        RNA_float_set(WM_keymap_add_item(keymap, "MESH_OT_faces_select_linked_flat", FKEY, KM_PRESS, (KM_CTRL|KM_SHIFT|KM_ALT), 0)->ptr,"sharpness",135.0);
        RNA_float_set(WM_keymap_add_item(keymap, "MESH_OT_edges_select_sharp", SKEY, KM_PRESS, (KM_CTRL|KM_SHIFT|KM_ALT), 0)->ptr,"sharpness",135.0);
        
-       WM_keymap_add_item(keymap, "MESH_OT_select_random", SPACEKEY, KM_PRESS, 0, 0);
        WM_keymap_add_item(keymap, "MESH_OT_vertices_transform_to_sphere", SKEY, KM_PRESS, KM_CTRL|KM_SHIFT , 0);
 
-       WM_keymap_add_item(keymap, "MESH_OT_mark_seam", ONEKEY, KM_PRESS, KM_CTRL , 0);
-       RNA_boolean_set(WM_keymap_add_item(keymap, "MESH_OT_mark_seam", ONEKEY, KM_PRESS, KM_ALT , 0)->ptr,"clear",1);
-
-       WM_keymap_add_item(keymap, "MESH_OT_mark_sharp", TWOKEY, KM_PRESS, KM_CTRL , 0);
-       RNA_boolean_set(WM_keymap_add_item(keymap, "MESH_OT_mark_sharp", TWOKEY, KM_PRESS, KM_ALT , 0)->ptr,"set",1);
-
-       /* temp hotkeys! */
-       WM_keymap_add_item(keymap, "MESH_OT_vertices_select_similar", GKEY, KM_PRESS, KM_SHIFT, 0);
-       WM_keymap_add_item(keymap, "MESH_OT_edges_select_similar", GKEY, KM_PRESS, KM_SHIFT2|KM_CTRL, 0);
-       WM_keymap_add_item(keymap, "MESH_OT_faces_select_similar", GKEY, KM_PRESS, KM_SHIFT|KM_CTRL2, 0);
+       WM_keymap_add_item(keymap, "MESH_OT_select_similar", GKEY, KM_PRESS, KM_SHIFT, 0);
        
        /* selection mode */
        WM_keymap_add_item(keymap, "MESH_OT_selection_type", TABKEY, KM_PRESS, KM_CTRL, 0);
@@ -248,24 +378,17 @@ void ED_keymap_mesh(wmWindowManager *wm)
        /* tools */
        WM_keymap_add_item(keymap, "MESH_OT_normals_make_consistent", NKEY, KM_PRESS, KM_CTRL, 0);
        RNA_boolean_set(WM_keymap_add_item(keymap, "MESH_OT_normals_make_consistent", NKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0)->ptr, "inside", 1);
-       WM_keymap_add_item(keymap, "MESH_OT_vertices_smooth", THREEKEY, KM_PRESS, KM_CTRL , 0);
-       WM_keymap_add_item(keymap, "MESH_OT_flip_editnormals", THREEKEY, KM_PRESS, KM_ALT , 0);
        
-       WM_keymap_add_item(keymap, "MESH_OT_subdivs", WKEY, KM_PRESS, 0, 0); // this is the menu
-       /*WM_keymap_add_item(keymap, "MESH_OT_subdivide_multi", WKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0);
-       WM_keymap_add_item(keymap, "MESH_OT_subdivide_multi_fractal", WKEY, KM_PRESS, KM_ALT, 0);
-       WM_keymap_add_item(keymap, "MESH_OT_subdivide_smooth", WKEY, KM_PRESS, KM_CTRL|KM_ALT, 0);*/
-       WM_keymap_add_item(keymap, "MESH_OT_remove_doubles", VKEY, KM_PRESS, KM_CTRL, 0);
-       WM_keymap_add_item(keymap, "MESH_OT_extrude", EKEY, KM_PRESS, 0, 0);
+       WM_keymap_add_item(keymap, "MESH_OT_extrude_move", EKEY, KM_PRESS, 0, 0);
        
        WM_keymap_add_item(keymap, "MESH_OT_spin", RKEY, KM_PRESS, KM_ALT, 0);
        WM_keymap_add_item(keymap, "MESH_OT_screw", NINEKEY, KM_PRESS, KM_CTRL, 0);
        
-       WM_keymap_add_item(keymap, "VIEW3D_OT_editmesh_face_toolbox", FKEY, KM_PRESS, KM_CTRL, 0); /* operators below are in this toolbox */
        WM_keymap_add_item(keymap, "MESH_OT_fill", FKEY, KM_PRESS, KM_SHIFT, 0);
        WM_keymap_add_item(keymap, "MESH_OT_beauty_fill", FKEY, KM_PRESS, KM_ALT, 0);
        WM_keymap_add_item(keymap, "MESH_OT_quads_convert_to_tris", TKEY, KM_PRESS, KM_CTRL, 0);
        WM_keymap_add_item(keymap, "MESH_OT_tris_convert_to_quads", JKEY, KM_PRESS, KM_ALT, 0);
+       WM_keymap_add_item(keymap, "MESH_OT_edge_flip", FKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0);
        
        WM_keymap_add_item(keymap, "MESH_OT_split", FOURKEY, KM_PRESS, KM_CTRL, 0);
        WM_keymap_add_item(keymap, "MESH_OT_extrude_repeat", FOURKEY, KM_PRESS, KM_ALT, 0);
@@ -279,11 +402,12 @@ void ED_keymap_mesh(wmWindowManager *wm)
        WM_keymap_add_item(keymap, "MESH_OT_colors_rotate",EIGHTKEY, KM_PRESS, KM_CTRL, 0);
        WM_keymap_add_item(keymap, "MESH_OT_colors_mirror",EIGHTKEY, KM_PRESS, KM_ALT, 0);
 
-       WM_keymap_add_item(keymap, "MESH_OT_rip",VKEY, KM_PRESS, 0, 0);
+       WM_keymap_add_item(keymap, "MESH_OT_rip_move",VKEY, KM_PRESS, 0, 0);
+       WM_keymap_add_item(keymap, "MESH_OT_merge", MKEY, KM_PRESS, KM_ALT, 0);
 
        /* add/remove */
        WM_keymap_add_item(keymap, "MESH_OT_edge_face_add", FKEY, KM_PRESS, 0, 0);
-       WM_keymap_add_item(keymap, "MESH_OT_duplicate_add", DKEY, KM_PRESS, KM_SHIFT, 0);
+       WM_keymap_add_item(keymap, "MESH_OT_duplicate_move", DKEY, KM_PRESS, KM_SHIFT, 0);
        WM_keymap_add_item(keymap, "OBJECT_OT_mesh_add", AKEY, KM_PRESS, KM_SHIFT, 0);
        WM_keymap_add_item(keymap, "MESH_OT_separate", PKEY, KM_PRESS, KM_SHIFT, 0);
                                                /* use KM_RELEASE because same key is used for tweaks */
@@ -295,6 +419,12 @@ void ED_keymap_mesh(wmWindowManager *wm)
        WM_keymap_add_item(keymap, "MESH_OT_fgon_clear", FKEY, KM_PRESS, KM_SHIFT|KM_ALT, 0);
        
        WM_keymap_add_item(keymap, "MESH_OT_knife_cut", LEFTMOUSE, KM_PRESS, KM_ALT|KM_CTRL, 0);
+
+       /* menus */
+       WM_keymap_add_item(keymap, "MESH_OT_vertex_specials", VKEY, KM_PRESS, KM_CTRL, 0);
+       WM_keymap_add_item(keymap, "MESH_OT_edge_specials", EKEY, KM_PRESS, KM_CTRL, 0);
+       WM_keymap_add_item(keymap, "MESH_OT_face_specials", FKEY, KM_PRESS, KM_CTRL, 0);
+       WM_keymap_add_item(keymap, "MESH_OT_specials", WKEY, KM_PRESS, 0, 0);
        
        /* UV's */
        WM_keymap_add_item(keymap, "UV_OT_mapping_menu", UKEY, KM_PRESS, 0, 0);