Bill Jonas on Tue, 25 Sep 2001 06:40:10 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

[PLUG] Mozilla keybindings


So I was looking around on http://www.mozilla.org/unix/customizing.html
and I've got to say there's some really neat stuff on there.

Like, for example, if you create
/usr/lib/mozilla/res/builtin/userHTMLBindings.xml and give it the
following contents:

<?xml version="1.0"?>

<bindings id="htmlBindings"
   xmlns="http://www.mozilla.org/xbl";
   xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";>

  <binding id="browserUser">
    <handlers>
      <handler event="keypress" key="h" command="cmd_scrollLeft"/>
      <handler event="keypress" key="j" command="cmd_scrollLineDown"/>
      <handler event="keypress" key="k" command="cmd_scrollLineUp"/>
      <handler event="keypress" key="l" command="cmd_scrollRight"/>
    </handlers>
  </binding>
    
</bindings>

...You get vi-like keybindings for moving the window around, like in
Konqueror (except I don't think that Konqueror implements h and l).

Now, from looking around at other keybindings files and at
<http://lxr.mozilla.org/seamonkey/source/dom/public/idl/events/nsIDOMKeyEvent.idl>,
I figured that I should be able to add a line like the following:

      <handler event="keypress" keycode="VK_BACK_SPACE" command="cmd_scrollPageUp" />

...to the handlers section above and be able to scroll up with my
backspace key.  However, when I attempt this, it clobbers the page down
function of my spacebar, although I can still use PageUp and PageDown.
I've tried various things such as adding DOM_ to the front of
VK_BACK_SPACE, omitting the VK_, removing the _ between BACK and SPACE,
and various combinations of these things, to no avail.  I'd really like
to be able to page up and page down without having to move my hand away
from the home row.  In the mean time I'm using Ctrl-j and Ctrl-k as page
up and page down keys.  (To do this yourself, use 'modifiers="accel"'
between the key and command declarations.)

Any ideas?

Wow.  While I was at it, I was about to ask how to make Ctrl-<Enter>
open a link in a new window when I'm using the keyboard, but it seems
the Mozilla developers already beat me to it.

-- 
Never forget.

______________________________________________________________________
Philadelphia Linux Users Group       -      http://www.phillylinux.org
Announcements-http://lists.phillylinux.org/mail/listinfo/plug-announce
General Discussion  -  http://lists.phillylinux.org/mail/listinfo/plug