keyconfig 20110522

Announce and Discuss the Latest Theme and Extension Releases.
Post Reply
tanstaafl_bh
Posts: 602
Joined: July 29th, 2003, 7:49 am
Contact:

Re: keyconfig 20080929

Post by tanstaafl_bh »

dorando wrote:Try

Code: Select all

var FindToolbar = document.getElementById("FindToolbar");

if(
document.commandDispatcher.focusedElement != FindToolbar._findField.inputField) {
 SetFocusMessagePane();
 FindToolbar.onFindCommand();
}
 else {
 FindToolbar.close();
}
 
and

Code: Select all

var textWidget = document.getElementById(QuickFilterManager.textBoxDomId);

if(!
QuickFilterBarMuxer.activeFilterer.visible || document.commandDispatcher.focusedElement != textWidget.inputField) {
 QuickFilterBarMuxer._showFilterBar(true);
 textWidget.select();
}
 else {
 QuickFilterBarMuxer._showFilterBar(false);
}
 

So... just replace the code in the two keys I created for Ctrl-F and Ctrl-Alt-F respectively with the above?

Question: QuickFilterBar is for the new Quickfilter toolbar, and FindToolbar is for the 'Find in this message' toolbar, right?

Thanks!
hllwn
Posts: 54
Joined: March 6th, 2010, 9:52 pm

Re: keyconfig 20080929

Post by hllwn »

clnelson wrote:Hi All,

I've browsed through this thread but was unable to find a simple function I'm trying to do. Specifically, I'm rotating between tabs and need to do something like:

Go to tab 1
Ctrl-S
Go to tab 2

I've pieced together the source to look something like:

gBrowser.selectTabAtIndex(0, event);
?
gBrowser.selectTabAtIndex(2, event);

I'm not sure what the second line should be. It seems simple and I've tried entering various commands without success. Any suggestions?


If you are referring to Save Page As... (Ctrl+S)

Code: Select all

saveDocument(window.content.document);
dorando
Posts: 1203
Joined: January 9th, 2004, 9:57 am
Contact:

Re: keyconfig 20080929

Post by dorando »

tanstaafl_bh wrote:So... just replace the code in the two keys I created for Ctrl-F and Ctrl-Alt-F respectively with the above?

Question: QuickFilterBar is for the new Quickfilter toolbar, and FindToolbar is for the 'Find in this message' toolbar, right?
Yes to both.
clnelson
Posts: 4
Joined: July 2nd, 2010, 10:50 am

Re: keyconfig 20080929

Post by clnelson »

hllwn wrote:
clnelson wrote:Hi All,

I've browsed through this thread but was unable to find a simple function I'm trying to do. Specifically, I'm rotating between tabs and need to do something like:

Go to tab 1
Ctrl-S
Go to tab 2

I've pieced together the source to look something like:

gBrowser.selectTabAtIndex(0, event);
?
gBrowser.selectTabAtIndex(2, event);

I'm not sure what the second line should be. It seems simple and I've tried entering various commands without success. Any suggestions?


If you are referring to Save Page As... (Ctrl+S)

Code: Select all

saveDocument(window.content.document);

Hi Hllwyn,

Thanks for the reply. 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. Back to my original example, something like this would be ideal:

gBrowser.selectTabAtIndex(0, event);
[block of text] or [ctrl command]
gBrowser.selectTabAtIndex(2, event);
hllwn
Posts: 54
Joined: March 6th, 2010, 9:52 pm

Re: keyconfig 20080929

Post by hllwn »

I still clearly didnt get your purpose. [block of text] will be copied to clipboard or will be entered into a form? And you mean all commands including ctrl?
Can you give a solid example of what you want to achieve after rotating a tab?
tanstaafl_bh
Posts: 602
Joined: July 29th, 2003, 7:49 am
Contact:

Re: keyconfig 20080929

Post by tanstaafl_bh »

dorando wrote:
tanstaafl_bh wrote:So... just replace the code in the two keys I created for Ctrl-F and Ctrl-Alt-F respectively with the above?

Question: QuickFilterBar is for the new Quickfilter toolbar, and FindToolbar is for the 'Find in this message' toolbar, right?
Yes to both.

Thanks! I really appreciate your help and patience... :)
clnelson
Posts: 4
Joined: July 2nd, 2010, 10:50 am

Re: keyconfig 20080929

