Page 1 of 1

Chrome hotkeys

Posted: 20 May 2022, 10:29
by usser
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!

Re: Chrome hotkeys

Posted: 20 May 2022, 23:08
by Fulminare
Can you kindly elaborate ?

Re: Chrome hotkeys

Posted: 21 May 2022, 05:20
by usser
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.

Re: Chrome hotkeys

Posted: 21 May 2022, 06:04
by boiler
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.

Re: Chrome hotkeys

Posted: 21 May 2022, 06:24
by mikeyww
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.

Re: Chrome hotkeys

Posted: 21 May 2022, 18:37
by usser
Exactly, I used to have a condition (if cursor = IBeam) but it did not work well. Wonder if there has been any progress.

Re: Chrome hotkeys

Posted: 28 May 2022, 04:16
by usser
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!

Re: Chrome hotkeys

Posted: 28 May 2022, 05:33
by BoBo
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

Re: Chrome hotkeys

Posted: 28 May 2022, 17:04
by usser
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

Re: Chrome hotkeys

Posted: 29 May 2022, 02:14
by mikeyww

Code: Select all

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

Re: Chrome hotkeys

Posted: 29 May 2022, 15:08
by usser
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

Re: Chrome hotkeys

Posted: 29 May 2022, 15:13
by mikeyww
The script matches your description. Easy to confirm: run it.