From f2f004af2df9733761cf9d4888e883a8c5f0d3e9 Mon Sep 17 00:00:00 2001 From: Simon Clitherow Date: Tue, 19 Oct 2004 21:29:15 +0000 Subject: [PATCH] Bug fix for #1493 - - Changed shortcut of "Align Active Camera to View" to Ctrl+Alt+Numpad0 to make it Windows-friendly. - Old shortcut of Shift-Numpad0 still works (until we find some other use for it!) Could use testing on KDE/Gnome, etc - incase we make X do somersaults or something equally daft! :P --- source/blender/src/header_view3d.c | 6 +++--- source/blender/src/toets.c | 2 +- source/blender/src/toolbox.c | 29 +++++++++++++++++------------ 3 files changed, 21 insertions(+), 16 deletions(-) diff --git a/source/blender/src/header_view3d.c b/source/blender/src/header_view3d.c index 894dd4ea868..f1ac9781230 100644 --- a/source/blender/src/header_view3d.c +++ b/source/blender/src/header_view3d.c @@ -298,9 +298,9 @@ static void do_view3d_view_alignviewmenu(void *arg, int event) /* This ugly hack is a symptom of the nasty persptoetsen function, * but at least it works for now. */ - G.qual |= LR_SHIFTKEY; + G.qual |= LR_CTRLKEY|LR_ALTKEY; persptoetsen(PAD0); - G.qual &= ~LR_SHIFTKEY; + G.qual &= ~LR_CTRLKEY|LR_ALTKEY; break; case 5: /* Align View to Selected (object mode) */ mainqenter(PADASTERKEY, 1); @@ -325,7 +325,7 @@ static uiBlock *view3d_view_alignviewmenu(void *arg_unused) uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Center View to Cursor|C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, ""); uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Center Cursor and View All|Shift C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Align Active Camera to View|Shift NumPad 0", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Align Active Camera to View|Ctrl Alt NumPad 0", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, ""); if (((G.obedit) && (G.obedit->type == OB_MESH)) || (G.f & G_FACESELECT)) { uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Align View to Selected (Top)|Shift V", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, ""); diff --git a/source/blender/src/toets.c b/source/blender/src/toets.c index 32423501630..ff8273c6d15 100644 --- a/source/blender/src/toets.c +++ b/source/blender/src/toets.c @@ -402,7 +402,7 @@ void persptoetsen(unsigned short event) if(G.vd->camera) { G.vd->persp= 2; G.vd->view= 0; - if(G.qual & LR_SHIFTKEY) { + if(((G.qual & LR_CTRLKEY) && (G.qual & LR_ALTKEY)) || (G.qual & LR_SHIFTKEY)) { void setcameratoview3d(void); // view.c setcameratoview3d(); } diff --git a/source/blender/src/toolbox.c b/source/blender/src/toolbox.c index 149fcea2df3..425b47227f7 100644 --- a/source/blender/src/toolbox.c +++ b/source/blender/src/toolbox.c @@ -1502,18 +1502,19 @@ typedef struct TBitem { static void tb_do_hotkey(void *arg, int event) { - unsigned short key=0, qual1=0, qual2=0; + unsigned short i, key=0; + unsigned short qual[] = { 0,0,0,0 }; if(event & TB_CTRL) { - qual1= LEFTCTRLKEY; + qual[0] = LEFTCTRLKEY; event &= ~TB_CTRL; } if(event & TB_ALT) { - qual1= LEFTALTKEY; + qual[1] = LEFTALTKEY; event &= ~TB_ALT; } if(event & TB_SHIFT) { - qual1= LEFTSHIFTKEY; + qual[2] = LEFTSHIFTKEY; event &= ~TB_SHIFT; } @@ -1531,16 +1532,20 @@ static void tb_do_hotkey(void *arg, int event) case 'd': key= PAGEDOWNKEY; break; } } - else asciitoraw(event, &key, &qual2); + else asciitoraw(event, &key, &qual[3]); - if(qual1) mainqenter(qual1, 1); - if(qual2) mainqenter(qual2, 1); + for (i=0;i<4;i++) + { + if(qual[i]) mainqenter(qual[i], 1); + } mainqenter(key, 1); mainqenter(key, 0); mainqenter(EXECUTE, 1); - if(qual1) mainqenter(qual1, 0); - if(qual2) mainqenter(qual2, 0); - + + for (i=0;i<4;i++) + { + if(qual[i]) mainqenter(qual[i], 0); + } } /* *************Select ********** */ @@ -1871,8 +1876,8 @@ static TBitem tb_view_dt[]= { static TBitem tb_view_alignview[]= { { 0, "Centre View to Cursor|C", 'c', NULL}, -{ 0, "Align Active Camera to View|Shift NumPad 0", -TB_SHIFT|TB_PAD|'0', NULL}, +{ 0, "Align Active Camera to View|Ctrl Alt NumPad 0", +TB_CTRL|TB_ALT|TB_PAD|'0', NULL}, { 0, "Align View to Selected|NumPad *", TB_PAD|'*', NULL}, { -1, "", 0, tb_do_hotkey}};