MozillaZine

keyconfig 20110522

Announce and Discuss the Latest Theme and Extension Releases.
phantomx

User avatar
 
Posts: 47
Joined: October 26th, 2004, 11:50 am

Post Posted December 26th, 2007, 11:23 am

dorando wrote:
phantomx wrote:The extension is installed and I can fire it, but the listing is empty.
Anything in the Tools > Error Console (set javascript.options.showInConsole to true in about:config)?

Yes, it shows three different messages:
  • <code>window.opener.keyconfig has no properties</code> (content/keyconfig.js @1)
  • <code>gPrefService has no properties</code> (content/keyconfig.js @18)
  • <code>target.keyconfig has no properties</code> (content/keyconfig.js @73)

Mhh... I wonder if I messed up somehow. I guess I'll start from zero again (when I had a bit more of time).

dorando
 
Posts: 1203
Joined: January 9th, 2004, 9:57 am

Post Posted December 29th, 2007, 2:55 pm

Louise6380 wrote:I want to set a shortcut for toggling show/hide of bookmarks and navigation toolbar but I can't find the command. Does anybody know how to do this?
Try
Code: Select all
var toolbar = document.getElementById("PersonalToolbar");
toolbar.collapsed = !toolbar.collapsed;
document.persist(toolbar.id, "collapsed");
. Replace "PersonalToolbar" with "nav-bar" for the Navigation Toolbar, or "toolbar-menubar" for the Menu.

phantomx wrote:
dorando wrote:
phantomx wrote:The extension is installed and I can fire it, but the listing is empty.
Anything in the Tools > Error Console (set javascript.options.showInConsole to true in about:config)?

Yes, it shows three different messages:
  • <code>window.opener.keyconfig has no properties</code> (content/keyconfig.js @1)
  • <code>gPrefService has no properties</code> (content/keyconfig.js @18)
  • <code>target.keyconfig has no properties</code> (content/keyconfig.js @73)
Mhh... I wonder if I messed up somehow. I guess I'll start from zero again (when I had a bit more of time).
Have you've applied the <a href="http://forums.mozillazine.org/viewtopic.php?p=2923606#2923606">app-startup</a> workaround?

phantomx

User avatar
 
Posts: 47
Joined: October 26th, 2004, 11:50 am

Post Posted December 29th, 2007, 4:01 pm

dorando wrote:
phantomx wrote:Yes, it shows three different messages:
  • <code>window.opener.keyconfig has no properties</code> (content/keyconfig.js @1)
  • <code>gPrefService has no properties</code> (content/keyconfig.js @18)
  • <code>target.keyconfig has no properties</code> (content/keyconfig.js @73)
Mhh... I wonder if I messed up somehow. I guess I'll start from zero again (when I had a bit more of time).

Have you've applied the <a href="http://forums.mozillazine.org/viewtopic.php?p=2923606#2923606">app-startup</a> workaround?

Well, I started from zero again, so I...
  1. Created and set <kbd>extensions.checkCompatibility</kbd> and <kbd>extensions.checkUpdateSecurity</kbd> to <kbd>false</kbd>
  2. Changed the function
    Code: Select all
    function keyconfigService() { }
    to
    Code: Select all
    function keyconfigService() {
      this.os.addObserver(this,"stupid-dummy",false);
    }
  3. Changed the code
    Code: Select all
    key = {node: document.createElement("key"), shortcut: "", pref: ["!",,,";"]}
    to
    Code: Select all
    key = {node: gDocument.createElement("key"), shortcut: "", pref: ["!",,,";"]}
and now it opens and populates the list, but I can't add a new key. I was trying to add a <kbd>Page Info</kbd> key with the code <code>BrowserPageInfo();</code> but nothing happened when I clicked on OK (or pressed Enter).

So, I still need some help...
Thanks.

Louise6380
 
Posts: 61
Joined: November 4th, 2007, 2:26 pm

Post Posted December 30th, 2007, 9:46 pm

dorando wrote:
Louise6380 wrote:I want to set a shortcut for toggling show/hide of bookmarks and navigation toolbar but I can't find the command. Does anybody know how to do this?
Try
Code: Select all
var toolbar = document.getElementById("PersonalToolbar");
toolbar.collapsed = !toolbar.collapsed;
document.persist(toolbar.id, "collapsed");
. Replace "PersonalToolbar" with "nav-bar" for the Navigation Toolbar, or "toolbar-menubar" for the Menu.

Thanks, it's working great!

dorando
 
Posts: 1203
Joined: January 9th, 2004, 9:57 am

Post Posted January 6th, 2008, 10:25 am

phantomx wrote:c. Changed the code
Code: Select all
key = {node: document.createElement("key"), shortcut: "", pref: ["!",,,";"]}
to
Code: Select all
key = {node: gDocument.createElement("key"), shortcut: "", pref: ["!",,,";"]}

and now it opens and populates the list, but I can't add a new key. I was trying to add a <kbd>Page Info</kbd> key with the code <code>BrowserPageInfo();</code> but nothing happened when I clicked on OK (or pressed Enter).

So, I still need some help...
Thanks.
:-k, that sounds like the last change wasn't applied (maybe Firefox was running while you tried to change it?), otherwise anything in Error Console?

phantomx

User avatar
 
Posts: 47
Joined: October 26th, 2004, 11:50 am

Post Posted January 6th, 2008, 11:34 am

dorando wrote::-k, that sounds like the last change wasn't applied (maybe Firefox was running while you tried to change it?), otherwise anything in Error Console?

Actually the error was more simple (actually, stupid): I did the changes and move it back to <kbd>keyconfig.jar</kbd>, but I never moved that one back to <kbd>keyconfig.xpi</kbd> =D>

