Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate

Vista Explorer - Backspace for parent folder (as in XP)


  • Please log in to reply
12 replies to this topic
sxizo
  • Guests
  • Last active:
  • Joined: --
Sorry if this has been posted before - I couldn't find it easily...

When browsing folders in Explorer, in Vista, the BackSpace key is used for going back to the last selected folder, while in previous versions of Windows it was used for going Up One Level.

I created this script for performing an Alt+Up when Backspace is pressed (this is the key combination now for going to the parent folder).

I had some trouble with the editing mode (when renaming a file for example), but I overcame it by checking the Caret position, which is always 4 when browsing...

Here is the script...

#IfWinActive, ahk_class CabinetWClass
BS::
{
 if (A_CaretX == 4)
  { 
     Send {Alt Down}{Up}{Alt Up}
  }
 else
  {
     Send {BS}
  } 
}


tagaste
  • Guests
  • Last active:
  • Joined: --
This is a great idea: the new, technically more consistent (compare IE) behavior of the backspace key in Explorer windows is one of my biggest little pet peeves about Vista (or rather, the switch to Vista). I should probably get over it but without an up-folder button too, it's just too much for my old-fashioned self.

Problem is, the Caret check doesn't work for me. A_CaretX is never 4 when I'm browsing folders. Looking more closely (via the sample script on the help page where the A_Caret variables are explained), it looks like the X value is always 168 for me, not 4.

Oh, I see: it's because you don't have a navigation pane open -- although when I close mine, I get an X value of 8.

Perhaps there are more reliable hacks? Testing for contents of Clipboard after copying?

enj0y
  • Guests
  • Last active:
  • Joined: --
Hello,

in order to make it work on my system i had to change the "if" condition to:
if (A_CaretX == 8 or A_CaretX == 493)
the 8 is required if the DirectoryTree on the left side of the explorer is focused and the 493 is used if the File/DirectoryListing on the right is focused.
Thanks a million for the Tool and Script, the "backspace" behaviour of the Vista explorer was really annoying me!

Greetings!

Gav_
  • Guests
  • Last active:
  • Joined: --
You might also be interested in QTTabBar (free), adds tabs to explorer and lets you replace the "up" folder icon.


http://quizo.at.info...re/indexEn.html

  • Guests
  • Last active:
  • Joined: --
Install QTTabBar,
Log off & on again to enable in Explorer.

In Explorer, right-click on the menu area and tick "QT Tab Bar" and "QT Tab Standard Button"

Right-Click On QTTabBar and choose Options
Goto Misc Tab
Check"XP-compatible BS Key(Vista)

Nice :)

Tabbed explorer browsing is a bonus.

hypsilon
  • Guests
  • Last active:
  • Joined: --
Thanks for the code, if you want to enable it in windows 7 the values change as follows:
#IfWinActive, ahk_class CabinetWClass
BS::
{
 if (A_CaretX == 149 or A_CaretX == 5)
  {
     Send {Alt Down}{Up}{Alt Up}
  }
 else
  {
     Send {BS}
  }
}


fragman
  • Members
  • 1591 posts
  • Last active: Nov 12 2012 08:51 PM
  • Joined: 13 Oct 2009
This will also do, it's a bit more advanced but works for me:

Backspace::
	;make sure no renaming in process and we are actually in list or in tree
	ControlGet renamestatus,Visible,,Edit1,A
	ControlGetFocus focussed, A
	if(renamestatus!=1&&(focussed="DirectUIHWND3"||focussed=SysTreeView321))
	{
    SendInput {Alt Down}{Up}{Alt Up}
    return
  }else{
		Send {Backspace}
		return
	}


noobie
  • Guests
  • Last active:
  • Joined: --
hi guys,
i liked your fix, i have the same annoyance.
could you please tell me where to put this script so it will work for all windows?

Khanbaba
  • Guests
  • Last active:
  • Joined: --
I have installed Autohotkey software. I have pasted the code into a .ahk script file. But even after that the backspace key does not seem to work like alt+up.

In the same .ahk script file, I have defined one other hotkey as well (Win+Z) to open www.gmail.com in default web browser. This hotkey (to open gmail) is working but not the previous one (to override Alt+up by baskbpace key)

Please help me to to fix it. I am using Windows 7 ultimate.

fragman
  • Members
  • 1591 posts
  • Last active: Nov 12 2012 08:51 PM
  • Joined: 13 Oct 2009
Did you try my code?
I have (similar) code that does the same and works for Win7 in the program I'm working on.

Khanbaba
  • Guests
  • Last active:
  • Joined: --
Thanks Fragman,

But I tried your code as well. It did work except for the fact the backspace key lost its function as a key to delete one character to the left when used in case of other applications in stead of Windows Explorer.

Then I tried to combine your code with the first line of that posted by "sxizo" and then it worked for me perfectly.

So the complete code that I used is below and it is working for me in windows 7:

#IfWinActive, ahk_class CabinetWClass
Backspace::
;make sure no renaming in process and we are actually in list or in tree

ControlGet renamestatus,Visible,,Edit1,A
ControlGetFocus focussed, A
if(renamestatus!=1&&(focussed="DirectUIHWND3"||focussed=SysTreeView321))
{
SendInput {Alt Down}{Up}{Alt Up}
return
}else{
Send {Backspace}
return
}

with the above code I am able to use the backspace key to explore the up folder, while at the same time to delete one character to left in case of renaming folders or in any application other than windows explorer.

Thanks you all guys.

kidmar
  • Members
  • 75 posts
  • Last active: Jun 08 2016 08:04 AM
  • Joined: 04 Oct 2007
Sorry for opening this post again, but I found an error and did some improvements to the code:

FunBackspaceExplorer()
{
	If WinActive, ahk_class CabinetWClass
	{
		ControlGetFocus focussed, A
		
		; Return true only if current control isn't an edit control
		if (NOT InStr(focussed, "Edit"))
			Return 1
	}
	
	return 0
}

#If FunBackspaceExplorer()
Backspace::
	SendInput !{Up}
#IfWinActive

The error was that SysTreeView321 was not quoted, so backspace functionality was activated only if focus was on main control.
I've moved the code that cheks if current window is correct to a funcion so that the backspace hotkey exists only if all conditions are met.
Now it simply checks if the current control isn't an edit one (Edit1 is active while renaming an item, Edit2 is active when typing the path in the bar, and maybe there are more of them so I did the InStr() thing) so that backspace functionality is enabled whatever the current cotrol is.

I've only checked this on Win7, but it should be ok in Vista too.

johnsondanielj
  • Guests
  • Last active:
  • Joined: --
+1 for Khanbaba's script on windows 7, except I had to quote "SysTreeView321":

#IfWinActive, ahk_class CabinetWClass 
Backspace:: 
;make sure no renaming in process and we are actually in list or in tree 

ControlGet renamestatus,Visible,,Edit1,A 
ControlGetFocus focussed, A 
if(renamestatus!=1&&(focussed="DirectUIHWND3"||focussed="SysTreeView321")) 
{ 
SendInput {Alt Down}{Up}{Alt Up} 
return 
}else{ 
Send {Backspace} 
return 
}