Baffled - basic hotkey and auto-replace.

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
GlennB
Posts: 3
Joined: 14 Nov 2015, 19:45

Baffled - basic hotkey and auto-replace.

14 Nov 2015, 22:22

I've been using a script for some time (over a year) now and just started to experience problems with it. Two events have occurred recently which may have some bearing on the problem: (1) I updated my version of AH to 1.1.22.09 (a few days ago), and (2) my Windows 10 just got upgraded to build 10586 (yesterday, Nov. 13).

Here is my script:
+^p::Send {ASC 718}
+^l::Send {ASC 697}
+^o::Send {ASC 449}
+^k::Send {ASC 448}
+^m::Send {ASC 8212}
+^i::Send {ASC 8804}
+^j::Send {ASC 8805}
return

As you can see, it is a simple script.
Today, it has gone all bonkers. The combination of Control, Shift and the p key now brings up the Windows print dialog. The combination of Control, Shift and the l (lowercase L) key produces varying lengths of a combination of two of the other mappings. I have attempted to solve this issue all day with all of the AH resources I can research, to no avail.

I did find that if I put the following line (and only this line) in my script, I got what I expected:
~Control & ~Shift
However, I was unable to take this any further.

Any help would be greatly appreciated.
User avatar
Xtra
Posts: 2750
Joined: 02 Oct 2015, 12:15

Re: Baffled - basic hotkey and auto-replace.

15 Nov 2015, 03:41

Code: Select all

~+~^p::Send {ASC 718}
~+~^l::Send {ASC 697}
~+~^o::Send {ASC 449}
~+~^k::Send {ASC 448}
~+~^m::Send {ASC 8212}
~+~^i::Send {ASC 8804}
~+~^j::Send {ASC 8805}
GlennB
Posts: 3
Joined: 14 Nov 2015, 19:45

Re: Baffled - basic hotkey and auto-replace.

15 Nov 2015, 13:30

Xtra, this does not yet solve the problem. For reference, I am using this script with a MS Word 2007 document.

The ~+~^p still brings up the print dialog. The ~+~^l causes a style change and then inserts 2 non-printable characters followed by the correct (asc 697) character. The ~+~^o produces the correct character but also brings up the Research dialog.

Since this script worked correctly prior to the upgrade of Windows 10 to the latest build, I suspect an issue with either drivers or some other low-level mechanism.

When I was able to get the desired results using the ~Control & ~Shift key combination, I could not figure out how to combine them with the p or l or any other key. Is there a way to do this?

Any other suggestions?

Again, thank you.
User avatar
Xtra
Posts: 2750
Joined: 02 Oct 2015, 12:15

Re: Baffled - basic hotkey and auto-replace.

15 Nov 2015, 15:45

I would try running your original script as admin.
lexikos
Posts: 9690
Joined: 30 Sep 2013, 04:07
Contact:

Re: Baffled - basic hotkey and auto-replace.

15 Nov 2015, 22:38

Remove ~. Its purpose is to allow the keystrokes to pass through to the active window, which I think is the opposite of what you want.

Try adding #UseHook to the top of the script.
GlennB
Posts: 3
Joined: 14 Nov 2015, 19:45

Re: Baffled - basic hotkey and auto-replace.

16 Nov 2015, 23:38

Thank you. I have found that if I simply use the Win key and a single letter key (avoiding the L) all works correctly. This is also a simpler solution than what I used originally.
lexikos
Posts: 9690
Joined: 30 Sep 2013, 04:07
Contact:

Re: Baffled - basic hotkey and auto-replace.

17 Nov 2015, 00:39

Btw, the {ASC nnnn} syntax produces an Alt+Numpad combination which can be unreliable, especially for non-ASCII characters. If you're using a Unicode version of AutoHotkey and you save your script as UTF-8 with BOM (Notepad just calls it "UTF-8"), you can just write the character directly in the script:

Code: Select all

Send ≥
Another alternative (which requires any recent version of AutoHotkey) is to use the newer {U+xxxx} syntax, where xxxx is a hexadecimal Unicode character code. For example, {ASC 8805} (with a program which supports it) is equivalent to {U+2265}.

Code: Select all

MsgBox % Format("{{}U+{:04x}{}}", 8805)
The Windows Character Map program displays these U+ codes at the bottom of its window.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: niCode and 217 guests