0

In windows when I press Ctrl + Delete in a text editor, a whole word in front of the cursor gets deleted and I want to remap this to the combination: Left Ctrl + Left Alt + P, which means when I press Left Ctrl + Left Alt + P, I want the word to be deleted also.

I am using AutoHotKey v2.0 to achieve this and I am using this script:

<^<!p::
{
    Send("<^{Delete}")
}

And the issue is that now when I click Ctrl + Left Alt + P, it is being translated as if I am pressing Ctrl + Alt + Delete which shows a screen to Lock or switch user or show the task manager.

I tried to work around this by remapping Left Ctrl + Left Alt + Delete to do nothing:

<^<!Del::
{
    return
}

But it is still showing the lock screen.

How can I solve this?

1 Answer 1

0

The "Security Keys" Ctrl+Alt+Del

When a user is logged onto a Windows computer, pressing Ctrl+Alt+Delete invokes Windows Security. It is a graphical user interface that allows user to lock the system, switch user, log off, change the password, invoke Windows Task Manager, or end the Windows session by shutting down, rebooting or putting the computer into sleep or hibernation; clicking "Cancel" or pressing the Escape key returns the user to where they were.

Because of its security function, it works even when other keys are being held down.

The only solution in this case, is to fire the hotkey after releasing one of the modifier keys:

#Requires AutoHotkey v2.0

<^<!p::
{
    KeyWait("LAlt") ; waits for the left Alt key to be released
    Send("^{Delete}")
}
1
  • Thanks for the answer. Unfortunately it is not practical, for example, when I want to delete multiple words I need to release and press the Alt key again for each word.
    – VFX
    Commented May 17 at 13:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .