1

I'm using Autohotkey to map Ctrl+w to Alt+w for Cloud9 to close inner tabs with Ctrl+w like usual instead of their Alt+w. I tried to use the following simple mapping

^w::!w

But it sends Ctrl+Alt+w with closes all tabs except current tab which wasn't what I wanted.

How can I tell autohotkey to not actually send the Ctrl key that I press for this hotkey?

2

Try the following instead:

Ctrl & w::Send !w

AutoHotKey has special handling for remapping the Ctrl key to the Alt key:

When the source key is LCtrl and the destination key is an Alt key, the line Send {Blind}{LAlt DownTemp} is replaced by Send {Blind}{LCtrl Up}{LAlt DownTemp}. The same is true if the source is RCtrl, except that {RCtrl up} is used.

This special handling is specifically designed to prevent the behavior you observed. If you think about a simpler remapping like p::v, you'd probably want CtrlP to be treated like ^v so that you can paste with your P. In general, AutoHotKey tries to allow modifying keys to do their thing while triggering a hotkey.

  • Works! But any reason I should do both LCtrl and RCtrl instead of Ctrl & w::Send !w? it works too. – laggingreflex Aug 11 '14 at 17:37
  • Nope. I just assumed from the quoted text that I needed to use LCtrl instead of Ctrl. – Dane Aug 11 '14 at 20:19
0

It could be related to this :

^x::^c Makes Control-X produce Control-C. It also makes Control-Alt-X produce Control-Alt-C, etc.

It is taken from the AutoHotkey Help Pages.

What have you done is : Control-W produces Alt-W.

You said you wanted to use Ctrl+W to close tabs.

If Ctrl-W produces Cltrl-Alt-W because it produces Alt-W and Cltr-W at same time, it means that the application has time to catch the internal signal.

It might be because the application is looking for the BIOS keys or either that that auto-hotkey doesn't react fast enough.

I remember that there's was an option to put a autohotkey to sleep for x-time or make send more signals at the same time.

Sending more signals at the same time will prevent the Key from the Bios to reach the application. AutoHotkey will always translate the stroke so the application will read the right keys/AutoHotkey signals only.

I hope my long explanation helped you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.