Søg i Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Læs mere

Rebind navigation keys on text input textarea fields possible all firefox text inputs

  • Ingen svar
  • 0 har dette problem
  • 2 visninger
more options

I have already read all the articles that I could find about how to rebind keys in firefox. I understand the concept of the autoconfig file, have created one for normal settings.

But as I understand it I could also rebind keys there with this snippet

``` try {

 let { classes: Cc, interfaces: Ci, manager: Cm  } = Components;
 const Services = globalThis.Services;
 const {SessionStore} = Components.utils.import('resource:///modules/sessionstore/SessionStore.jsm');
 function ConfigJS() { Services.obs.addObserver(this, 'chrome-document-global-created', false); }
 ConfigJS.prototype = {
   observe: function (aSubject) { aSubject.addEventListener('DOMContentLoaded', this, {once: true}); },
   handleEvent: function (aEvent) {
     let document = aEvent.originalTarget; let window = document.defaultView; let location = window.location;
     if (/^(chrome:(?!\/\/(global\/content\/commonDialog|browser\/content\/webext-panels)\.x?html)|about:(?!blank))/i.test(location.href)) {
       if (window.Tabbrowser) {
         // Place your keyboard shortcut changes here
         // ...
         // ...


       }
     }
   }
 };
 if (!Services.appinfo.inSafeMode) { new ConfigJS(); }

} catch(ex) {}; ```

But the missing piece is the instructions to set the binding for :

alt-j : move one char to the left alt-i : move up one line alt-k : move down one line alt-l : move one char to the right

The closest I get to understand this is with this other snippet

``` // remap Ctrl-J to downloads (removing it from focusing the browser bar) let search2 = window.document.getElementById('key_search2') search2.remove(); let openDownloads = window.document.getElementById('key_openDownloads') openDownloads.setAttribute("modifiers", "accel"); openDownloads.setAttribute("key", "J"); ```

But in this case I need to know the values to substitute "key_search2" for the corresponding key bindign "key_charleft","key_previouschar","key_charprev","cmd_charprev"?

Any information on how to accomplish that would be greatly appreciated, thanks.

I have already read all the articles that I could find about how to rebind keys in firefox. I understand the concept of the autoconfig file, have created one for normal settings. But as I understand it I could also rebind keys there with this snippet ``` try { let { classes: Cc, interfaces: Ci, manager: Cm } = Components; const Services = globalThis.Services; const {SessionStore} = Components.utils.import('resource:///modules/sessionstore/SessionStore.jsm'); function ConfigJS() { Services.obs.addObserver(this, 'chrome-document-global-created', false); } ConfigJS.prototype = { observe: function (aSubject) { aSubject.addEventListener('DOMContentLoaded', this, {once: true}); }, handleEvent: function (aEvent) { let document = aEvent.originalTarget; let window = document.defaultView; let location = window.location; if (/^(chrome:(?!\/\/(global\/content\/commonDialog|browser\/content\/webext-panels)\.x?html)|about:(?!blank))/i.test(location.href)) { if (window.Tabbrowser) { // Place your keyboard shortcut changes here // ... // ... } } } }; if (!Services.appinfo.inSafeMode) { new ConfigJS(); } } catch(ex) {}; ``` But the missing piece is the instructions to set the binding for : alt-j : move one char to the left alt-i : move up one line alt-k : move down one line alt-l : move one char to the right The closest I get to understand this is with this other snippet ``` // remap Ctrl-J to downloads (removing it from focusing the browser bar) let search2 = window.document.getElementById('key_search2') search2.remove(); let openDownloads = window.document.getElementById('key_openDownloads') openDownloads.setAttribute("modifiers", "accel"); openDownloads.setAttribute("key", "J"); ``` But in this case I need to know the values to substitute "key_search2" for the corresponding key bindign "key_charleft","key_previouschar","key_charprev","cmd_charprev"? Any information on how to accomplish that would be greatly appreciated, thanks.

Du skal logge ind på din konto for at svare på et indlæg. Start et nyt spørgsmål, hvis du ikke har en konto endnu.