diff options
author | Ton Roosendaal <ton@blender.org> | 2012-12-29 17:21:01 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2012-12-29 17:21:01 +0400 |
commit | dfc63e98bc4b00f28b183bfde23c1c43f9fe3ae6 (patch) | |
tree | a0ca3bf746e27c6c0e606b15166fb37210155fe7 /source/blender | |
parent | 31933e747f32c8d2d5f60a523ed063d0b8e96697 (diff) |
Trackpad fixes & changes:
- UV Image editor and other 2d views didn't zoom for CTRL+swipe yet.
(2 finger trackpad, 1 finger mighty mouse)
- Switched defaults for 3D window swiping...
- default rotate view
- SHIFT for translate
- CTRL for zooms
This makes all editors use 'swipe' like 'middle mouse', and not
like scrollwheel (as in releases).
This is nice for consistancy, but it still feels a bit weird...
Of course users can config this in keymaps. We need a sensible
default though, and to make a 2D input input device behave like
middle mouse seeems more sensible than like a 1D wheel...
Proposal therefore for defaults:
- 1D scrollwheels: zoom in 3d, zoom in 2d, but scroll for list views.
- 2D trackpads: pan for all 2d views, rotate for 3D
I'll check with frequent trackpad users about this and we can freeze it
before release. Give it a try :)
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/interface/view2d_ops.c | 6 | ||||
-rw-r--r-- | source/blender/editors/space_image/image_ops.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_image/space_image.c | 1 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_ops.c | 4 |
4 files changed, 9 insertions, 4 deletions
diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c index 8bea308e90a..cc473998340 100644 --- a/source/blender/editors/interface/view2d_ops.c +++ b/source/blender/editors/interface/view2d_ops.c @@ -937,7 +937,7 @@ static int view_zoomdrag_invoke(bContext *C, wmOperator *op, wmEvent *event) vzd = op->customdata; v2d = vzd->v2d; - if (event->type == MOUSEZOOM) { + if (event->type == MOUSEZOOM || event->type == MOUSEPAN) { float dx, dy, fac; vzd->lastx = event->prevx; @@ -948,6 +948,8 @@ static int view_zoomdrag_invoke(bContext *C, wmOperator *op, wmEvent *event) */ fac = 0.01f * (event->x - event->prevx); dx = fac * BLI_rctf_size_x(&v2d->cur) / 10.0f; + if (event->type == MOUSEPAN) + fac = 0.01f * (event->y - event->prevy); dy = fac * BLI_rctf_size_y(&v2d->cur) / 10.0f; RNA_float_set(op->ptr, "deltax", dx); @@ -1903,6 +1905,7 @@ void UI_view2d_keymap(wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "VIEW2D_OT_zoom_in", WHEELINMOUSE, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "VIEW2D_OT_zoom_out", PADMINUS, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "VIEW2D_OT_zoom_in", PADPLUSKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "VIEW2D_OT_zoom", MOUSEPAN, 0, KM_CTRL, 0); WM_keymap_verify_item(keymap, "VIEW2D_OT_smoothview", TIMER1, KM_ANY, KM_ANY, 0); @@ -1951,6 +1954,7 @@ void UI_view2d_keymap(wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "VIEW2D_OT_zoom", MIDDLEMOUSE, KM_PRESS, KM_CTRL, 0); WM_keymap_add_item(keymap, "VIEW2D_OT_zoom", MOUSEZOOM, 0, 0, 0); + WM_keymap_add_item(keymap, "VIEW2D_OT_zoom", MOUSEPAN, 0, KM_CTRL, 0); WM_keymap_add_item(keymap, "VIEW2D_OT_zoom_out", PADMINUS, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "VIEW2D_OT_zoom_in", PADPLUSKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "VIEW2D_OT_reset", HOMEKEY, KM_PRESS, 0, 0); diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index 070330c2d47..f1662bc254d 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -457,7 +457,7 @@ enum { static int image_view_zoom_invoke(bContext *C, wmOperator *op, wmEvent *event) { - if (event->type == MOUSEZOOM) { + if (event->type == MOUSEZOOM || event->type == MOUSEPAN) { SpaceImage *sima = CTX_wm_space_image(C); ARegion *ar = CTX_wm_region(C); float delta, factor, location[2]; diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c index b0e9f8bcf99..9492e29734d 100644 --- a/source/blender/editors/space_image/space_image.c +++ b/source/blender/editors/space_image/space_image.c @@ -292,6 +292,7 @@ static void image_keymap(struct wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "IMAGE_OT_view_zoom_out", PADMINUS, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "IMAGE_OT_view_zoom", MIDDLEMOUSE, KM_PRESS, KM_CTRL, 0); WM_keymap_add_item(keymap, "IMAGE_OT_view_zoom", MOUSEZOOM, 0, 0, 0); + WM_keymap_add_item(keymap, "IMAGE_OT_view_zoom", MOUSEPAN, 0, KM_CTRL, 0); /* ctrl now works as well, shift + numpad works as arrow keys on Windows */ RNA_float_set(WM_keymap_add_item(keymap, "IMAGE_OT_view_zoom_ratio", PAD8, KM_PRESS, KM_CTRL, 0)->ptr, "ratio", 8.0f); diff --git a/source/blender/editors/space_view3d/view3d_ops.c b/source/blender/editors/space_view3d/view3d_ops.c index 79561ee7566..37ee778c576 100644 --- a/source/blender/editors/space_view3d/view3d_ops.c +++ b/source/blender/editors/space_view3d/view3d_ops.c @@ -250,9 +250,9 @@ void view3d_keymap(wmKeyConfig *keyconf) WM_keymap_verify_item(keymap, "VIEW3D_OT_smoothview", TIMER1, KM_ANY, KM_ANY, 0); - WM_keymap_add_item(keymap, "VIEW3D_OT_rotate", MOUSEPAN, 0, KM_ALT, 0); + WM_keymap_add_item(keymap, "VIEW3D_OT_rotate", MOUSEPAN, 0, 0, 0); WM_keymap_add_item(keymap, "VIEW3D_OT_rotate", MOUSEROTATE, 0, 0, 0); - WM_keymap_add_item(keymap, "VIEW3D_OT_move", MOUSEPAN, 0, 0, 0); + WM_keymap_add_item(keymap, "VIEW3D_OT_move", MOUSEPAN, 0, KM_SHIFT, 0); WM_keymap_add_item(keymap, "VIEW3D_OT_zoom", MOUSEZOOM, 0, 0, 0); WM_keymap_add_item(keymap, "VIEW3D_OT_zoom", MOUSEPAN, 0, KM_CTRL, 0); |