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
This commit is contained in:
Simon Clitherow 2004-10-19 21:29:15 +00:00
parent 29ac3db7e8
commit f2f004af2d
3 changed files with 21 additions and 16 deletions

@ -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, "");

@ -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();
}

@ -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}};