Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7861781
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T22:52:21+00:00 2026-06-02T22:52:21+00:00

Is it possible to track keydown/keyup events in FireFox addons? I would like to

  • 0

Is it possible to track keydown/keyup events in FireFox addons?
I would like to implement something similar as following scenario:

  • After pressing and holding the modifier key panel appears
  • While holding these modifier keys, pressing the other keys will cause some actions with the panel
  • When modifier key released, the panel disappears
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T22:52:30+00:00Added an answer on June 2, 2026 at 10:52 pm

    You would need to register your event listener in each browser window for that. The high-level SDK API don’t give you direct access to the browser window however, you will have to use the low-level modules for that, in particular the (currently undocumented) sdk/keyboard/observer module. It allows you to listen to key events in all browser windows, so something like this should work:

    // Register key event handlers in each browser window
    var {observer} = require("sdk/keyboard/observer");
    
    observer.on("keydown", function(event) {
      // Ignore events that have been handled elsewhere (e.g. by the web page)
      if (event.defaultPrevented)
        return;
    
      if (...)
        panel.show();
    });
    observer.on("keyup", function(event) {
      // Ignore events that have been handled elsewhere (e.g. by the web page)
      if (event.defaultPrevented)
        return;
    
      if (...)
        panel.hide();
    });
    

    Notes:

    • sdk/keyboard/observer module is completely undocumented, it might change or go away completely any time.
    • Originally the solution proposed here used WindowTracker from the sdk/window-utils module which is now deprecated. If you really want to look at browser windows yourself you would now use the (also undocumented) sdk/windows/observer module which allows listening to open and close events. The function isBrowser() to distinguish browser windows is now available via sdk/window/utils module. You would also need to use windows() function to consider already open windows, the windows observer doesn’t do that automatically.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to track a variable change in Javascript? I would like to
Is it possible to track hash links like pages with google analytics? For example,
Is it possible to track XWindow protocol with a tool? I thought wireshark would
Possible Duplicate: Google Analytics to track FireFox extension use I tried injecting a script
I'm using git to track a project, and if it's possible, I'd like to
Is it possible to track visitor that leave or page to another sites, like
I would like to track changing keywords on the streaming API (from a java
Is it possible to track the accelerometer value while under the lock screen? I
Is it possible to track each date about what day (Monday through Sunday) it
I want to prevent sending file on hotmail/gmail accounts. Is it possible to track

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.