Remapping CTRL + h as backspace Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
huberoliver
Posts: 5
Joined: 22 May 2019, 02:42

Remapping CTRL + h as backspace

22 May 2019, 02:58

I have remapped Capslock as CTRL. I am also trying to use CTRL + h as backspace, i.e., deleting the first token left to the current cursor position:

Capslock::Ctrl

^h::
send {BS}
return

Using the actual CTRL keys in combination with the h key does the job: If I hold the CTRL key and press the key, one token gets deleted to the left. The same is true for pressing and holding Capslock and the h key. HOWEVER: Trying to delete more than one token to the left is easy with the actual CTRL key: I simply keep the CTRL key pressed and press the h key as many times as tokens I want to delete. This does not work with the remapped Capslock key though. In this key, I have to release the Capslock key each time I want to use the h key to delete I token. If I do not do that (i.e., if I just keep the Capslock key pressed), the letter "h" gets printed to the screen.

Any chance I could make the remapping of the Capslock key "persistent"?
User avatar
elModo7
Posts: 105
Joined: 01 Sep 2017, 02:38

Re: Remapping CTRL + h as backspace

22 May 2019, 03:50

Try this:

Code: Select all

:X:^h::DoBackSpace()

DoBackSpace(){
    while(GetKeyState("LControl","H"))
    {
        Send {BS}
        Sleep 50
    }
}
:beer:
huberoliver
Posts: 5
Joined: 22 May 2019, 02:42

Re: Remapping CTRL + h as backspace

22 May 2019, 05:31

This did unfortunately not solve the issue. Using your code, pressing Capslock and H does not have any effect anymore.
Sam_
Posts: 106
Joined: 20 Mar 2014, 20:24

Re: Remapping CTRL + h as backspace  Topic is solved

22 May 2019, 16:09

huberoliver wrote:
22 May 2019, 02:58
I have remapped Capslock as CTRL. I am also trying to use CTRL + h as backspace, i.e., deleting the first token left to the current cursor position:

Capslock::Ctrl

^h::
send {BS}
return

Using the actual CTRL keys in combination with the h key does the job: If I hold the CTRL key and press the key, one token gets deleted to the left. The same is true for pressing and holding Capslock and the h key. HOWEVER: Trying to delete more than one token to the left is easy with the actual CTRL key: I simply keep the CTRL key pressed and press the h key as many times as tokens I want to delete. This does not work with the remapped Capslock key though. In this key, I have to release the Capslock key each time I want to use the h key to delete I token. If I do not do that (i.e., if I just keep the Capslock key pressed), the letter "h" gets printed to the screen.

Any chance I could make the remapping of the Capslock key "persistent"?
I was unable to reproduce your results. I tried your code as well as

Code: Select all

Capslock::LCtrl
^h::Send,{Backspace}
and

Code: Select all

#InstallKeybdHook
Capslock::LCtrl
^h::Send,{Backspace}
Both seem to be working as you want. Maybe make sure you are using the latest version of AHK. There have been a few bug fixes concerning hotkeys and hotstrings in the near past.
huberoliver
Posts: 5
Joined: 22 May 2019, 02:42

Re: Remapping CTRL + h as backspace

23 May 2019, 01:36

Bugger - the upgrade from 1.0x to the latest version solved the issue. Should have done that before wasting everybody's time. Thx for your support!

Return to “Ask For Help”

Who is online

Users browsing this forum: Albireo, Enlprck, flyingDman, Odlanir, philippelo, Pilu and 151 guests