I use middle click to open new windows in Chrome solely. I am also used to using middle click to essentially paste coming from Linux.

Is there with autohotkey to keep both functionalities present? This works for the paste functionality for now.

mbutton::
  sendinput ^{v}
  return

Yes, for example you can simply prefix the hotkey with a tilde:

~mbutton::
  sendinput ^{v}
  return

Which makes the hotkey non-blocking (lets the event pass further).
But generally it is not a good idea - it means you will have a system-wide shortcut which lets the application consume this event as well.
E.g. in Chrome, if you have an active input cursor in some form, then clicking m-button on some link will paste the text into the form AND open a new tab. In case of opening a link it might be actually ok, but imagine if some other software has e.g. "select all" bound to middle-click or something like that. So it should be used with caution.

IMO a better idea would be to make some application-specific script. This can be made with the #if directive. See Context-dependent app . So for example you could have a hotkey only when Chrome is active and further check whether in Chrome you have input cursor active or not (might be possible, but I am not sure).

  • This prevents middle press from scrolling. Is there a way to fix this? – William Oct 9 at 21:02

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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