Skip to content

Instantly share code, notes, and snippets.

@syron
Created November 24, 2012 16:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save syron/4140413 to your computer and use it in GitHub Desktop.
Save syron/4140413 to your computer and use it in GitHub Desktop.
var shiftIsPressed = false;
$("#LogAddForm textarea").keyup(function(e) {
if (e.keyCode === 16) shiftIsPressed = false;
});
$("#LogAddForm textarea").keydown(function(e) {
if (e.keyCode === 16) shiftIsPressed = true;
if (e.keyCode === 13 && !shiftIsPressed) {
$("#LogAddForm").submit();
return false;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment