keyconfig 20110522

Announce and Discuss the Latest Theme and Extension Releases.
Post Reply
dorando
Posts: 1203
Joined: January 9th, 2004, 9:57 am
Contact:

Post by dorando »

<code>var a = 'javascript.enabled'; gPrefService.setBoolPref(a,!gPrefService.getBoolPref(a));</code>
User avatar
echoes
Posts: 835
Joined: November 13th, 2005, 1:09 am
Location: Labyrinths of coral caves

Post by echoes »

dorando wrote:<code>var a = 'javascript.enabled'; gPrefService.setBoolPref(a,!gPrefService.getBoolPref(a));</code>


thanks! :D
sridhar
Posts: 184
Joined: June 18th, 2004, 2:54 pm
Contact:

Post by sridhar »

Code to paste (the URL in) clipboard in address bar and press Go please.

i.e., Alt+D followed by return key

ala ctrl+D in the latest Opera 9 preview.
old zeniko
Posts: 0
Joined: December 31st, 1969, 5:00 pm

Post by old zeniko »

Code: Select all

var url = readFromClipboard(); if (url) content.location = url;
romanmir
Posts: 20
Joined: March 11th, 2005, 12:34 pm

A question then

Post by romanmir »

maybe you can tell me the answers to 2 of my questions posted here: http://forums.mozillazine.org/viewtopic.php?t=380690? Thank you.
Zoolcar9
Posts: 2225
Joined: November 9th, 2004, 6:45 pm
Location: Jakarta, Indonesia (UTC+7)
Contact:

Post by Zoolcar9 »

sridhar wrote:Code to paste (the URL in) clipboard in address bar and press Go please.

i.e., Alt+D followed by return key

ala ctrl+D in the latest Opera 9 preview.

I already answered your question at TEM, haven't I?

My Firefox information | Add-ons | GitHub

"With great power, comes great desire to show it off."
alta88
Posts: 1029
Joined: January 28th, 2006, 3:08 pm

Post by alta88 »

hi all,

is it possible to have keys mapped a certain way only when a specific function or application is active?

specifically, i've installed Find Selection, which does a findAgain via Ctl-G on a selected text. it does this by invoking the Find toolbar function. i've remapped findAgain to be RightArrow (findPrevious to be LeftArrow), and it works fine. until i no longer want it to; breaking horizontal mouse scrolling is one side effect.

is there something like :findtoolbaractive or a js equivalent? or other method?
User avatar
OldManRivuh
Posts: 401
Joined: October 5th, 2004, 9:48 am
Location: Northern, CA

Post by OldManRivuh »

You can change the install.rdf for the keyconfig_20050908.1.xpi version
(and probably others) to make this extension work in Firefox 1.5.0.1 and
Thunderbird 1.5. Your mileage may vary, so do it at your own 'peril'.
When I upgraded to Thunderbird 1.5, it completely forgot about the keyconfig extension
for some reason. When I installed the modified version, my key assignments were still there.
(they should still be in user.js)

Code: Select all

    <targetApplication><rdf:Description>
      <id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</id>
      <minVersion>1.0</minVersion>
      <maxVersion>1.5.0.*</maxVersion>
    </rdf:Description></targetApplication>
   
    <targetApplication><rdf:Description>
      <id>{3550f703-e582-4d05-9a08-453d09bdfdc6}</id>
      <minVersion>1.0</minVersion>
      <maxVersion>1.5.0.*</maxVersion>
    </rdf:Description></targetApplication>
dorando
Posts: 1203
Joined: January 9th, 2004, 9:57 am
Contact:

Post by dorando »

alta88 wrote:hi all,

is it possible to have keys mapped a certain way only when a specific function or application is active?

specifically, i've installed Find Selection, which does a findAgain via Ctl-G on a selected text. it does this by invoking the Find toolbar function. i've remapped findAgain to be RightArrow (findPrevious to be LeftArrow), and it works fine. until i no longer want it to; breaking horizontal mouse scrolling is one side effect.

is there something like :findtoolbaractive or a js equivalent? or other method?
Adding <key>s with

Code: Select all

if(document.commandDispatcher.focusedWindow.getSelection() != "")
 stonie_findSelection(0);
