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"?
Remapping CTRL + h as backspace Topic is solved
-
- Posts: 5
- Joined: 22 May 2019, 02:42
Re: Remapping CTRL + h as backspace
Try this:
Code: Select all
:X:^h::DoBackSpace()
DoBackSpace(){
while(GetKeyState("LControl","H"))
{
Send {BS}
Sleep 50
}
}
-
- Posts: 5
- Joined: 22 May 2019, 02:42
Re: Remapping CTRL + h as backspace
This did unfortunately not solve the issue. Using your code, pressing Capslock and H does not have any effect anymore.
Re: Remapping CTRL + h as backspace Topic is solved
I was unable to reproduce your results. I tried your code as well ashuberoliver wrote: ↑22 May 2019, 02:58I 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"?
Code: Select all
Capslock::LCtrl
^h::Send,{Backspace}
Code: Select all
#InstallKeybdHook
Capslock::LCtrl
^h::Send,{Backspace}
-
- Posts: 5
- Joined: 22 May 2019, 02:42
Re: Remapping CTRL + h as backspace
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!
Re: Remapping CTRL + h as backspace
Sorry to revive an old thread but this is exactly what I was trying to accomplish and had to use another method. Posting here for others to find as well.
In my case ahk is installed on a remote session and I had to use the following to get it to work:
One more way to get that readline functionality everywhere.
In my case ahk is installed on a remote session and I had to use the following to get it to work:
Code: Select all
; ctrl h as backspace
^h::
KeyWait, Backspace
SendEvent {Backspace}
return
Who is online
Users browsing this forum: No registered users and 150 guests