MozillaZine

custom keyboard shortcuts, bindings

Discussion of features in Seamonkey
aplesch

User avatar
 
Posts: 8
Joined: July 3rd, 2003, 9:51 pm

Post Posted July 3rd, 2003, 10:19 pm

Today I set out to assign a shortcut key (or keyboard binding) to the rewrap function in Mail. I use Netscape 7.1. From pine I was used to use ctrl-j to rewrap long lines somewhat intelligently and rewrap in Mail provides the same functionality. It is only really useful when available in a shortcut since it is a editing command used while typing and formatting.

My first assumption that there may be prefs for each keyboard binding. Wrong. After some googling I found on mozilla.org a page which explains. Now, I cannot find the link. The page mentions

htmlBindings.xml
platformHTMLBindings.xml

in res/builtin and shows a way to add custom shortcuts in a separate file whose name must then be registered somewhere else. One also has to find which element or widget it is to which the command is applied. DOM inspector came to the rescue and showed the mail compose window has an "editor" element. The shortcut keys for the editor element are assigned in the editor section in platformHTMLBindings.xml. DOM inspector also showed the function name to be assigned to the keyboad shortcut for rewrapping is "cmd_rewrap". I had found out by searching the source code on mozilla.org before and this was good live confirmation. I decided to edit platformHTMLBindings.xml directly and just added this line

<handler event="keypress" key="j" modifiers="control" command="cmd_rewrap"/>

to the editor section in the file. After restarting, it worked somewhat to my surprise. In Mail I can now rewrap by typing ctrl-j(ustify).

Of course, there should be a much easier way to customize shortcuts.

Andreas

aplesch

User avatar
 
Posts: 8
Joined: July 3rd, 2003, 9:51 pm

Post Posted July 3rd, 2003, 10:50 pm

subject line as reference

raj_bhaskar

User avatar
 
Posts: 1894
Joined: November 7th, 2002, 3:50 am
Location: Glasgow, Scotland

Post Posted July 4th, 2003, 5:03 am

See also bug 57805

aplesch

User avatar
 
Posts: 8
Joined: July 3rd, 2003, 9:51 pm

Post Posted July 4th, 2003, 3:06 pm

voted for this bug
and added my comment to the bug
Andreas

aplesch

User avatar
 
Posts: 8
Joined: July 3rd, 2003, 9:51 pm

Post Posted July 8th, 2003, 12:18 pm

http://www.mozilla.org/unix/customizing.html#keys

relevant mozilla.org link for completeness

myuseraccount
 
Posts: 2
Joined: May 18th, 2003, 10:10 pm

Post Posted July 10th, 2003, 10:16 am

I tried the keybinding instructions, with no success. I ended up having to hack navigatorOverlay.xul inside comm.jar, just to get the keybindings of Navigator 7 (ctrl-O for the open-URL dialog instead of open-file). MSIE still opens this window (on both ctrl-L and ctrl-O), so why make it so hard for someone who used Netscape 7.x or MSIE? Sorry, I know that's an old holy war.

I can live with tweaking stuff to fix Mozilla keybindings, and fortunately there are others hoping for a GUI tool to do it. But Phoenix/Firebird does not even have that dialog at all! I thought, OK, another setback, so I'll just bind ctrl-F to open-file and add ctrl-O to focus-URL-bar. Just my luck, there's a bug so the keybinding XUL doesn't work in Firebird. Another bug for me to vote for, and I'll keep using Mozilla until they fix it. But please, bring back the dialog for heaven's sake! Netscape 7.x, Mozilla 1.x, MSIE, and even Opera all have it, so there's no excuse for getting rid of the thing, especially if Firebird is slated to become the only Mozilla Browser and compete in the browser world.

aplesch

User avatar
 
Posts: 8
Joined: July 3rd, 2003, 9:51 pm

Post Posted July 10th, 2003, 11:29 am

Did you find overlap in the bindings, assignments defined in

navigatorOverlay.xul inside comm.jar

and

platformHTMLBindings.xml ?



Andreas

Return to SeaMonkey Features


Who is online

Users browsing this forum: No registered users and 1 guest