Include the hot-hey script and the Mootools-Core.
Initialize the Class and use the options for detailed configuration.
var body = document.getElement('body'); var space_switcher = new OneMoreFingers ({ keys: [{code:32}], onHotKeyDown: function (key, event) { //console.log(arguments); if ($('space_switch').get('text') == 'On') { body.setStyles({'background-color':'black',color:'white'}); $('space_switch').set('text','Off'); $$('.key').setStyle('color','white'); } else { body.setStyles({'background-color':'white',color:'black'}); $('space_switch').set('text','On'); $$('.key').setStyle('color','black'); } } });
keys -> array of key codes and optional bind_id to "link" to an element. Two events -> onHotKeyDown and onHotKeyUp considering each of two arguments: 1. key-code 2. event-object
Look in the samples.php file for more samples.
Tested on the Windows-Versions of Firefox 3, Internet Explorer 8, Chrome, Safari and Opera.
Demo: http://webhike.de/labs/OneMoreFingers/samples.html
GitHub repo: http://github.com/enlogger/OneMoreFingers
Blog Entry: http://wildeuter.de/2009/11/onemorefingers-hot-keys-script/
A note on comments here: These comments are moderated. No comments will show up until they are approved. Comments that are not productive (i.e. inflammatory, rude, etc) will not be approved.
Found a bug in this plugin? Please report it this repository's Github Issues.
blog comments powered by Disqus