Cancel the action of a key

Get help with using AutoHotkey and its commands and hotkeys
oliv615
Posts: 6
Joined: 14 Apr 2017, 11:53

Cancel the action of a key

14 Apr 2017, 12:06

Hello,

I have a mini keyboard Rii i25 (http://www.riitek.com/product/i25.html)
The "Browser_Home" key opens my browser and i don't want that.

If I do the code below I get a popup but after the browser opens anyway.

Code: [Select all] [Download] GeSHi © Codebox Plus

Browser_Home::
MsgBox, %A_ThisHotKey% was pressed.
return


How to make the browser does not open?

Ideally, I want to replace this key by "escape" without opening the browser afterwards

Thank you for your help.
Darayavahus
Posts: 34
Joined: 21 May 2016, 03:32
Google: Dariusz Szcześniak

Re: Cancel the action of a key

15 Apr 2017, 01:39

Ummm... :) Try:

Browser_Home::
Sleep, 500
Return
oliv615
Posts: 6
Joined: 14 Apr 2017, 11:53

Re: Cancel the action of a key

15 Apr 2017, 11:26

Thank you for your help.
This did not work and the browser still opens. Can my remote send 2 instructions at the same time?
oliv615
Posts: 6
Joined: 14 Apr 2017, 11:53

Re: Cancel the action of a key

15 Apr 2017, 11:26

Thank you for your help.
This did not work and the browser still opens. Can my remote send 2 instructions at the same time?
snowmind
Posts: 71
Joined: 12 Nov 2015, 15:18

Re: Cancel the action of a key

15 Apr 2017, 12:21

oliv615 wrote:Thank you for your help.
This did not work and the browser still opens. Can my remote send 2 instructions at the same time?



I believe the browser loads due to an internal hardware command. Why dont you try to take some action and close the browser?. Something like this

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

oliv615
Posts: 6
Joined: 14 Apr 2017, 11:53

Re: Cancel the action of a key

15 Apr 2017, 12:48

Thank You.
If a browser is open it is closed but another is opened just after.
You must be right for the hardware command.
oliv615
Posts: 6
Joined: 14 Apr 2017, 11:53

Re: Cancel the action of a key

18 Apr 2017, 06:06

So it seems that the browser is activated due to an internal hardware command. Does anyone know how to disable this?
MaxAstro
Posts: 279
Joined: 05 Oct 2016, 13:00

Re: Cancel the action of a key

18 Apr 2017, 09:28

This should cause the key to at least close the window it opens:

Code: [Select all] [Download] GeSHi © Codebox Plus

Browser_Home::
WinWaitActive, ahk_exe iexplore.exe, , 5
if (!ErrorLevel)
WinClose
; Anything else you want the hotkey to do goes here
return

Unfortunately this is a fairly hacky solution; it sounds like the button operates at a level that AHK can't really interact with directly.
oliv615
Posts: 6
Joined: 14 Apr 2017, 11:53

Re: Cancel the action of a key

21 Apr 2017, 02:58

ok ! Thank you for your help.
To work around the problem I finally replaced the exe file of my browser by default with my script.

Return to “Ask For Help”

Who is online

Users browsing this forum: aandf, need4speed, Rohwedder, smbs and 31 guests