forked from bartvdbraak/blender
ed92105857
Modal keymaps. I've tried to make it as simple as possible, yet still using sufficient facilities to enable self-documenting UIs, saving/reading in files, and proper Python support. The simplicity is: the 'modal keymap' just checks an event, uses event matching similarly to other keymap matching, and if there's a match it changes the event type, and sets the event value to what the modal keymap has defined. The event values are being defined using EnumPropertyItem structs, so the UI will be able to show all options in self-documenting way. This system also allows to still handle hardcoded own events. Tech doc: 1) define keymap - Create map with unique name, WM_modalkeymap_add() - Give map property definitions (EnumPropertyItem *) This only for UI, so user can get information on available options 2) items - WM_modalkeymap_add_item(): give it an enum value for events 3) activate - In keymap definition code, assign the modal keymap to operatortype WM_modalkeymap_assign() 4) event manager - The event handler will check for modal keymap, if so: - If the modal map has a match: - Sets event->type to EVT_MODAL_MAP - Sets event->val to the enum value 5) modal handler - If event type is EVT_MODAL_MAP: - Check event->val, handle it - Other events can just be handled still Two examples added in the code: editors/transform/transform.c: transform_modal_keymap() editors/screen/screen_ops.c: keymap_modal_set() Also: to support 'key release' the define KM_RELEASE now is officially used in event manager, this is not '0', so don't check key events with the old convention if(event->val) but use if(event->val==KM_PRESS) |
||
---|---|---|
bin/.blender | ||
blenderplayer | ||
CMake | ||
config | ||
doc | ||
extern | ||
intern | ||
po | ||
projectfiles | ||
projectfiles_vc7 | ||
projectfiles_vc9 | ||
release | ||
source | ||
tools | ||
CMakeLists.txt | ||
COPYING | ||
Makefile | ||
README | ||
SConstruct |
Welcome to the fun world of open source. For instructions on building and installing Blender, please see the file named INSTALL. ---------------------.Blanguages and the .blender directory--------------------- The .blender directory holds various data files for Blender. In the 2.28a release those are the .Blanguages file containing a list of translations, the translations themselves and a default ttf font. Blender checks for the presence of this directory in several locations: - the current directory - your home directory - On OSX, the blender bundle is also checked - On Windows, the installation dir is checked. If you get a 'File ".Blanguages" not found' warning, try to copy the .blender dir to one of these locations (your home directory being recommended). -------------------------------------Links-------------------------------------- Getting Involved: http://www.blender.org/community/get-involved Community: http://www.blender.org/Community Main blender development site: http://www.blender.org The Blender project homepage: http://projects.blender.org/projects/bf-blender Documentation: http://www.blender.org/education-help Bug tracker: http://www.blender.org/development/report-a-bug Feature request tracker: http://wiki.blender.org/index.php/Requests