else
 goDoCommand("cmd_scrollRight");
and

Code: Select all

if(document.commandDispatcher.focusedWindow.getSelection() != "")
 stonie_findSelection(1);
else
 goDoCommand("cmd_scrollLeft");
might be what you want.
alta88
Posts: 1029
Joined: January 28th, 2006, 3:08 pm

Post by alta88 »

yes, that works perfectly! thanks dorando.

opens up a lot of possibilities for customizing and resetting keys specific to apps.

so to understand how to apply this generically, how did you find the stonie_findSelection() as the particular function active? i actually would have thought is was the findtoolbar function at that level. or if you could point me somewhere i could read up, i'd be grateful.
dorando
Posts: 1203
Joined: January 9th, 2004, 9:57 am
Contact:

Post by dorando »

Normally I use DOM Inspector to find these, but in this case I took a look at the code.
Support mozilla.dorando.at through donations/contributions.
User avatar
LunaC
Posts: 57
Joined: March 6th, 2004, 1:14 pm
Location: Toronto, Canada

Post by LunaC »

Is there any way to remap 'shift delete', the one that deletes items in a drop down list (remembered searches, visited urls, etc)?

I read through this whole thread and must admit I haven't a clue what half of this means, so please talk to me like i'm a newb if you can describe how to remap it ;)
ddirks
Posts: 17
Joined: July 21st, 2003, 9:25 am

Function to paste a text string?

Post by ddirks »

Is there a function I can use to paste a static text string into the text box under the cursor? I'd like to map a keyboard shortcut to paste in a string.

If this is not possible with keyconfig (and after a none-too-thorough perusal of the messages in this forum, I'm not sure it is), does anyone know of a good extension to do this?

Finally, as someone attempting to learn about how this all works, is there a good reference somewhere that will tell me what sorts of functions are available? For example, I know I can use goDoCommand('cmd_delete'); in T-bird to delete the current message, but is there a list of all the things I can "goDoCommand" with? And more generally, to write a function that keyconfig can understand -- any suggestions of a good starting point?

Thanks for any help,
Doug
dorando
Posts: 1203
Joined: January 9th, 2004, 9:57 am
Contact:

Post by dorando »

LunaC wrote:Is there any way to remap 'shift delete', the one that deletes items in a drop down list (remembered searches, visited urls, etc)?
This is hardcoded in autocomplete.xml so it cannot be changed with keyconfig. It is likely possible to create a new shortcut with

Code: Select all

gURLBar.mController.handleDelete();


ddirks wrote:Is there a function I can use to paste a static text string into the text box under the cursor? I'd like to map a keyboard shortcut to paste in a string.
Following seems to work:

Code: Select all

var editor = (event.originalTarget instanceof Components.interfaces.nsIDOMNSEditableElement) ? event.originalTarget.editor : null
if(editor) {
  if(!editor.insertText) editor = editor.QueryInterface(Components.interfaces.nsIPlaintextEditor);
  editor.insertText("ABC");
}


ddirks wrote:Finally, as someone attempting to learn about how this all works, is there a good reference somewhere that will tell me what sorts of functions are available?
I use DOM Inspector, <a href="http://xulplanet.com/references/xpcomref/">XPCOM Reference</a> and the <a href="http://lxr.mozilla.org/mozilla/">source</a>, but this needs at least basic knowledge about various <a href="http://developer.mozilla.org/#Technologies">Technologies</a> used with the Mozilla platform.

ddirks wrote:Finally, as someone attempting to learn about how this all works, is there a good reference somewhere that will tell me what sorts of functions are available? For example, I know I can use goDoCommand('cmd_delete'); in T-bird to delete the current message, but is there a list of all the things I can "goDoCommand" with?
There is a list at <a href="http://www.mozilla.org/unix/customizing.html">Customizing Mozilla</a> in the section 'Legal commands for use in custom key bindings', but it might be totally outdated.
ddirks
Posts: 17
Joined: July 21st, 2003, 9:25 am

Post by ddirks »

Dorando,

Thanks for the code to paste a string. It works perfectly, and would have taken me a long time to discover on my own, I think.

Thanks also for the reference suggestions. I'll see where they lead me.
Post Reply