Post by clnelson »

hllwn wrote:I still clearly didnt get your purpose. [block of text] will be copied to clipboard or will be entered into a form? And you mean all commands including ctrl?
Can you give a solid example of what you want to achieve after rotating a tab?

Sure, I can elaborate more. After rotating from tab 2 to tab 1, I would like keyconfig to enter text as well. For example, I want to build a macro in keyconfig that rotates to the first tab, inserts the text "I approve" into a text box, and rotates back to the second tab. I'm not sure if Keyconfig is capable of this macro functionality, but I thought I'd give a shot.
User avatar
stevvie
Posts: 220
Joined: June 12th, 2007, 9:21 am

Re: keyconfig 20080929

Post by stevvie »

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.

Thanks
Intel 3750k@4.3Ghz, Asrock Z77 Extreme4, 2X8Gb g.skill DDR3 2400,R9 280X,Benq 24inch monitor, Kingstone hyperX 240gb, -2X Samsung F3 1TB (raid0) with a 60 gib ssd cache, Segate 2TB, -Optiarc 7200s, -ADSL BT infinity 80mb
hllwn
Posts: 54
Joined: March 6th, 2010, 9:52 pm

Re: keyconfig 20080929

Post by hllwn »

Two questions:
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?
2. How can I toggle Show All History (PlacesCommandHook.showPlacesOrganizer('History');) with keyconfig?

Thanks in advance.
dorando
Posts: 1203
Joined: January 9th, 2004, 9:57 am
Contact:

Re: keyconfig 20080929

Post by dorando »

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;{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

Code: Select all

close();   
User avatar
stevvie
Posts: 220
Joined: June 12th, 2007, 9:21 am

Re: keyconfig 20080929

Post by stevvie »

dorando, thank you SOOO much, now this great addon still works with the latest minefield nightly that are breaking ALOT of plugins.
Intel 3750k@4.3Ghz, Asrock Z77 Extreme4, 2X8Gb g.skill DDR3 2400,R9 280X,Benq 24inch monitor, Kingstone hyperX 240gb, -2X Samsung F3 1TB (raid0) with a 60 gib ssd cache, Segate 2TB, -Optiarc 7200s, -ADSL BT infinity 80mb
Hywel
Posts: 25
Joined: May 31st, 2008, 12:59 am

Re: keyconfig 20080929

Post by Hywel »

I've made the corrections posted by Dorando but still have keyconfig incompatible with the latest Minefield, can anybody tell me how to make it compatible?
Please forgive my ignorance.
Cheers
hgabreu
Posts: 1
Joined: July 7th, 2010, 6:16 am

Re: keyconfig 20080929

Post by hgabreu »

How do I disable defaults ctrl+page up/down shortcuts?
So that pages can catch them. I've not found these on the list to simply click 'disable'.

Thanks,
Henrique Abreu
dorando
Posts: 1203
Joined: January 9th, 2004, 9:57 am
Contact:

Re: keyconfig 20080929

Post by dorando »

Hywel wrote:I've made the corrections posted by Dorando but still have keyconfig incompatible with the latest Minefield, can anybody tell me how to make it compatible?
Please forgive my ignorance.
Cheers
Anything in the Tools > Error Console (set javascript.options.showInConsole to true in about:config)?

hgabreu wrote:How do I disable defaults ctrl+page up/down shortcuts?
So that pages can catch them. I've not found these on the list to simply click 'disable'.
Those are defined in a way which can't be supported in a generic way, but you can try pasting the following into the Tools > Error Console

Code: Select all

top.opener.gBrowser.setAttribute("handleCtrlPageUpDown",false); top.opener.document.persist("content","handleCtrlPageUpDown");   
, if you want to reverse it try

Code: Select all

top.opener.gBrowser.removeAttribute("handleCtrlPageUpDown"); top.opener.document.persist("content","handleCtrlPageUpDown");   
This will be saved in your localstore.rdf.
Hamid_Y2K
Posts: 20
Joined: July 8th, 2010, 4:59 am

Re: keyconfig 20080929

Post by Hamid_Y2K »

I want to code this option to disable and enable it to make shortcuts
"reload every tab" to Enable/Disable on active tab and one code for all tab "reload tab every" active to Disable ?
and code "switch page direction".
Excuse me for my bad English [-o< ](*,) :-"
thanks
Post Reply