Remapping ° (degree symbol). Key is disabled?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
yasqueenslay
Posts: 22
Joined: 17 Oct 2019, 05:59

Remapping ° (degree symbol). Key is disabled?

Post by yasqueenslay » 27 Jan 2023, 06:08

Initially I tried

Code: Select all

°::!d
(alt+d combination), but I get this error:
Image

In key history, the last three lines show up when I press the ° key. So on down stroke it's the weird S symbol and up stroke two °s? I don't get it.
Image

Tried:

Code: Select all

SC00B0::!d
Nothing happens. Then tried

Code: Select all

SC029::!d
And it only works after pressing ° twice. What gives?

Also tried running SharpKeys (says ° is disabled) and the ahk script doesn't detect the keynames either.
Image

What gives? Any insight? How can one key by default be something on the downstroke and something else in upstroke?

How come pressing ° twice works with SC029::!d? Shouldn't it just be when pressed down once?

Thanks!

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

Re: Remapping ° (degree symbol). Key is disabled?

Post by mikeyww » 27 Jan 2023, 06:57

I do not have a way to test, but would close all other scripts and test just a short one with a MsgBox.

Code: Select all

#Requires AutoHotkey v1.1.33
; #Requires AutoHotkey v2.0
SC0B0::MsgBox 123
SC029::MsgBox 456

yasqueenslay
Posts: 22
Joined: 17 Oct 2019, 05:59

Re: Remapping ° (degree symbol). Key is disabled?

Post by yasqueenslay » 27 Jan 2023, 07:17

mikeyww wrote:
27 Jan 2023, 06:57
I do not have a way to test, but would close all other scripts and test just a short one with a MsgBox.

Code: Select all

#Requires AutoHotkey v1.1.33
; #Requires AutoHotkey v2.0
SC0B0::MsgBox 123
SC029::MsgBox 456
It was the latter (456). As it turns out

Code: Select all

SC029::!d
works fine with most browsers, except for Chrome (which is where I was testing to begin with in order to highlight the URL field).

Maybe there's a conflicting keyboard shortcut there? Pressing Alt+d works fine in Chrome, shouldn't SC029::!d have the same effect? Only works when I press ° twice (down up the key and activates on the second down -even before lifting the finger from the key-).

Edit: using the following fixes the issue (I don't really understand why)

Code: Select all

SC029::Send, !d

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

Re: Remapping ° (degree symbol). Key is disabled?

Post by mikeyww » 27 Jan 2023, 07:59

Due to use of blind mode, one doesn't typically send a modifier key in a remap, though it can be done. Blind mode alters how modifiers are restored.

Offhand, I don't know how a remap handles a two-key sequence (modified key), but the :arrow: KeyHistory would show it.

Post Reply

Return to “Ask for Help (v1)”