Dev:Source/UI/Default .Bkeymap file

提供: wiki
< Dev:Source‎ | UIBlenderDev/DefaultBkeymapから転送)
移動先: 案内検索

Introduction

Here I want to collect ALL internal commands used in blender. Main reference page is [1] (down the page).

Modality

Please remember that blender is a modal editor, and each of modes may have different keybindings. We will declare modes by mode rule. A mode can be any blender command that returns a value. If a certain keybinding is the same in several modes it has to be declared separately for each mode. Like:

omap g grab_selection
emap g grab_selection

The only exception is true which maps a keyboard shortcut to all modes.

Remember - if definition of a keyboard shortcut is declared more than once, then the last definition is used - that is because file .Bkeymap is parsed from top to bottom.

We can map keybindigs to more specific situations by using a comma separated list:

emap,3win g grab_selection

Both of those conditions must be true: current mode must be an edit mode, and current window must be a 3d window.

The .Bkeymap file:

In fact our job is to take all commands from [2] correctly write mapping rules for them, and invent (declare) a blender command for them.


#
# start by declaring modes:
# - is that mode active?
#
mode       omap           object_mode
mode       emap           edit_mode 
mode       fmap           uv_face_select_mode 
mode       vmap           vertex_paint_mode 
mode       tmap           texture_paint_mode 
mode       pmap           pose_mode 
mode       alias          command_line_mode 

#
# - is that window active?
#
mode       3win           3d_view_window 
mode       Iwin           ipo_curve_editor_window 
mode       awin           action_editor_window 
mode       nwin           nla_editor_window 
mode       uwin           uv_image_editor_window 
mode       swin           video_sequence_window 
mode       Awin           audio_timeline_editor_window 
mode       twin           text_editor_window 
mode       pwin           user_preferences_window 
mode       owin           object_oriented_window
mode       bwin           buttons_window 
mode       iwin           image_browser_window 
mode       fwin           file_browser_window 
mode       Swin           scripts_window 
mode       rwin           render_menu_window 

#
# now declare keyboard shortcuts
# everything from http://www.blender.org/modules/documentation/htmlII/
# must be put here....
#

true       F1             load_file 
true       shift-F1       append_file
true       F2             save_file
true       shift-F2       save_dxf
true       F3             save_render
...       
nmap       tab            enter_edit_mode
nmap       f              enter_face_mode # face select display on 
nmap       g              grab_selection 
...       
emap       tab            leave_edit_mode
emap       g              grab_selection
...       
fmap       tab            enter_face_edit_mode
. 
. 
. 
true       shift-S        popup_snap_menu= 
. 
. 
. 

#
# now add some aliases
#

alias      m              grab_selection


-- JanekKozicki - 29 May 2004