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 »

A simple toggle would be

Code: Select all

MsgToggleThreaded();
but a more correct way would be

Code: Select all

var viewFlags = GetDBView().viewFlags

if(viewFlags & nsMsgViewFlagsType.kThreadedDisplay
&& !(viewFlags & nsMsgViewFlagsType.kGroupBySort))
 MsgSortUnthreaded();
else
 MsgSortThreaded();
Support mozilla.dorando.at through donations/contributions.
ddirks
Posts: 17
Joined: July 21st, 2003, 9:25 am

code for "Show Images" button in T-bird

Post by ddirks »

Hi,

I'm looking for the cmd_ code that corresponds to the "Show Images"
button in the message view window in Thunderbird, which really wants
a keyboard shortcut.

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

Post by dorando »

No cmd_ but DOM Inspector suggests:

Code: Select all

LoadMsgWithRemoteContent();
Support mozilla.dorando.at through donations/contributions.
ddirks
Posts: 17
Joined: July 21st, 2003, 9:25 am

Post by ddirks »

dorando wrote:No cmd_ but DOM Inspector suggests:

Code: Select all

LoadMsgWithRemoteContent();


Yes, that's it all right. Thanks, dorando...
chrispix
Posts: 2
Joined: November 28th, 2006, 5:57 pm

Typing -- too quickly in input or textarea loses focus

Post by chrispix »

I'm running keyconfig 20060828 in Firefox 2.0 on OS X 10.4.8, and have come across a strange bug. If I type certain characters twice in quick succession while in a text input field or textarea, I lose focus. It happens at least with the following characters:

- (hyphen)
_ (underscore)
! (exclamation)

If I disable keyconfig, the problem goes away. I don't have any key mappings for those keys. Has anyone else seen this problem? It's easily reproducible for me, including in the input boxes on this site. The only place it doesn't seem to happen is in the body field in gmail (although it does happen in the to and subject fields).
dorando
Posts: 1203
Joined: January 9th, 2004, 9:57 am
Contact:

Post by dorando »

Try to disable other extensions, if you haven't already, as there is always the chance that a conflict happens somewhere. You could also try to set keyconfig.profile (in about:config) to something else to test if a shortcut has been misapplied.
Support mozilla.dorando.at through donations/contributions.
User avatar
Mickey73
Posts: 26
Joined: March 4th, 2006, 12:16 pm
Location: Toronto

Post by Mickey73 »

Hi there,

How can I make shortcuts to "Reload All Tabs", "Reload All Other Tabs", Reload Right Tabs", "Reload Left Tabs", and "Open a Tab to the Right of the Current Tab"?

Thank you.
Hugin
Posts: 3
Joined: December 11th, 2006, 3:59 pm

Post by Hugin »

Two quick questions:

1) When a text box on a web form currently has focus, is there a way to get KeyConfig to still recognize key presses of the directional arrow keys? I'd like to be able to use up, down, left, and right shortcuts while these form elements have focus if possible.

2) Is there an easy way to allow KeyConfig shortcuts to do things like call functions in a webpage? For example, if I had a calculator program prebuilt with JavaScript on a website somewhere and I wanted to bind F12 to call the ClearAll function via KeyConfig, is this even possible? Obviously F12 would do nothing if there was no ClearAll function on a given webpage, but as long as it worked when there was a ClearAll function, that's all I'm after.

Thanks for your time,
Brad :)
sinoslav
Posts: 13
Joined: October 18th, 2005, 5:24 am

Post by sinoslav »

Hi,

What's the code for Edit | Rewrap?
dorando
Posts: 1203
Joined: January 9th, 2004, 9:57 am
Contact:

Post by dorando »

"Reload All Tabs"

Code: Select all

gBrowser.reloadAllTabs(gBrowser.mContextTab);
"Reload All Other Tabs"

Code: Select all

var browsers = gBrowser.browsers;
var i = 0;
var l = browsers.length;
var x = gBrowser.mCurrentTab._tPos;

for(; i < l; i++)
 if(i != x) try { browsers[i].reload(); } catch(err){};
"Reload Right Tabs"

Code: Select all

var browsers = gBrowser.browsers;
var i = gBrowser.mCurrentTab._tPos + 1;
var l = browsers.length;

for(; i < l; i++)
 try { browsers[i].reload(); } catch(err){};
"Reload Left Tabs"

Code: Select all

var browsers = gBrowser.browsers;
var i = gBrowser.mCurrentTab._tPos - 1;
var l = -1;

