Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

How to require pressing Shift+Enter in order to result in a press of Enter



  • Please log in to reply
2 replies to this topic
terrisus
  • New members
  • 2 posts
  • Last active: Oct 01 2015 11:30 PM
  • Joined: 30 Sep 2015
Hey all. I've done a whole bunch of stuff with AutoHotKey, and this seems like something I should be able to figure out myself, but nothing's springing to mind at the moment, so I figured I would ask. Is there any way to change the behavior of the Enter key so that pressing the Enter key by itself does not register and Enter press, but that you need to hold Shift and press Enter in order to register an Enter press? Basically, the goal of this is to eliminate accidental Enter presses (in particular, when typing in a field where pressing Enter results in submitting the field). Thanks for any help, it's much appreciated.

Exaskryz
  • Members
  • 3249 posts
  • Last active: Nov 20 2015 05:30 AM
  • Joined: 23 Aug 2012
✓  Best Answer

$enter::return
+enter::Send {enter}

 

The $ modifier is to make sure that when AHK performs Send {enter} that it doesn't trigger the enter hotkey itself. There are other ways to ensure that wouldn't happen, but this is a simple method for it.



terrisus
  • New members
  • 2 posts
  • Last active: Oct 01 2015 11:30 PM
  • Joined: 30 Sep 2015
$enter::return
+enter::Send {enter}

The $ modifier is to make sure that when AHK performs Send {enter} that it doesn't trigger the enter hotkey itself. There are other ways to ensure that wouldn't happen, but this is a simple method for it.

 

 

Yup, that did it.

 

Thanks a bunch, much appreciated  :)