missing Del key in the keymaps where Xkey was used
[blender.git] / source / blender / editors / mesh / mesh_ops.c
1 /**
2  * $Id:
3  *
4  * ***** BEGIN GPL LICENSE BLOCK *****
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * of the License, or (at your option) any later version. 
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software Foundation,
18  * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
19  *
20  * The Original Code is Copyright (C) 2009 Blender Foundation.
21  * All rights reserved.
22  *
23  * 
24  * Contributor(s): Blender Foundation
25  *
26  * ***** END GPL LICENSE BLOCK *****
27  */
28
29 #include <stdlib.h>
30 #include <math.h>
31
32 #include "MEM_guardedalloc.h"
33
34 #include "DNA_object_types.h"
35 #include "DNA_scene_types.h"
36 #include "DNA_screen_types.h"
37 #include "DNA_space_types.h"
38 #include "DNA_userdef_types.h"
39 #include "DNA_view3d_types.h"
40 #include "DNA_windowmanager_types.h"
41
42 #include "BLI_arithb.h"
43 #include "BLI_blenlib.h"
44 #include "BLI_editVert.h"
45
46 #include "BKE_context.h"
47 #include "BKE_global.h"
48 #include "BKE_mesh.h"
49 #include "BKE_utildefines.h"
50
51 #include "RNA_access.h"
52 #include "RNA_define.h"
53
54 #include "WM_api.h"
55 #include "WM_types.h"
56
57 #include "ED_mesh.h"
58 #include "ED_screen.h"
59 #include "ED_transform.h"
60 #include "ED_view3d.h"
61
62 #include "UI_interface.h"
63
64 #include "mesh_intern.h"
65
66 /******************************** menus *************************************/
67
68 static int vertex_specials_invoke(bContext *C, wmOperator *op, wmEvent *event)
69 {
70         uiPopupMenu *pup;
71         uiLayout *layout;
72
73         pup= uiPupMenuBegin(C, "Vertex Specials", 0);
74         layout= uiPupMenuLayout(pup);
75         uiLayoutSetOperatorContext(layout, WM_OP_INVOKE_REGION_WIN);
76
77         uiItemO(layout, "Remove Doubles", 0, "MESH_OT_remove_doubles");
78         uiItemO(layout, "Merge...", 0, "MESH_OT_merge");
79         uiItemO(layout, "Smooth", 0, "MESH_OT_vertices_smooth");
80         uiItemO(layout, "Select Vertex Path", 0, "MESH_OT_select_vertex_path"); 
81         //uiItemO(layout, "Blend From Shape", 0, "MESH_OT_blend_from_shape");
82         //uiItemO(layout, "Propagate to All Shapes", 0, "MESH_OT_shape_propagate_to_all");
83
84         uiPupMenuEnd(C, pup);
85         
86         return OPERATOR_CANCELLED;
87 }
88
89 static void MESH_OT_vertex_specials(wmOperatorType *ot)
90 {
91         /* identifiers */
92         ot->name= "Vertex Specials";
93         //ot->description= "Perform special vertex operations.";
94         ot->idname= "MESH_OT_vertex_specials";
95         
96         /* api callbacks */
97         ot->invoke= vertex_specials_invoke;
98         ot->poll= ED_operator_editmesh;
99 }
100
101 static int edge_specials_invoke(bContext *C, wmOperator *op, wmEvent *event)
102 {
103         uiPopupMenu *pup;
104         uiLayout *layout;
105
106         pup= uiPupMenuBegin(C, "Edge Specials", 0);
107         layout= uiPupMenuLayout(pup);
108         uiLayoutSetOperatorContext(layout, WM_OP_INVOKE_REGION_WIN);
109
110         uiItemO(layout, "Mark Seam", 0, "MESH_OT_mark_seam");
111         uiItemBooleanO(layout, "Clear Seam", 0, "MESH_OT_mark_seam", "clear", 1);
112         uiItemEnumO(layout, "Rotate Edge CW", 0, "MESH_OT_edge_rotate", "direction", 1);
113         uiItemEnumO(layout, "Rotate Edge CCW", 0, "MESH_OT_edge_rotate", "direction", 2);
114         //uiItemO(layout, "Loopcut", 0, "MESH_OT_loop_cut"); // CutEdgeloop(em, 1);
115         //uiItemO(layout, "Edge Slide", 0, "MESH_OT_edge_slide"); // EdgeSlide(em, 0,0.0);
116         uiItemO(layout, "Edge Slide", 0, "TFM_OT_edge_slide");
117         uiItemO(layout, "Edge Loop", 0, "MESH_OT_loop_multi_select");
118         uiItemBooleanO(layout, "Edge Ring", 0, "MESH_OT_loop_multi_select", "ring", 1);
119         uiItemO(layout, NULL, 0, "MESH_OT_loop_to_region");
120         uiItemO(layout, NULL, 0, "MESH_OT_region_to_loop");
121         uiItemO(layout, "Mark Sharp", 0, "MESH_OT_mark_sharp");
122         uiItemBooleanO(layout, "Clear Sharp", 0, "MESH_OT_mark_sharp", "clear", 1);
123
124         uiPupMenuEnd(C, pup);
125
126         return OPERATOR_CANCELLED;
127 }
128
129 static void MESH_OT_edge_specials(wmOperatorType *ot)
130 {
131         /* identifiers */
132         ot->name= "Edge Specials";
133         //ot->description= "Perform special edge operations.";
134         ot->idname= "MESH_OT_edge_specials";
135         
136         /* api callbacks */
137         ot->invoke= edge_specials_invoke;
138         ot->poll= ED_operator_editmesh;
139 }
140
141 static int face_specials_invoke(bContext *C, wmOperator *op, wmEvent *event)
142 {
143         uiPopupMenu *pup;
144         uiLayout *layout;
145
146         pup= uiPupMenuBegin(C, "Face Specials", 0);
147         layout= uiPupMenuLayout(pup);
148         uiLayoutSetOperatorContext(layout, WM_OP_INVOKE_REGION_WIN);
149
150         uiItemO(layout, NULL, 0, "MESH_OT_flip_normals");
151         // uiItemO(layout, "Bevel", 0, "MESH_OT_bevel"); // bevelmenu(em)
152         uiItemO(layout, NULL, 0, "MESH_OT_faces_shade_smooth");
153         uiItemO(layout, NULL, 0, "MESH_OT_faces_shade_flat");
154         uiItemO(layout, NULL, 0, "MESH_OT_quads_convert_to_tris");
155         uiItemO(layout, NULL, 0, "MESH_OT_tris_convert_to_quads");
156         uiItemO(layout, NULL, 0, "MESH_OT_edge_flip");
157
158         uiItemS(layout);
159
160         uiItemO(layout, NULL, 0, "MESH_OT_fill");
161         uiItemO(layout, NULL, 0, "MESH_OT_beauty_fill");
162
163         uiItemS(layout);
164
165         // uiItemO(layout, NULL, 0, "MESH_OT_face_mode"); // mesh_set_face_flags(em, 1);
166         // uiItemBooleanO(layout, NULL, 0, "MESH_OT_face_mode", "clear", 1); // mesh_set_face_flags(em, 0);
167         //
168         // uiItemS(layout);
169
170         uiItemMenuEnumO(layout, NULL, 0, "MESH_OT_uvs_rotate", "direction");
171         uiItemMenuEnumO(layout, NULL, 0, "MESH_OT_uvs_mirror", "axis");
172         uiItemMenuEnumO(layout, NULL, 0, "MESH_OT_colors_rotate", "direction");
173         uiItemMenuEnumO(layout, NULL, 0, "MESH_OT_colors_mirror", "axis");
174
175         uiPupMenuEnd(C, pup);
176         
177         return OPERATOR_CANCELLED;
178 }
179
180 static void MESH_OT_face_specials(wmOperatorType *ot)
181 {
182         /* identifiers */
183         ot->name= "Face Specials";
184         //ot->description= "Perform special face operations.";
185         ot->idname= "MESH_OT_face_specials";
186         
187         /* api callbacks */
188         ot->invoke= face_specials_invoke;
189         ot->poll= ED_operator_editmesh;
190 }
191
192 static int specials_invoke(bContext *C, wmOperator *op, wmEvent *event)
193 {
194         uiPopupMenu *pup;
195         uiLayout *layout;
196
197         pup= uiPupMenuBegin(C, "Specials", 0);
198         layout= uiPupMenuLayout(pup);
199         uiLayoutSetOperatorContext(layout, WM_OP_INVOKE_REGION_WIN);
200
201         uiItemO(layout, "Subdivide", 0, "MESH_OT_subdivide");
202         uiItemFloatO(layout, "Subdivide Smooth", 0, "MESH_OT_subdivide", "smoothness", 1.0f);
203         uiItemO(layout, "Merge...", 0, "MESH_OT_merge");
204         uiItemO(layout, "Remove Doubles", 0, "MESH_OT_remove_doubles");
205         uiItemO(layout, "Hide", 0, "MESH_OT_hide");
206         uiItemO(layout, "Reveal", 0, "MESH_OT_reveal");
207         uiItemO(layout, "Select Inverse", 0, "MESH_OT_select_inverse");
208         uiItemO(layout, NULL, 0, "MESH_OT_flip_normals");
209         uiItemO(layout, "Smooth", 0, "MESH_OT_vertices_smooth");
210         // uiItemO(layout, "Bevel", 0, "MESH_OT_bevel"); // bevelmenu(em)
211         uiItemO(layout, NULL, 0, "MESH_OT_faces_shade_smooth");
212         uiItemO(layout, NULL, 0, "MESH_OT_faces_shade_flat");
213         //uiItemO(layout, "Blend From Shape", 0, "MESH_OT_blend_from_shape");
214         //uiItemO(layout, "Propagate to All Shapes", 0, "MESH_OT_shape_propagate_to_all");
215         uiItemO(layout, "Select Vertex Path", 0, "MESH_OT_select_vertex_path"); 
216         
217         uiPupMenuEnd(C, pup);
218         
219         return OPERATOR_CANCELLED;
220 }
221
222 static void MESH_OT_specials(wmOperatorType *ot)
223 {
224         /* identifiers */
225         ot->name= "Specials";
226         //ot->description= "Perform special vertice, edge or face operations.";
227         ot->idname= "MESH_OT_specials";
228         
229         /* api callbacks */
230         ot->invoke= specials_invoke;
231         ot->poll= ED_operator_editmesh;
232 }
233
234 /**************************** registration **********************************/
235
236 void ED_operatortypes_mesh(void)
237 {
238         wmOperatorType *ot;
239         
240         WM_operatortype_append(MESH_OT_select_all_toggle);
241         WM_operatortype_append(MESH_OT_select_more);
242         WM_operatortype_append(MESH_OT_select_less);
243         WM_operatortype_append(MESH_OT_select_inverse);
244         WM_operatortype_append(MESH_OT_select_non_manifold);
245         WM_operatortype_append(MESH_OT_select_linked);
246         WM_operatortype_append(MESH_OT_select_linked_pick);
247         WM_operatortype_append(MESH_OT_select_random);
248         WM_operatortype_append(MESH_OT_selection_type);
249         WM_operatortype_append(MESH_OT_hide);
250         WM_operatortype_append(MESH_OT_reveal);
251         WM_operatortype_append(MESH_OT_select_by_number_vertices);
252         WM_operatortype_append(MESH_OT_normals_make_consistent);
253         WM_operatortype_append(MESH_OT_merge);
254         WM_operatortype_append(MESH_OT_subdivide);
255         WM_operatortype_append(MESH_OT_faces_select_linked_flat);
256         WM_operatortype_append(MESH_OT_edges_select_sharp);
257         WM_operatortype_append(MESH_OT_primitive_plane_add);
258         WM_operatortype_append(MESH_OT_primitive_cube_add);
259         WM_operatortype_append(MESH_OT_primitive_circle_add);
260         WM_operatortype_append(MESH_OT_primitive_cylinder_add);
261         WM_operatortype_append(MESH_OT_primitive_tube_add);
262         WM_operatortype_append(MESH_OT_primitive_cone_add);
263         WM_operatortype_append(MESH_OT_primitive_grid_add);
264         WM_operatortype_append(MESH_OT_primitive_monkey_add);
265         WM_operatortype_append(MESH_OT_primitive_uv_sphere_add);
266         WM_operatortype_append(MESH_OT_primitive_ico_sphere_add);
267         WM_operatortype_append(MESH_OT_fgon_clear);
268         WM_operatortype_append(MESH_OT_fgon_make);
269         WM_operatortype_append(MESH_OT_duplicate);
270         WM_operatortype_append(MESH_OT_remove_doubles);
271         WM_operatortype_append(MESH_OT_extrude);
272         WM_operatortype_append(MESH_OT_spin);
273         WM_operatortype_append(MESH_OT_screw);
274         
275         WM_operatortype_append(MESH_OT_vertices_transform_to_sphere);
276         WM_operatortype_append(MESH_OT_split);
277         WM_operatortype_append(MESH_OT_extrude_repeat);
278         WM_operatortype_append(MESH_OT_edge_rotate);
279         WM_operatortype_append(MESH_OT_select_vertex_path);
280         WM_operatortype_append(MESH_OT_loop_to_region);
281         WM_operatortype_append(MESH_OT_region_to_loop);
282         
283         WM_operatortype_append(MESH_OT_uvs_rotate);
284         WM_operatortype_append(MESH_OT_uvs_mirror);
285         WM_operatortype_append(MESH_OT_colors_rotate);
286         WM_operatortype_append(MESH_OT_colors_mirror);
287         
288         WM_operatortype_append(MESH_OT_fill);
289         WM_operatortype_append(MESH_OT_beauty_fill);
290         WM_operatortype_append(MESH_OT_quads_convert_to_tris);
291         WM_operatortype_append(MESH_OT_tris_convert_to_quads);
292         WM_operatortype_append(MESH_OT_edge_flip);
293         WM_operatortype_append(MESH_OT_faces_shade_smooth);
294         WM_operatortype_append(MESH_OT_faces_shade_flat);
295
296         WM_operatortype_append(MESH_OT_delete);
297
298         WM_operatortype_append(MESH_OT_separate);
299         WM_operatortype_append(MESH_OT_dupli_extrude_cursor);
300         WM_operatortype_append(MESH_OT_loop_select);
301         WM_operatortype_append(MESH_OT_edge_face_add);
302         WM_operatortype_append(MESH_OT_select_shortest_path);
303         WM_operatortype_append(MESH_OT_select_similar);
304         WM_operatortype_append(MESH_OT_loop_multi_select);
305         WM_operatortype_append(MESH_OT_mark_seam);
306         WM_operatortype_append(MESH_OT_mark_sharp);
307         WM_operatortype_append(MESH_OT_vertices_smooth);
308         WM_operatortype_append(MESH_OT_flip_normals);
309         WM_operatortype_append(MESH_OT_knife_cut);
310         WM_operatortype_append(MESH_OT_rip);
311         
312         WM_operatortype_append(MESH_OT_uv_texture_add);
313         WM_operatortype_append(MESH_OT_uv_texture_remove);
314         WM_operatortype_append(MESH_OT_vertex_color_add);
315         WM_operatortype_append(MESH_OT_vertex_color_remove);
316         WM_operatortype_append(MESH_OT_sticky_add);
317         WM_operatortype_append(MESH_OT_sticky_remove);
318
319         WM_operatortype_append(MESH_OT_vertex_specials);
320         WM_operatortype_append(MESH_OT_edge_specials);
321         WM_operatortype_append(MESH_OT_face_specials);
322         WM_operatortype_append(MESH_OT_specials);
323         
324         WM_operatortype_append(MESH_OT_edgering_select);
325         WM_operatortype_append(MESH_OT_loopcut);
326
327         /* macros */
328
329         /*combining operators with invoke and exec portions doesn't work yet.
330         
331         ot= WM_operatortype_append_macro("MESH_OT_loopcut", "Loopcut", OPTYPE_UNDO|OPTYPE_REGISTER);
332         WM_operatortype_macro_define(ot, "MESH_OT_edgering_select");
333         WM_operatortype_macro_define(ot, "MESH_OT_subdivide");
334         */
335
336         ot= WM_operatortype_append_macro("MESH_OT_duplicate_move", "Add Duplicate", OPTYPE_UNDO|OPTYPE_REGISTER);
337         WM_operatortype_macro_define(ot, "MESH_OT_duplicate");
338         WM_operatortype_macro_define(ot, "TFM_OT_translate");
339
340         ot= WM_operatortype_append_macro("MESH_OT_rip_move", "Rip", OPTYPE_UNDO|OPTYPE_REGISTER);
341         WM_operatortype_macro_define(ot, "MESH_OT_rip");
342         WM_operatortype_macro_define(ot, "TFM_OT_translate");
343
344         ot= WM_operatortype_append_macro("MESH_OT_extrude_move", "Extrude", OPTYPE_UNDO|OPTYPE_REGISTER);
345         WM_operatortype_macro_define(ot, "MESH_OT_extrude");
346         WM_operatortype_macro_define(ot, "TFM_OT_translate");
347
348 }
349
350 /* note mesh keymap also for other space? */
351 void ED_keymap_mesh(wmWindowManager *wm)
352 {       
353         wmKeyMap *keymap;
354         wmKeymapItem *kmi;
355         
356         keymap= WM_keymap_find(wm, "EditMesh", 0, 0);
357         keymap->poll= ED_operator_editmesh;
358         
359         WM_keymap_add_item(keymap, "MESH_OT_loopcut", RKEY, KM_PRESS, KM_CTRL, 0);
360
361         /* selecting */
362         /* standard mouse selection goes via space_view3d */
363         WM_keymap_add_item(keymap, "MESH_OT_loop_select", SELECTMOUSE, KM_PRESS, KM_ALT, 0);
364         kmi= WM_keymap_add_item(keymap, "MESH_OT_loop_select", SELECTMOUSE, KM_PRESS, KM_SHIFT|KM_ALT, 0);
365         RNA_boolean_set(kmi->ptr, "extend", 1);
366
367         kmi= WM_keymap_add_item(keymap, "MESH_OT_edgering_select", SELECTMOUSE, KM_PRESS, KM_ALT|KM_CTRL, 0);
368         kmi= WM_keymap_add_item(keymap, "MESH_OT_edgering_select", SELECTMOUSE, KM_PRESS, KM_SHIFT|KM_ALT|KM_CTRL, 0);
369         RNA_boolean_set(kmi->ptr, "extend", 1);
370
371         WM_keymap_add_item(keymap, "MESH_OT_select_shortest_path", SELECTMOUSE, KM_PRESS, KM_CTRL, 0);
372
373         WM_keymap_add_item(keymap, "MESH_OT_select_all_toggle", AKEY, KM_PRESS, 0, 0);
374         WM_keymap_add_item(keymap, "MESH_OT_select_more", PADPLUSKEY, KM_PRESS, KM_CTRL, 0);
375         WM_keymap_add_item(keymap, "MESH_OT_select_less", PADMINUS, KM_PRESS, KM_CTRL, 0);
376         WM_keymap_add_item(keymap, "MESH_OT_select_inverse", IKEY, KM_PRESS, KM_CTRL, 0);
377         WM_keymap_add_item(keymap, "MESH_OT_select_non_manifold", MKEY, KM_PRESS, (KM_CTRL|KM_SHIFT|KM_ALT), 0);
378         
379         WM_keymap_add_item(keymap, "MESH_OT_select_linked", LKEY, KM_PRESS, KM_CTRL, 0);
380         WM_keymap_add_item(keymap, "MESH_OT_select_linked_pick", LKEY, KM_PRESS, 0, 0);
381         RNA_boolean_set(WM_keymap_add_item(keymap, "MESH_OT_select_linked_pick", LKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "deselect", 1);
382         
383         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);
384         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);
385         
386         WM_keymap_add_item(keymap, "MESH_OT_vertices_transform_to_sphere", SKEY, KM_PRESS, KM_CTRL|KM_SHIFT , 0);
387
388         WM_keymap_add_item(keymap, "MESH_OT_select_similar", GKEY, KM_PRESS, KM_SHIFT, 0);
389         
390         /* selection mode */
391         WM_keymap_add_item(keymap, "MESH_OT_selection_type", TABKEY, KM_PRESS, KM_CTRL, 0);
392         
393         /* hide */
394         WM_keymap_add_item(keymap, "MESH_OT_hide", HKEY, KM_PRESS, 0, 0);
395         RNA_boolean_set(WM_keymap_add_item(keymap, "MESH_OT_hide", HKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "unselected", 1);
396         WM_keymap_add_item(keymap, "MESH_OT_reveal", HKEY, KM_PRESS, KM_ALT, 0);
397         
398         /* tools */
399         WM_keymap_add_item(keymap, "MESH_OT_normals_make_consistent", NKEY, KM_PRESS, KM_CTRL, 0);
400         RNA_boolean_set(WM_keymap_add_item(keymap, "MESH_OT_normals_make_consistent", NKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0)->ptr, "inside", 1);
401         
402         WM_keymap_add_item(keymap, "MESH_OT_extrude_move", EKEY, KM_PRESS, 0, 0);
403         
404         WM_keymap_add_item(keymap, "MESH_OT_spin", RKEY, KM_PRESS, KM_ALT, 0);
405         WM_keymap_add_item(keymap, "MESH_OT_screw", NINEKEY, KM_PRESS, KM_CTRL, 0);
406         
407         WM_keymap_add_item(keymap, "MESH_OT_fill", FKEY, KM_PRESS, KM_SHIFT, 0);
408         WM_keymap_add_item(keymap, "MESH_OT_beauty_fill", FKEY, KM_PRESS, KM_ALT, 0);
409         WM_keymap_add_item(keymap, "MESH_OT_quads_convert_to_tris", TKEY, KM_PRESS, KM_CTRL, 0);
410         WM_keymap_add_item(keymap, "MESH_OT_tris_convert_to_quads", JKEY, KM_PRESS, KM_ALT, 0);
411         WM_keymap_add_item(keymap, "MESH_OT_edge_flip", FKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0);
412         
413         WM_keymap_add_item(keymap, "MESH_OT_split", FOURKEY, KM_PRESS, KM_CTRL, 0);
414         WM_keymap_add_item(keymap, "MESH_OT_extrude_repeat", FOURKEY, KM_PRESS, KM_ALT, 0);
415         WM_keymap_add_item(keymap, "MESH_OT_edge_rotate", FIVEKEY, KM_PRESS, KM_CTRL, 0);
416         
417         WM_keymap_add_item(keymap, "MESH_OT_loop_to_region",SIXKEY, KM_PRESS, KM_CTRL, 0);
418         WM_keymap_add_item(keymap, "MESH_OT_region_to_loop",SIXKEY, KM_PRESS, KM_ALT, 0);
419         
420         WM_keymap_add_item(keymap, "MESH_OT_uvs_rotate",SEVENKEY, KM_PRESS, KM_CTRL, 0);
421         WM_keymap_add_item(keymap, "MESH_OT_uvs_mirror",SEVENKEY, KM_PRESS, KM_ALT, 0);
422         WM_keymap_add_item(keymap, "MESH_OT_colors_rotate",EIGHTKEY, KM_PRESS, KM_CTRL, 0);
423         WM_keymap_add_item(keymap, "MESH_OT_colors_mirror",EIGHTKEY, KM_PRESS, KM_ALT, 0);
424
425         WM_keymap_add_item(keymap, "MESH_OT_rip_move",VKEY, KM_PRESS, 0, 0);
426         WM_keymap_add_item(keymap, "MESH_OT_merge", MKEY, KM_PRESS, KM_ALT, 0);
427
428         /* add/remove */
429         WM_keymap_add_item(keymap, "MESH_OT_edge_face_add", FKEY, KM_PRESS, 0, 0);
430         WM_keymap_add_item(keymap, "MESH_OT_duplicate_move", DKEY, KM_PRESS, KM_SHIFT, 0);
431         WM_keymap_add_item(keymap, "OBJECT_OT_mesh_add", AKEY, KM_PRESS, KM_SHIFT, 0);
432         WM_keymap_add_item(keymap, "MESH_OT_separate", PKEY, KM_PRESS, 0, 0);
433                                                 /* use KM_RELEASE because same key is used for tweaks */
434         WM_keymap_add_item(keymap, "MESH_OT_dupli_extrude_cursor", LEFTMOUSE, KM_RELEASE, KM_CTRL, 0);
435         
436         WM_keymap_add_item(keymap, "MESH_OT_delete", XKEY, KM_PRESS, 0, 0);
437         WM_keymap_add_item(keymap, "MESH_OT_delete", DELKEY, KM_PRESS, 0, 0);
438         
439         WM_keymap_add_item(keymap, "MESH_OT_fgon_make", FKEY, KM_PRESS, KM_ALT, 0);
440         WM_keymap_add_item(keymap, "MESH_OT_fgon_clear", FKEY, KM_PRESS, KM_SHIFT|KM_ALT, 0);
441         
442         WM_keymap_add_item(keymap, "MESH_OT_knife_cut", LEFTMOUSE, KM_PRESS, 0, KKEY);
443
444         /* menus */
445         WM_keymap_add_item(keymap, "MESH_OT_vertex_specials", VKEY, KM_PRESS, KM_CTRL, 0);
446         WM_keymap_add_item(keymap, "MESH_OT_edge_specials", EKEY, KM_PRESS, KM_CTRL, 0);
447         WM_keymap_add_item(keymap, "MESH_OT_face_specials", FKEY, KM_PRESS, KM_CTRL, 0);
448         WM_keymap_add_item(keymap, "MESH_OT_specials", WKEY, KM_PRESS, 0, 0);
449         
450         /* UV's */
451         WM_keymap_add_item(keymap, "UV_OT_mapping_menu", UKEY, KM_PRESS, 0, 0);
452 }
453