for(; i > l; i--)
 try { browsers[i].reload(); } catch(err){};
"Open a Tab to the Right of the Current Tab"

Code: Select all

var x = gBrowser.mCurrentTab._tPos + 1;
gBrowser.moveTabTo(gBrowser.selectedTab = gBrowser.addTab("about:blank"), x);

Hugin wrote:1) When a text box on a web form currently has focus, is there a way to get KeyConfig to still recognize key presses of the directional arrow keys? I'd like to be able to use up, down, left, and right shortcuts while these form elements have focus if possible.
Those won't reach a <key>, so keyconfig can't help here. You should be able to achieve this by creating a binding file (myHTMLBindings.xml) with following content:

Code: Select all

<?xml version="1.0"?>

<bindings xmlns="http://www.mozilla.org/xbl">
 <binding id="inputFields" extends="chrome://global/content/platformHTMLBindings.xml#inputFields">
  <handlers>
   <handler event="keypress" keycode="VK_LEFT"><![CDATA[

   ]]></handler>
   <handler event="keypress" keycode="VK_RIGHT"><![CDATA[

   ]]></handler>
   <handler event="keypress" keycode="VK_UP"><![CDATA[

   ]]></handler>
   <handler event="keypress" keycode="VK_DOWN"><![CDATA[

   ]]></handler>
  </handlers>
 </binding>
</bindings>
, inserting the appropriate code between each <handler></handler> (you might want to append event.preventDefault(); to your code blocks), and adding following to your userContent.css

Code: Select all

input[type="text"], input:not([type]) {
 -moz-binding: url("resource:///res/myHTMLBindings.xml#inputFields") !important;
}
(this assumes that you've placed the file within the 'res' folder within the Firefox folder)

Hugin wrote:2) Is there an easy way to allow KeyConfig shortcuts to do things like call functions in a webpage? For example, if I had a calculator program prebuilt with JavaScript on a website somewhere and I wanted to bind F12 to call the ClearAll function via KeyConfig, is this even possible? Obviously F12 would do nothing if there was no ClearAll function on a given webpage, but as long as it worked when there was a ClearAll function, that's all I'm after.
content.wrappedJSObject.ClearAll();

sinoslav wrote:What's the code for Edit | Rewrap?
goDoCommand("cmd_rewrap");
User avatar
Mickey73
Posts: 26
Joined: March 4th, 2006, 12:16 pm
Location: Toronto

Post by Mickey73 »

Thank you very much dorando, I'll try them right now.
monkey.mexicali
Posts: 3
Joined: December 12th, 2005, 2:18 pm

Post by monkey.mexicali »

Hi,

Apologies if this has been answered before, but is there a way to easily transfer or backup the custom key bindings that I've made with keyconfig? For example, I've added 10 bindings so that I can use Alt-1 through Alt-0 instead of Ctrl-1 through Ctrl-0 to switch among the first 10 tabs. If I want to duplicate these bindings on other installs of Firefox, should I just copy all the

user_pref("keyconfig.main*

entries in prefs.js?
Hugin
Posts: 3
Joined: December 11th, 2006, 3:59 pm

Post by Hugin »

Wow, thanks a bunch dorando! Helped a lot, much appreciated. :)
dorando
Posts: 1203
Joined: January 9th, 2004, 9:57 am
Contact:

Post by dorando »

monkey.mexicali wrote:If I want to duplicate these bindings on other installs of Firefox, should I just copy all the

user_pref("keyconfig.main*

entries in prefs.js?
Yes.
chrispix
Posts: 2
Joined: November 28th, 2006, 5:57 pm

Post by chrispix »

chrispix wrote:I'm running keyconfig 20060828 in Firefox 2.0 on OS X 10.4.8, and have come across a strange bug. If I type certain characters twice in quick succession while in a text input field or textarea, I lose focus. It happens at least with the following characters:

- (hyphen)
_ (underscore)
! (exclamation)

If I disable keyconfig, the problem goes away. I don't have any key mappings for those keys. Has anyone else seen this problem? It's easily reproducible for me, including in the input boxes on this site. The only place it doesn't seem to happen is in the body field in gmail (although it does happen in the to and subject fields).


dorando wrote:Try to disable other extensions, if you haven't already, as there is always the chance that a conflict happens somewhere. You could also try to set keyconfig.profile (in about:config) to something else to test if a shortcut has been misapplied.


Well, I un-installed and re-installed keyconfig, and the problem is gone now.
Post Reply