Send US/UK keyboard key = on swiss ch/de layout Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
FordPerfect
Posts: 4
Joined: 27 May 2023, 07:48

Send US/UK keyboard key = on swiss ch/de layout

Post by FordPerfect » 27 May 2023, 08:25

Hey guys. I've got a confusing problem and hope you can help me out:

I've got a CH keyboard and different lang sets on windows 10. I want to send the equal (=) sign through Razer Synapse 3 (mouse key bind). The app is very bad, because it map the keys from US layout back to my OS set keyboard layout.
As example if I set (^) CH Synapse assign (=) which results in a different output depending which layout (CH/UK/FR whatever) I set to my current active keyboard language in windows settings.

So I just could switch to EN keyboard and it would work fine. As you can perhaps understand, it bothers me to keep changing the language.

I made a AHK script and map the mouse button to the ahk compiled exe. Just to run into exactly the same problem. :facepalm:
All I want is to send the US keyboard key ------> = <------- independent by anything else.

My last try was:

Code: Select all

Send {vk0xBB}
It seems I miss something, or something hates me. :(
It's important to send the key and not just the "text". Send {vk0xBB} works fine, but only if I switch to US layout.
The equal key is particularly stupid, because in the CH layout it does not trigger a keystroke directly, but a "component" that only leads to a character with another keystroke.


[Mod action: Moved topic to v1 section since this is v1 code. The main section is for v2.]

FordPerfect
Posts: 4
Joined: 27 May 2023, 07:48

Re: Send US/UK keyboard key = on swiss ch/de layout

Post by FordPerfect » 27 May 2023, 13:02

I solved it. Strangely, notepad++ didn't display a character for CH/DE, while EN/UK displayed an equals sign. That's why I assumed that it doesn't work in the game itself either. Without the window switch, logically.

While I'm not particularly happy that every keypress restarts the exe, I haven't found an easier solution. At least it's a key that I don't use that often. And I still prefer it that way than always having an ahk running in the background.

Of course, it's also useless if you need UAC to make it work. And singleton is also unnecessary I suppose... ;)

Code: Select all

#SingleInstance, force
SetKeyDelay,100,50

#IfWinActive ahk_class Fallout4
Send {vkbb}

ExitApp
Besides, I read a couple of amusing discussions about why actually VK_OEM_PLUS when it should be VK_OEM_EQUAL, from the logic point of view.

FordPerfect
Posts: 4
Joined: 27 May 2023, 07:48

Re: Send US/UK keyboard key = on swiss ch/de layout  Topic is solved

Post by FordPerfect » 27 May 2023, 13:46

#SingleInstance, force
SetKeyDelay,100,50

#IfWinActive ahk_class Fallout4
Send {vkbb}

ExitApp

WinActive condition was wrong, just to be correct... ;)
#SingleInstance, force
SetKeyDelay,100,50

if WinActive("Fallout4") {
Send {vkbb}
}

ExitApp

Post Reply

Return to “Ask for Help (v1)”