Ok, now let's see what other brilliant mistake I did... when I set a duplicated key combination (e.g. Ctl+Alt+Z for <q>Undo close tab</q> and <q>key_undoCloseTab</q> it shows the message about it, but it also changes the key combination displayed for something like <samp>Alt+Unrecognized (VK_BACK_QUOTE)</samp>. It seems to work fine, though, but I'm not sure if that's because both actions did the same since the beginning.
—I guess I should disable one, but for historical reasons I chose to use both with the same trigger.

mastavic
 
Posts: 1088
Joined: March 28th, 2004, 12:18 am
Location: San Francisco/San Jose, California

Post Posted January 11th, 2008, 2:55 am

Can keyconfig fix this problem that I have? Thanks.

dorando
 
Posts: 1203
Joined: January 9th, 2004, 9:57 am

Post Posted January 15th, 2008, 9:42 am

phantomx wrote:Ok, now let's see what other brilliant mistake I did... when I set a duplicated key combination (e.g. Ctl+Alt+Z for <q>Undo close tab</q> and <q>key_undoCloseTab</q> it shows the message about it, but it also changes the key combination displayed for something like <samp>Alt+Unrecognized (VK_BACK_QUOTE)</samp>. It seems to work fine, though, but I'm not sure if that's because both actions did the same since the beginning.
—I guess I should disable one, but for historical reasons I chose to use both with the same trigger.
If you are using my <a href="http://forums.mozillazine.org/viewtopic.php?t=72992">undoclosetab</a> extension both keyboard shortcuts do call the same function and since <key>s should stop the event flow, it will be called only once. Note that it doesn't do much anymore in Firefox 2 if the browser.sessionstore.enabled is true in about:config (default value).

Regarding the Unrecognized, that just means the devs didn't assign a name in chrome://global/locale/keys.properties .

MaStAViC wrote:Can keyconfig fix this problem that I have? Thanks.
Has been answered there.

homoludens
 
Posts: 10
Joined: October 15th, 2007, 6:56 am

Post Posted January 18th, 2008, 9:03 am

I'm in the process of switching from WInXP to Linux.

Is it possible to transfer / export my keyconfig settings from WinXP? Is there a file that needs to be copied, or how should I go about it?

If possible, I'd really like to avoid having to set up everything from scratch again ...

dorando
 
Posts: 1203
Joined: January 9th, 2004, 9:57 am

Post Posted January 19th, 2008, 10:13 am

Changes are currently stored in the prefs.js file within your <a href="http://support.mozilla.com/kb/Profiles#Profile_folder_locations" title="Profile folder locations">Profile Folder</a>, copy those lines beginning with <code>user_pref("keyconfig</code>.

redhonker
 
Posts: 150
Joined: October 26th, 2007, 11:45 am

Post Posted January 25th, 2008, 7:08 am

Just got the latest version installed.

What I am trying to do is pretty simple: map a function key to close the tab. I tried to create a new key for F12, copy the code from Close Tab, but it does not change anything in FF.

What do I need to do to add F12 as close (in addition to ctrl-W)?

Thanks!

peteypiefrogworth
 
Posts: 10
Joined: June 27th, 2007, 4:57 pm

Post Posted January 25th, 2008, 7:11 am

I'd like to use keyconfig to get back the lovely find dialog instead of the horrible findbar in Thunderbird. There used to be an extension called Retro Find that did it, but it's long-gone (although it still works fine in Firefox!)

I just discovered tonight that javascript:find() will actually pop up the old-style find dialog!
However, simply adding a new key in keyconfig (in Thunderbird 2.0.0.9 in Windows Vista FWIW), with either
javascript:find()
or simply
find()
for the code, and with Global ticked or unticked, doesn't seem to work. I created the new key, assigned it to a key combination, and I get the dialog coming up. However, it never finds any results, and I'm trying it with words clearly there in the current message.

Can anybody help me? It'd be awesome to have a "Retro Find" option simply through a custom key in keyconfig!

[Please no objections along the lines of "why don't you like the findbar?"
I just don't, and I'm one of many. In particular, I don't like the way it starts finding straight away. A bugger if you make a typo!]

dorando
 
Posts: 1203
Joined: January 9th, 2004, 9:57 am

Post Posted January 25th, 2008, 10:27 am

redhonker wrote:Just got the latest version installed.

What I am trying to do is pretty simple: map a function key to close the tab. I tried to create a new key for F12, copy the code from Close Tab, but it does not change anything in FF.

What do I need to do to add F12 as close (in addition to ctrl-W)?

Thanks!
Adding a key with
Code: Select all
BrowserCloseTabOrWindow()
works for me. Note that you can duplicate keys by double clicking on an entry or by the (currently misnamed) right click > Edit this key.

peteypiefrogworth wrote:Can anybody help me?
Try
Code: Select all
content.find();
, but note that wrap doesn't seem to work.

redhonker
 
Posts: 150
Joined: October 26th, 2007, 11:45 am

Post Posted January 25th, 2008, 1:09 pm

I've added the following key

Name: Close Tab by Function Key
Shortcut: F12
ID: xxx_key__Close Tab by Function Key
Code: BrowserCloseTabOrWindow()
Global: yes

When I press F12, nothing happens

Do I need to modify prefs.js? Or tweak some other things?

Thanks!

peteypiefrogworth
 
Posts: 10
Joined: June 27th, 2007, 4:57 pm

Post Posted January 25th, 2008, 5:13 pm

dorando wrote:
peteypiefrogworth wrote:Can anybody help me?
Try
Code: Select all
content.find();
, but note that wrap doesn't seem to work.


Thanks heaps dorando! No wrap is a shame (I wonder if one could code something to get around that? I'll look into it) but having the find dialog popup is good enough for me!

Return to Extension/Theme Releases


Who is online

Users browsing this forum: No registered users and 1 guest