Backspace in Brave browser Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
jazzvb
Posts: 32
Joined: 14 Jan 2019, 20:10

Backspace in Brave browser

10 Apr 2021, 11:03

Hi,

Recently I started to use the Brave browser. However, Backspace for going back a page does not work in this browser. I tried to write a script to make Backspace act like Alt+Left arrow only in Brave, but I have troubles with the 'else' input. When I know how to do this, I will try to have the Ins key work like Backspace in Brave only. The Backspace for going back a page I use far more than using it to correct text; there's always Ctrl+Z anyway.

One script I tried:

Code: Select all

BACKSPACE::
#IfWinActive, ahk_exe brave.exe
{
Send, !{Left}
}
else
{
Send, BACKSPACE
}
Return
[Mod edit: [code][/code] tags added.]

Thanks and kind regards,
jazz
User avatar
mikeyww
Posts: 26951
Joined: 09 Sep 2014, 18:38

Re: Backspace in Brave browser  Topic is solved

10 Apr 2021, 11:16

Code: Select all

#IfWinActive ahk_exe brave.exe
BackSpace::Browser_Back
#IfWinActive
Plan for perfect typing accuracy in your Web forms!
jazzvb
Posts: 32
Joined: 14 Jan 2019, 20:10

Re: Backspace in Brave browser

10 Apr 2021, 11:43

Hi mikeyww,

Wow, that looks totally different from what I had in mind (and written down). But, of course, it works perfectly! I am very happy with this script. I now managed to change the Del key into the Backspace key, only to function in Brave, too.

Concerning the comma after #IfWinActive, yes you are right, that was careless.

Thank you very much for making surfing life a lot more pleasant, mikeyww!

Kind regards,
jazz
User avatar
mikeyww
Posts: 26951
Joined: 09 Sep 2014, 18:38

Re: Backspace in Brave browser

10 Apr 2021, 11:57

You are welcome.

As I understand it, the comma is optional for directives (and in some other places, too), because directives have a maximum of one parameter, or something like that (discussion available on the forum)!
gregster
Posts: 9029
Joined: 30 Sep 2013, 06:48

Re: Backspace in Brave browser

10 Apr 2021, 12:08

But the #If...-directive should be placed above all hotkey labels that it should affect (like mikeyww showed), and not be in the hotkey subroutine!

(yes, the comma is mostly optional - although there are rare cases in which it can prevent ambiguity)
User avatar
boiler
Posts: 16965
Joined: 21 Dec 2014, 02:44

Re: Backspace in Brave browser

10 Apr 2021, 12:10

The comma is optional after all command names as well. It is required only in some special cases as described here (to prevent the ambiguity mentioned by gregster).
User avatar
mikeyww
Posts: 26951
Joined: 09 Sep 2014, 18:38

Re: Backspace in Brave browser

10 Apr 2021, 14:14

Thanks to @gregster and @boiler for the details. :)
jazzvb
Posts: 32
Joined: 14 Jan 2019, 20:10

Re: Backspace in Brave browser

10 Apr 2021, 15:41

I was doubting about putting #IF... in the second line actually; thanks for clarifying that and about the comma, all!

AHK keeps amazing me...

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bubo_Bubo and 205 guests