Hotstring activated by @ not working in Edge

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
PhilippeBruno
Posts: 10
Joined: 27 Apr 2017, 03:09

Hotstring activated by @ not working in Edge

23 Sep 2017, 23:30

I followed an example from the online help showing a hotstring to easily enter an email address:
I programmed my own email addresses and this used to work like a charm in Internet Explorer for years. I recently upgraded to Windows 10 and started using Edge. Unfortunately, for some odd reason, typing j@ will trigger the hotstring but the replacement string will stop at the @ sign (ie. jsmith@) and no more input is possible until I reload the page, thus effectively loosing everything that was entered before.

I did some investigation and I realised that it does not happen with all the input fields. Perhaps some Java or Ajax code behind some fields is causing this weird behaviour. I further investigated and discovered that when I use my keyboard in English (Windows key and Space bar to switch the input method), the problem never happens. In US English, the @ sign is entered by pressing [shift] + [2] while in Canadian French, the @ sign is entered by pressing [Alt Gr] + [2], which could explain the different behaviour.

Although it is a peculiar and perhaps very specific problem, this is somewhat annoying as I have been using this script for such a long time. Possible workarounds include going back to Internet Explorer or Chrome or some other browser (they are not affected), but I would love to start using Edge. Another workaround is to always switch to English keyboard before typing the hotstring, but this requires some extra keys to be pushed, which somewhat defeats the hotstring in the first place. Lastly, I figured that if I modify my script to:

Code: Select all

:*:j@::
  Clipboard := "[email protected]"
  Send ^v
  return
it solves the problem. This is perhaps the most acceptable workaround although there could be some side effects I have not discovered yet.

HOWEVER, I am reporting this peculiar problem here with the hope that someone either found a better workaround or, better yet, a fix for that in order to make AutoHotkey even more rock solid.

Any idea?
Last edited by PhilippeBruno on 24 Sep 2017, 08:37, edited 1 time in total.
PhilippeBruno
Posts: 10
Joined: 27 Apr 2017, 03:09

Re: Hotstring activated by @ not working in Edge

24 Sep 2017, 08:36

I did some more investigation and I realised that the problem lies not with the activation character @ in the hotstrings, but rather with the fact that there is the @ character in the string. For instance, the following hotstring

Code: Select all

:*C:abc*::apple banana @ breakfast
will block at the @ sign (that is, the resulting replacement will be "apple banana @" and the keyboard input will be blocked after that) when the keyboard is set to Canadian French. However, when the keyboard is set to US English, everything is fine.

I also suspected the speed to be an issue, but with the following script, it still blocksm at the @ character when keyboard is set to Canadian French.

Code: Select all

:*C:abc*::
  S := "apple banana @ breakfast"
  Loop Parse, S
  {
   Send %A_LoopField%
   Sleep 1000 
  }
  return
I even try variations with SendEvent (same problem) and SendPlay (the latter does not work at all).

Any idea what is happening with the Edge browser to behave like this?
Helgef
Posts: 4709
Joined: 17 Jul 2016, 01:02
Contact:

Re: Hotstring activated by @ not working in Edge

24 Sep 2017, 08:37

Hello maybe try this,

Code: Select all

:*:j@::
	sendinput, jsmith{u+40}somedomain.com
return
where {u+40} is the code for the unicode character @.
Cheers
PhilippeBruno
Posts: 10
Joined: 27 Apr 2017, 03:09

Re: Hotstring activated by @ not working in Edge

24 Sep 2017, 08:46

Hi Helgef,

Your idea was very clever, but the result is puzzling... When the keyboard is set to Canadian French, the replacement string misses the @ character (ie. apple banana breakfast). With the keyboard set to US English, all is fine.

There is really something with the way Edge handles some keys when a particular keyboard is set. I will investigate with other keys typed using the [Alt Gr] key to see if they behave like the @ character.

Thanks for your idea.
PhilippeBruno
Posts: 10
Joined: 27 Apr 2017, 03:09

Re: Hotstring activated by @ not working in Edge

24 Sep 2017, 09:04

Following Helgef's excellent suggestion to use the Unicode characters, I tested with other characters obtained using the [Alt Gr] key to the right of the space bar and I discovered the problem is not limited to the @ character. Other characters such as °, ± or ~ are causing the exact same problem. The weird thing is that I can manually enter those characters in a form in Edge, but as soon as I use AutoHotkey hotstrings, it blocks at the special character.

I am wondering if this has to do with the fact that the [Alt Gr] key (alternate graving) is equivalent to pressing [Ctlr]+[Alt] together, which would cause Edge to choke when AutoHotkey expands a hotstring.
Helgef
Posts: 4709
Joined: 17 Jul 2016, 01:02
Contact:

Re: Hotstring activated by @ not working in Edge

24 Sep 2017, 09:24

It seems a bit odd. When sending the unicode character, the modifiers are not used, instead SendInput() is sending some messages to the active window. Maybe try some of the other sendModes?
PhilippeBruno
Posts: 10
Joined: 27 Apr 2017, 03:09

Re: Hotstring activated by @ not working in Edge

24 Sep 2017, 09:33

Hi Helgef,

Thanks again for your input. I did try all the other sendModes to no avail (see another one of my replies above).

Philippe

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Anput, DiegoSouto, Holarctic, mikeyww, robnicholson, Rohwedder, Swiftly9767 and 347 guests