diff options
author | Ton Roosendaal <ton@blender.org> | 2009-08-16 22:25:22 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2009-08-16 22:25:22 +0400 |
commit | d5c990664e421567f45df7c6148cc5786aa2dbd7 (patch) | |
tree | 7dd06ccb7e43939ee678d077a45e669050d079d9 /source/blender/editors/space_outliner | |
parent | 84758d0eb290ad1369899707fc943f85fba74200 (diff) |
2.5
Another keymap goodie for test fun: Tweak events allow to be limited
to a direction, like North, South-West, etc.
Tested with View3D keymap for border, circle & lasso. Issue to look at
still is whether a border should start immediate, or first draw a cross...
this can be an operator property of course.
Note that tweak code can be extended to corner-gestures too (so you can
do a north+east, north+west, and so on... nice for later).
Time to get keymap saving work! :)
(Fixed bug in Mesh edit circle select, missing notifier)
Diffstat (limited to 'source/blender/editors/space_outliner')
-rw-r--r-- | source/blender/editors/space_outliner/outliner.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/source/blender/editors/space_outliner/outliner.c b/source/blender/editors/space_outliner/outliner.c index e676b429687..ac47c518c46 100644 --- a/source/blender/editors/space_outliner/outliner.c +++ b/source/blender/editors/space_outliner/outliner.c @@ -5081,6 +5081,28 @@ static char *keymap_tweak_menu(void) return string; } +static char *keymap_tweak_dir_menu(void) +{ + static char string[500]; + static char formatstr[] = "|%s %%x%d"; + char *str= string; + + str += sprintf(str, "Tweak Direction %%t"); + + str += sprintf(str, formatstr, "Any", KM_ANY); + str += sprintf(str, formatstr, "North", EVT_GESTURE_N); + str += sprintf(str, formatstr, "North-East", EVT_GESTURE_NE); + str += sprintf(str, formatstr, "East", EVT_GESTURE_E); + str += sprintf(str, formatstr, "Sout-East", EVT_GESTURE_SE); + str += sprintf(str, formatstr, "South", EVT_GESTURE_S); + str += sprintf(str, formatstr, "South-West", EVT_GESTURE_SW); + str += sprintf(str, formatstr, "West", EVT_GESTURE_W); + str += sprintf(str, formatstr, "North-West", EVT_GESTURE_NW); + + return string; +} + + static void keymap_type_cb(bContext *C, void *kmi_v, void *unused_v) { wmKeymapItem *kmi= kmi_v; @@ -5158,6 +5180,9 @@ static void outliner_draw_keymapbuts(uiBlock *block, ARegion *ar, SpaceOops *soo str= keymap_tweak_menu(); uiDefButS(block, MENU, 0, str, xstart, (int)te->ys+1, butw2, OL_H-1, &kmi->type, 0, 0, 0, 0, "Tweak gesture"); xstart+= butw2+5; + str= keymap_tweak_dir_menu(); + uiDefButS(block, MENU, 0, str, xstart, (int)te->ys+1, butw2, OL_H-1, &kmi->val, 0, 0, 0, 0, "Tweak gesture direction"); + xstart+= butw2+5; break; } |