Chrome hotkeys

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
usser
Posts: 137
Joined: 22 Oct 2014, 13:03

Chrome hotkeys

Post by usser » 20 May 2022, 10:29

Hello

Is there a template to assign Chrome specific hotkeys that will or will not work when the cursor is inside a web form element?

Thanks!

Fulminare
Posts: 369
Joined: 26 Jun 2021, 20:15

Re: Chrome hotkeys

Post by Fulminare » 20 May 2022, 23:08

Can you kindly elaborate ?

usser
Posts: 137
Joined: 22 Oct 2014, 13:03

Re: Chrome hotkeys

Post by usser » 21 May 2022, 05:20

Hi! I just need the 'sample' code to achieve the above, i.e. Chrome only hotkeys that either do or don't work when the cursor is inside a web form.
Does anyone have done something like it or can quickly paste it? I had trouble doing it in the past and not sure if any AHK improvement has resolved it.

User avatar
boiler
Posts: 16767
Joined: 21 Dec 2014, 02:44

Re: Chrome hotkeys

Post by boiler » 21 May 2022, 06:04

You’re probably not getting any suggestions (yet?) because there isn’t a repeatable/reliable way to determine that the cursor is in a web form. The html code producing input field elements varies so much from site to site, page to page, that there is no one method that would cover all cases as far as I know. Then determining that the cursor is in such an element is another step beyond even identifying that a page has one.

User avatar
mikeyww
Posts: 26592
Joined: 09 Sep 2014, 18:38

Re: Chrome hotkeys

Post by mikeyww » 21 May 2022, 06:24

I agree. There are previous posts about exactly this topic. Some might have useful ideas or workarounds. One idea used previously was to detect a change in the cursor type. I don't think it's fully reliable.

usser
Posts: 137
Joined: 22 Oct 2014, 13:03

Re: Chrome hotkeys

Post by usser » 21 May 2022, 18:37

Exactly, I used to have a condition (if cursor = IBeam) but it did not work well. Wonder if there has been any progress.

usser
Posts: 137
Joined: 22 Oct 2014, 13:03

Re: Chrome hotkeys

Post by usser » 28 May 2022, 04:16

Can anyone post the code for hotkeys when Chrome is active please? I used to have some but it's been a long time and not sure if there are better ways. You can use a placeholder for the Chrome window ID etc, I just need to know the structure of the script, thanks!

BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: Chrome hotkeys

Post by BoBo » 28 May 2022, 05:33

You could have a try identifying that webpages elements and its paths/ID's ie via a text that is specific/unique.

Keyword: AccViewer.ahk / JEE_AccGetTextAll
viewtopic.php?t=40590

usser
Posts: 137
Joined: 22 Oct 2014, 13:03

Re: Chrome hotkeys

Post by usser » 28 May 2022, 17:04

Thanks, I can dive into this a bit later but for now I just need a sample template code to get going by simply clicking RCTRL to send F5 :D
What should I paste into the ahk file? :D

User avatar
mikeyww
Posts: 26592
Joined: 09 Sep 2014, 18:38

Re: Chrome hotkeys

Post by mikeyww » 29 May 2022, 02:14

Code: Select all

#IfWinActive ahk_exe chrome.exe
RCtrl::Send {F5}
#IfWinActive

usser
Posts: 137
Joined: 22 Oct 2014, 13:03

Re: Chrome hotkeys

Post by usser » 29 May 2022, 15:08

Thanks! but it's not the full code right? :D
I remember there were some env parameters at the top and also need it to be permanently loaded, do you happen to have the complete code at hand? :D
Sorry it's been so long since my last interaction with AHK and I have lost all clues :D

User avatar
mikeyww
Posts: 26592
Joined: 09 Sep 2014, 18:38

Re: Chrome hotkeys

Post by mikeyww » 29 May 2022, 15:13

The script matches your description. Easy to confirm: run it.

Post Reply

Return to “Ask for Help (v1)”