Hey fellow internet enthusiasts :)
I've been experimenting with an addon SDK and I've run into a problem. I want my addon to display an input box when I press Ctrl + T. The code works fine in my regular Firefox version because I've removed the new tab shortcut (Ctrl + T).
// Setting up key event handlers for each browser window
var {observer} = require("sdk/keyboard/observer");
var map = [];
observer.on("keydown", function(event) {
keylogger(event);
});
observer.on("keyup", function(event) {
keylogger(event);
});
function keylogger(e){
map[e.keyCode] = e.type == 'keydown';
if(map[17] && map[84]){
// Run custom code here
};
}
The problem arises when I use this code in the application spawned from 'cfx run' in the console, where the binding is still active. I believe it's because the application is a clean version of Firefox. I don't want to unbind the shortcut just for debugging purposes. My goal is for the addon to check if the binding exists when someone installs it, and either prompt them to unbind it or do it automatically. Does anyone know how to achieve this? Is there a way to access the current keybindings?
Thanks for any help, suggestions, or feedback :)