Gimptalk - Premier Gimp Community: Making Hotkeys in JQuery - Gimptalk - Premier Gimp Community

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Making Hotkeys in JQuery

#1 User is offline   mikethedj4 

  • mikethedj4
  • PipPipPip
  • Group: Members
  • Posts: 1,083
  • Joined: 20-June 08
  • LocationRockford, IL

  Posted 05 July 2011 - 08:05 PM



Before we get started. Make sure you have JQuery downloaded, and then download JQuery Hotkeys.

Now add in the following files like so...
<html>
<head>
<title>JQuery Hotkeys</title>
<script src="jquery-1.6.1.js"></script>
<script src="jquery.hotkeys.js"></script>
</head>
<body>
	
</body>
</html>

Now it's super easy to make a hotkey.
For example look at my code below.
$(document).bind('keydown', 'ctrl+q', function() {
	alert('You found the hotkey!');
});

What this code does is, when you press CTRL+Q an alertbox will popup saying "You found the hotkey!".

I told you it was easy.
Posted Image
0

#2 User is offline   satory 

  • meh
  • PipPipPip
  • Group: Members
  • Posts: 1,412
  • Joined: 06-September 08
  • Locationunder 18 b****

Posted 29 August 2011 - 12:22 PM

I noticed something,we have the same background :D

But nice tutorial by the way,I need to start learning how to script myself...
Posted Image
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic