AutoHotkey Community

It is currently May 25th, 2012, 7:53 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 13 posts ] 
Author Message
PostPosted: October 8th, 2007, 7:25 pm 
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...

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


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 12th, 2007, 1:04 am 
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?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 19th, 2007, 10:51 am 
Hello,

in order to make it work on my system i had to change the "if" condition to:
Code:
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!


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 2nd, 2007, 2:41 pm 
You might also be interested in QTTabBar (free), adds tabs to explorer and lets you replace the "up" folder icon.


http://quizo.at.infoseek.co.jp/freeware/indexEn.html


Report this post
Top
  
Reply with quote  
PostPosted: September 18th, 2009, 3:55 pm 
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.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 18th, 2009, 3:56 pm 
Thanks for the code, if you want to enable it in windows 7 the values change as follows:
Code:
#IfWinActive, ahk_class CabinetWClass
BS::
{
 if (A_CaretX == 149 or A_CaretX == 5)
  {
     Send {Alt Down}{Up}{Alt Up}
  }
 else
  {
     Send {BS}
  }
}


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 19th, 2009, 7:35 pm 
Offline

Joined: October 13th, 2009, 10:09 pm
Posts: 1388
This will also do, it's a bit more advanced but works for me:

Code:
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
   }


Report this post
Top
 Profile  
Reply with quote  
 Post subject: where to put this code
PostPosted: November 19th, 2009, 11:42 pm 
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?


Report this post
Top
  
Reply with quote  
PostPosted: February 23rd, 2010, 12:57 pm 
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.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 23rd, 2010, 11:45 pm 
Offline

Joined: October 13th, 2009, 10:09 pm
Posts: 1388
Did you try my code?
I have (similar) code that does the same and works for Win7 in the program I'm working on.


Report this post
Top
 Profile  
Reply with quote  
PostPosted: February 24th, 2010, 1:54 am 
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.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: May 22nd, 2011, 7:48 pm 
Offline

Joined: October 4th, 2007, 1:25 pm
Posts: 70
Sorry for opening this post again, but I found an error and did some improvements to the code:

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.


Report this post
Top
 Profile  
Reply with quote  
PostPosted: June 7th, 2011, 6:26 pm 
+1 for Khanbaba's script on windows 7, except I had to quote "SysTreeView321":

Code:
#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
}


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Google Feedfetcher, Relayer and 4 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group