0
votes

I'm trying to map LAlt+Space to Delete and AltGr+Space to Backspace, so i made this script :

<!Space::Delete
<^>!Space::Backspace

LAlt+Space gets mapped correctly to Delete, but AltGr+Space doesn't work properly : it removes words like Ctrl+Backspace would do instead of removing one character at a time.

I switched 'Delete' and 'Backspace' and got the same issue : LAlt+Space works properly but AltGr+Space removes words like Ctrl+Delete instead of characters.

I'm guessing this might have to do with the fact that AltGr is actually Ctrl+RAlt, so the Ctrl might be composed with Backspace or Delete at some point ?

Does anybody know what the cause of this could be, and a solution ?

1
Try the Send command: <^>!Space:: Send {BS} - user3419297
This worked, thanks ! - sewdio
You should also do the same with Delete remapping doesn't release the modifier keys. - Oleg
@user3419297 You should post that as an answer, as it seems to have resolved the issue - Stevoisiak

1 Answers

0
votes

While @user3419297's answer is essentially correct, it's advisable in modern versions of AHK to use SendInput over Send.

<!Space::
SendInput, {Delete}
return

<^>!Space:: 
SendInput, {Backspace}
return