Skip to content

Instantly share code, notes, and snippets.

@starenka

starenka/keypress.js

Created Jan 20, 2011
Embed
What would you like to do?
Opera - gimme my slash back
/*
* This is Opera user script, place me into ~/.opera/scripts
* You can read more about userjs here http://www.opera.com/docs/userjs/
*
* This listener prevents events fired after keypress.
* Feel free to add more scancodes into the regexp.
* 47 - slash
*
* @author starenka
* @version 0.1
* @since 20-01-2011
*/
window.opera.addEventListener('BeforeEventListener.keypress', function (ev){
if(/^(47)$/.test("" + ev.event.keyCode)) ev.preventDefault();
}, false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment