Last Comment Bug 201011 - custom key bindings no longer possible
: custom key bindings no longer possible
Status: NEW
: helpwanted, regression
Product: Core
Classification: Components
Component: Keyboard: Navigation (show other bugs)
: Trunk
: All All
: -- major with 57 votes (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
Mentors:
: 314099 (view as bug list)
Depends on:
Blocks: 57805
  Show dependency treegraph
 
Reported: 2003-04-07 05:27 PDT by ken hamilton
Modified: 2016-07-05 02:07 PDT (History)
60 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments

Description ken hamilton 2003-04-07 05:27:38 PDT
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3) Gecko/20030312
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3) Gecko/20030312

Contrary to documentation (http://mozilla.org/unix/customizing.html#keys), it is
not possible to customize key-bindings.  Nor is possible to even turn off the
pre-defined ones.  This is a regression and a serious deficiency for editing in
the composer.  Please see the following discussion for specifics.

http://groups.google.com/groups?dq=&hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=3E8DF29F.8040309%40netscape.com&prev=/groups%3Fhl%3Den%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26group%3Dnetscape.public.mozilla.editor

Reproducible: Always

Steps to Reproduce:
1. Try to customize key bindings as documented.
2. Restart Mozilla.
3. Notice that bindings do not take effect.
Actual Results:  
Default keybindings were still in effect.

Expected Results:  
Mozilla should have respected my customization.
Comment 1 Boris Zbarsky [:bz] 2003-04-07 09:05:07 PDT
Do we fastload things like this?
Comment 2 Akkana Peck 2003-05-05 10:31:22 PDT
Confirming and changing platform to all -- it's a problem on linux too.
Comment 3 Akkana Peck 2003-05-05 10:35:14 PDT
Apparently bugzilla doesn't actually reassign or confirm when a Product change
is involved.  Trying again.
Comment 4 Aaron Leventhal 2003-05-06 01:24:20 PDT
Don't assign this to me if you want it fixed any time soon.

Any takers?
Comment 5 Jeff Venters 2003-05-08 17:45:10 PDT
Somebody needs to take this a little more seriously.  Its hard enought to remap
key bindings normally.   

I've been unable to remap Browser:Open or Browser:OpenFile.

Now its completely broken.  Please assign this to someone who can fix it!
Comment 6 Akkana Peck 2003-05-19 10:52:19 PDT
Apparently bryner changed something that might have horked keybindings.

Another probably related key binding problem that regressed at roughly the same
time: when I start up mozilla, the platform key bindings no longer work in the
urlbar.  After I visit a url, they start working again (I think I've seen them
break again later, but I'm not sure about that).
Comment 7 Brian Ryner (not reading) 2003-05-19 13:53:38 PDT
Akkana: which checkin are you referring to? (I know of a few candidates)
Comment 8 Akkana Peck 2003-05-19 14:21:21 PDT
I was hoping you could tell us.  I don't know what horked key bindings a few
months ago, and we're all looking for someone who might know.  Your name was
suggested.
Comment 9 Samir Gehani 2003-05-30 15:16:01 PDT
adt: nsbeta1-
Comment 10 Akkana Peck 2003-10-30 18:35:55 PST
For anyone tracking this: Modifying the installed
res/builtin/platformHTMLBindings.xml seems to work for me in NS7.1/Linux (I'll
try it asap in more recent mozillas and other platforms).  I've updated the
customizing document to say so and to point to this bug re the currently
nonworking userHTMLBindings.xml instructions.
Comment 11 Akkana Peck 2004-06-17 15:41:08 PDT
This was always intended to use a file in the user's profile directory
somewhere, not in $appdir/res/builtin where the fixed binding files are, so I
hope that if this is fixed, it can be fixed that way.

Bug 108417, bug 68950, and bug 12911 said that there would be a resource: url to
refer to files in the user's profile, but I can't find anything like that in
nsResProtocolHandler.cpp, and bug 137006, implementing relative prefs for mail
profiles, seems to use strings like "%Profile%ImapMail/imap.mail.netcenter.com"
then use nsPrefBranch::GetComplexValue().  The parsing code may be in
NS_GetPersistentFile(), but that lives inside mailnews so it's not much help to
anyone else.  Conrad (cc'ing), what's the approved way of doing this now, and is
it documented anywhere?
Comment 12 Dietrich Ayala (:dietrich) 2005-09-25 15:47:58 PDT
modifying platformHTMLBindings.xml does *not* work for me on WinXP.

modifying
/Applications/Firefox.app/Content/MacOS/res/builtin/platformHTMLBindings.xml
does not work for me on MacOS Tiger.

both using Firefox 1.0.7
Comment 13 sonnenstrahl 2005-09-26 09:32:48 PDT
(In reply to comment #12)
> modifying platformHTMLBindings.xml does *not* work for me on WinXP.
> 
> modifying
> /Applications/Firefox.app/Content/MacOS/res/builtin/platformHTMLBindings.xml
> does not work for me on MacOS Tiger.

I used to edit [...]/res/builtin/userHTMLBindings.xml and it worked very well.
That doesn't work on the newer Mozilla and Seamonkey builds either. The last
working build I have is from June 14 2005.
Comment 14 Phil Ringnalda (:philor, back in August) 2005-10-27 14:48:13 PDT
*** Bug 314099 has been marked as a duplicate of this bug. ***
Comment 15 Jochem Huhmann 2005-11-11 01:43:52 PST
In recent versions of Firefox (1.5RC1) platformHTMLbindings.xml was hidden away in toolkit.jar.

In 1.5RC2 it has totally vanished. No way to fix that anymore. No way to do per-user bindings anyway. Nothing in the releasenotes, too. Could someone dig into that problem and smack the developers responsible for this silent breakage over the head, please? With an IBM Model M keyboard?

Really, this is the worst regression I had with Firefox for a long time.
Comment 16 Boris Zbarsky [:bz] 2005-11-11 05:36:45 PST
> was hidden away in toolkit.jar.

More precisely, it was moved to toolkit.jar to fix bug 296764 (which was that if JS is disabled the whole file had no effect at all).

> In 1.5RC2 it has totally vanished.

I still see it in toolkit.jar in the Linux version of 1.5RC2...

Comment 17 Jochem Huhmann 2005-11-12 03:59:17 PST
(In reply to comment #16)
> > was hidden away in toolkit.jar.
> 
> More precisely, it was moved to toolkit.jar to fix bug 296764 (which was that
> if JS is disabled the whole file had no effect at all).

Interesting... Would be even more important then to a) make sure platform-specific bindings work out of the box (like the Emacs bindings in OS X) and b) allow user-specific bindings (since fiddling around in toolkit.jar is not a thing a user should be forced to do).

> > In 1.5RC2 it has totally vanished.
> 
> I still see it in toolkit.jar in the Linux version of 1.5RC2...

Yes, I was just plain wrong here, sorry.

Comment 18 Adam Katz 2005-12-30 13:43:35 PST
See also the mozillazine knowledge base wiki, which details how to install custom key bindings system-wide in newer versions of Firefox: http://kb.mozillazine.org/Emacs_Keybindings_%28Firefox%29
Comment 19 ken hamilton 2007-09-28 05:50:34 PDT
As the original reporter of this issue, I have to report that I have installed XKeymacs (as suggested above) on all my Windows systems, and it has been quite satisfactory at resolving my main complaints regarding Firefox bindings (as well as improving my entire experience with Windows).
Comment 20 m. 2007-09-28 05:55:43 PDT
I wanted to reconfigure some of the keybindings, I've followed the kb article, unfortunately there's not toolkit.jar on my system.. maybe it's because I'm using Iceweasel from Debian?
Or is the kb article no longer true for FF 2.0.0.7
Comment 21 JEK 2008-11-04 09:37:45 PST
Any update on the status?

This would be extremely valuable for a lot of us.

Been broken a loooonnnggg  time...

See also comments in #314099
Comment 22 Paul Gaskin 2009-03-07 17:51:08 PST
I stumbled onto this bug after I began to use Emacs as my editor every day. I found myself searching in FF by typing /search_string and then ctrl+g for repeating the query down through the document.

Well, in Emacs, ctrl+g quits whatever command you have begun to write in the mini-buffer. In Emacs, I use ctrl-s for searching and repeating the search. In Firefox, that saves the file, which I don't do very often.

The bottom line is that two of my favorite programs which I use all day each day are causing me grief because their key-bindings are different. 

I turned on emacs key-bindings in gnome using this:
gconftool-2 --set /desktop/gnome/interface/gtk_key_theme Emacs --type string

I got that tip here:
http://kb.mozillazine.org/Emacs_Keybindings_(Firefox)

Still, it's not enough. I need full control of all the key-bindings.
Comment 23 David A Thompson 2009-06-12 14:20:50 PDT
I've inadvertently sent form content into oblivion more than once with CTRL-W (blame emacs...). Although a 'warn before closing' feature might be nice, it seems like the key bindings are really the underlying issue. Sure would be nice to have a straightforward front-end to specify firefox key bindings... rather than a mish-mash of ui.key.foo prefs, mods to .gtkrc-2.0, edits to various xml files buried here and there, etc...
Comment 24 David Bolter [:davidb] 2009-06-16 11:28:45 PDT
Mass un-assigning bugs assigned to Aaron.
Comment 25 Greg Engel 2010-05-18 12:30:09 PDT
http://www.mozilla.org/unix/customizing.html#keys

This section seems woefully out of date - most of the files referenced no longer exist
Comment 26 Steven Webb 2011-01-16 01:19:32 PST
I managed to successfully change my key bindings using the keyconfig extensions:

http://forums.mozillazine.org/viewtopic.php?t=72994
http://pqrs.org/firefox/extensions/functions_for_keyconfig/index.html#t0p1
Comment 27 Jeremy Electronic 2011-09-04 15:49:23 PDT
There's an extension called 'keysnail' which allows very fine grained control and a wealth of other functionality for adjusting keyboard controls for your Firefox sessions.  It's geared toward emacs users but is excellent for general customization.

See https://github.com/mooz/keysnail/wiki

For a tweaked out starting point (disclaimer: not mine, and YMMV) check out https://github.com/re5et/.dotfiles/blob/master/.keysnail.js
Comment 28 steve rader 2012-09-25 12:47:14 PDT
(In reply to Greg Engel from comment #25)
> http://www.mozilla.org/unix/customizing.html#keys
> 
> This section seems woefully out of date - most of the files referenced no
> longer exist

For native custom keybindings in for example SeaMonkey 2.12.1...

1) build from source (e.g.https://developer.mozilla.org/en-US/docs/Simple_SeaMonkey_build)

2) add handlers for bindings to objdir/mozilla/dist/bin/chrome/toolkit/content/global/platformHTMLBindings.xml
and/or objdir/mozilla/dist/bin/chrome/comm/content/navigator/platformNavigationBindings.xul

(This assumes you have mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/objdir in .mozconfig when building.)

My vaguely vi/unix-ish customizations for platformHTMLBindings.xml are...
      <handler event="keypress" key="k" command="cmd_linePrevious" />
      <handler event="keypress" key="j" command="cmd_lineNext" />
      <handler event="keypress" key="h" command="cmd_charPrevious" />
      <handler event="keypress" key="l" command="cmd_charNext" />
      <handler event="keypress" key="b" modifiers="control" command="cmd_movePageUp"/>
      <handler event="keypress" key="f" modifiers="control" command="cmd_movePageDown"/>
      <handler event="keypress" key="0" command="cmd_moveTop"/>
      <handler event="keypress" key="g" modifiers="shift" command="cmd_moveBottom"/>

And in platformNavigationBindings.xul I use...
    <key key="n" command="cmd_newNavigatorTab" modifiers="control"/>
    <key key="c" command="Browser:Back" modifiers="control"/>
    <key key="d" command="cmd_close" modifiers="control"/>
    <key key="o" command="focusURLBar"/>    
    <key key="m" oncommand="handleURLBarCommand('none',event);" modifiers="control"/>

Note well: SeaMonkey (2.12.1) somehow caches these files, so changes to them only "take"
effect under special circumstances.  I don't know the correct way to trigger "recaching".
The method I use that works is to first execute a much older SeaMonkey version (i.e. 2.1b1.)
Comment 29 micsu 2014-11-13 09:03:57 PST Comment hidden (advocacy)

Note You need to log in before you can comment on or make changes to this bug.