Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How do I disable site-specific hotkeys if (and only if) they are already mapped in Opera? For example, I use <C-b> instead of <Right> and <C-h> instead of <BS>. On Stack Overflow/Super User they produce **strong text** and ## Heading ## respectively. I do not want this happen. I can examine Super User/Stack Overflow/some_other_site's javascript and write a userjs to do the job, but this method is not universal.

I'm using Opera-10.51_pre6252 in Gentoo Linux.

share|improve this question
up vote 0 down vote accepted

The following userjs prevents firing event for specified hotkeys (see long array starting with ["h"). Does anybody know, how to automatically get the list of hotkeys used by opera? (Without any external scripts that watch for opera ini files and generate similar userjs on changes).

// ==UserScript==
// @include *
// ==/UserScript==
(function() {
 window.opera.addEventListener("BeforeEventListener.keypress", (function(e) {
         if(e.event.ctrlKey || e.event.metaKey) {
             var s=String.fromCharCode(e.event.keyCode).toLowerCase();
             if(["h", "b", "d", "f", "t", "w", "z", "n", "g", "c", "\t"].indexOf(s)!=-1) {
                 e.preventDefault();
             }
         }
     }), false);
 })();
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .