Remapping entire keyboard to Halmak

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Bull123
Posts: 15
Joined: 30 Jan 2022, 18:47

Remapping entire keyboard to Halmak

30 Jan 2022, 19:33

Hi all,
I just love ahk, and have used it for about 3 years now. But I have a question I just can't find a soulution to, even though I have googled it for quite some time now(!)

I have remapped the entire keyboard to something resembelling Halmak, but a simplified version of my script looks like this:

Code: Select all

SetKeyDelay, 0
#installKeybdHook
#UseHook On
b::n
n::b 
And in another script that is also running, I have this code:

Code: Select all

::nnn::
    send, Hello World!
    return
The problem comes when I try to activate the "Hello World"-snippet.
If I type "nnn" (on the original "b" button), nothing happens.
But if type "bbb" (on the original "n" button), the "Hello World"-snippet actually activates.

It seems the output ot the first code isn't used as input for the next. Unfortunetly.

Any help would be much appreciated. Its driving me mad. Or at least semi-mado :(
Last edited by gregster on 30 Jan 2022, 19:39, edited 1 time in total.
Reason: Topic moved from "AHK v2 Help"; seems to be v1 code.
User avatar
mikeyww
Posts: 27372
Joined: 09 Sep 2014, 18:38

Re: Remapping entire keyboard to Halmak

30 Jan 2022, 19:45

You can combine the scripts.

Code: Select all

#InputLevel 1
b::n
n::b
#InputLevel 0
:CT:nnn::Hello World!
Bull123
Posts: 15
Joined: 30 Jan 2022, 18:47

Re: Remapping entire keyboard to Halmak

31 Jan 2022, 05:59

Thanks, Mikey!

Your code works perfectly for the hotstrings. But when I try to add a hotkey, the mapping doesn't follow anymore

Code: Select all

#InputLevel 1
b::n
n::b
#InputLevel 0
:CT:nnn::Hello World!
^n::
	msgbox, "control n"
	return
^b::
	msgbox, "control b" 
	return
When I click ctrl+"n" (original "b"-button), the result is a msgbox with text "control b" :(
User avatar
mikeyww
Posts: 27372
Joined: 09 Sep 2014, 18:38

Re: Remapping entire keyboard to Halmak

31 Jan 2022, 06:15

Perhaps it's easy enough to make the adjustments here.

Code: Select all

#InputLevel 1
b::n
n::b
^n::MsgBox, Control b
^b::MsgBox, Control n
#InputLevel 0
:CT:nnn::Hello World!
Or:

Code: Select all

#InputLevel 1
b::n
n::b
#InputLevel 0
:CT:nnn::Hello World!
^n::MsgBox, Control b
^b::MsgBox, Control n
My general hunch here is that the hotkey itself (not hotstring) still stands. You can see it again in the following demonstration.

Code: Select all

#InputLevel 1
b::^n
n::x
#InputLevel 0
^n::MsgBox, Control n
x::Send y
Nonetheless, your remap still works, as-- without the added hotkey-- pressing Ctrl+B still sends Ctrl+N to your system.

image220131-0651-001_cr.png
Key history
image220131-0651-001_cr.png (8.56 KiB) Viewed 503 times
Bull123
Posts: 15
Joined: 30 Jan 2022, 18:47

Re: Remapping entire keyboard to Halmak

31 Jan 2022, 15:08

Thanks,

And yes, it seems so.
Tried many hours today, and found someone who had used $ before each command.
But I didn't seem to do the trick :(

So I gave up and used another software instead (Keytweak). I think it changes the core register, and autohotkey doesn't even seem to notice that the key you click used to be another.
So that works perfect.

But I just feel there should be a way to do that something similar in autohotkey as well :eh:
gregster
Posts: 9114
Joined: 30 Sep 2013, 06:48

Re: Remapping entire keyboard to Halmak

31 Jan 2022, 15:18

Sure, you could also alter the registry with AHK - it just hasn't a fancy GUI for that. So KeyTweak is probably better for this.
But the "normal" remapping with AHK works differently, on a higher system level - and it's only temporary while the script runs. For many users, that's what they want.
For more permanent remaps, changing the registry might suit you better.

See also Remapping via the Registry's "Scancode Map" for advantages and disadvantages of the registry method.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot], Lpanatt, macromint, peter_ahk and 278 guests