clnelson wrote:I'm not looking specifically for the save function, but rather the code or syntax to enter text or various ctrl-? commands. If I can't enter ctrl-? commands, simple text will suffice, but hopefully there's a way to do both.
You could try something like
Code: Select all
var utils = content.QueryInterface(Components.interfaces.nsIInterfaceRequestor).
getInterface(Components.interfaces.nsIDOMWindowUtils);
utils.sendKeyEvent("keypress", 0, "S".charCodeAt(0), event.CONTROL_MASK);
to send key presses or look up the corresponding code by double clicking on a key in keyconfig (or using the misnamed context menu > Edit this key).
For inserting text to the currently focused element something like
Code: Select all
sendText("Text");
function sendText(text) {
var utils = content.QueryInterface(Components.interfaces.nsIInterfaceRequestor).
getInterface(Components.interfaces.nsIDOMWindowUtils);
for(position in text)
utils.sendKeyEvent("keypress", 0, text.charCodeAt(position), 0);
}
or
Code: Select all
var editor = (commandDispatcher.focusedElement instanceof Components.interfaces.nsIDOMNSEditableElement) ?
commandDispatcher.focusedElement.editor : null;
if(!editor && commandDispatcher.focusedWindow.document.designMode == "on") {
var editingSession = commandDispatcher.focusedWindow
.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
.getInterface(Components.interfaces.nsIWebNavigation)
.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
.getInterface(Components.interfaces.nsIEditingSession);
editor = editingSession.getEditorForWindow(commandDispatcher.focusedWindow)
}
if(editor) {
editor instanceof Components.interfaces.nsIPlaintextEditor;
editor.insertText('Text');
}
should work.
stevvie wrote:anybody got this great plugin to work with minefield 20100703 and later as when the latest builds are used keyconfig has no entried in it preferences.
Add
Code: Select all
component {e9f7950e-d78d-4aaa-900a-c43588052eba} components/keyconfig-service.js
contract @dorando.at/keyconfig;1 {e9f7950e-d78d-4aaa-900a-c43588052eba}
category profile-after-change keyconfigService @dorando.at/keyconfig;1
to the end of chrome.manifest and
Code: Select all
function NSGetFactory() { return Factory; }
to the start of keyconfig-service.js.
hllwn wrote:1. I can switch between search engines with ctrl+up/down arrow while searchbar is focused. Can I make a keyconfig hotkey for that, which will work even searchbar is not focused?
Try (Ctrl+Down)
Code: Select all
document.getElementById("searchbar").selectEngine(event, true);
and (Ctrl+Up)
Code: Select all
document.getElementById("searchbar").selectEngine(event, false);
hllwn wrote:2. How can I toggle Show All History (PlacesCommandHook.showPlacesOrganizer('History');) with keyconfig?
Add another key to the Library (select it from the dropdown) containing