<?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="inputFields" extends="resource://gre/res/builtin/htmlBindings.xml#inputFieldsBase">
    <handlers>
      
      <handler event="keypress" keycode="VK_UP"   command="cmd_beginLine"/>
      <handler event="keypress" keycode="VK_DOWN" command="cmd_endLine"/>
      <handler event="keypress" keycode="VK_UP"   modifiers="shift" command="cmd_selectBeginLine"/>
      <handler event="keypress" keycode="VK_DOWN" modifiers="shift" command="cmd_selectEndLine"/>
      <handler event="keypress" keycode="VK_UP"   modifiers="accel" command="cmd_beginLine"/>
      <handler event="keypress" keycode="VK_DOWN" modifiers="accel" command="cmd_endLine"/>

      <handler event="keypress" keycode="VK_LEFT"  modifiers="alt" command="cmd_wordPrevious"/>
      <handler event="keypress" keycode="VK_RIGHT" modifiers="alt" command="cmd_wordNext"/>
      <handler event="keypress" keycode="VK_LEFT"  modifiers="alt,shift" command="cmd_selectWordPrevious"/>
      <handler event="keypress" keycode="VK_RIGHT" modifiers="alt,shift" command="cmd_selectWordNext"/>

      <handler event="keypress" keycode="VK_LEFT"  modifiers="accel" command="cmd_beginLine"/>
      <handler event="keypress" keycode="VK_RIGHT" modifiers="accel" command="cmd_endLine"/>
      <handler event="keypress" keycode="VK_LEFT"  modifiers="accel,shift" command="cmd_selectBeginLine"/>
      <handler event="keypress" keycode="VK_RIGHT" modifiers="accel,shift" command="cmd_selectEndLine"/>
      <handler event="keypress" keycode="VK_BACK" modifiers="alt" command="cmd_deleteWordBackward"/>
    </handlers>
  </binding>

  <binding id="textAreas" extends="resource://gre/res/builtin/htmlBindings.xml#textAreasBase">
    <handlers>
      <handler event="keypress" keycode="VK_HOME" command="cmd_scrollTop"/>
      <handler event="keypress" keycode="VK_END"  command="cmd_scrollBottom"/>
      <handler event="keypress" keycode="VK_HOME" modifiers="shift" command="cmd_scrollTop"/>
      <handler event="keypress" keycode="VK_END" modifiers="shift" command="cmd_scrollBottom"/>
      <handler event="keypress" keycode="VK_PAGE_UP" command="cmd_scrollPageUp"/>
      <handler event="keypress" keycode="VK_PAGE_DOWN" command="cmd_scrollPageDown"/>

      <handler event="keypress" keycode="VK_UP"   modifiers="accel" command="cmd_moveTop"/>
      <handler event="keypress" keycode="VK_DOWN" modifiers="accel" command="cmd_moveBottom"/>
      <handler event="keypress" keycode="VK_UP"   modifiers="accel,shift" command="cmd_selectTop"/>
      <handler event="keypress" keycode="VK_DOWN" modifiers="accel,shift" command="cmd_selectBottom"/>

      <handler event="keypress" keycode="VK_UP"   modifiers="alt" command="cmd_movePageUp"/>
      <handler event="keypress" keycode="VK_DOWN" modifiers="alt" command="cmd_movePageDown"/>
      <handler event="keypress" keycode="VK_UP"   modifiers="alt,shift" command="cmd_selectPageUp"/>
      <handler event="keypress" keycode="VK_DOWN" modifiers="alt,shift" command="cmd_selectPageDown"/>

      <handler event="keypress" keycode="VK_LEFT"  modifiers="alt" command="cmd_wordPrevious"/>
      <handler event="keypress" keycode="VK_RIGHT" modifiers="alt" command="cmd_wordNext"/>
      <handler event="keypress" keycode="VK_LEFT"  modifiers="alt,shift" command="cmd_selectWordPrevious"/>
      <handler event="keypress" keycode="VK_RIGHT" modifiers="alt,shift" command="cmd_selectWordNext"/>

      <handler event="keypress" keycode="VK_LEFT"  modifiers="accel" command="cmd_beginLine"/>
      <handler event="keypress" keycode="VK_RIGHT" modifiers="accel" command="cmd_endLine"/>
      <handler event="keypress" keycode="VK_LEFT"  modifiers="accel,shift" command="cmd_selectBeginLine"/>
      <handler event="keypress" keycode="VK_RIGHT" modifiers="accel,shift" command="cmd_selectEndLine"/>
      <handler event="keypress" keycode="VK_BACK" modifiers="alt" command="cmd_deleteWordBackward"/>
    </handlers>
  </binding>

  <binding id="browser">
    <handlers>
      <handler event="keypress" keycode="VK_PAGE_UP" command="cmd_scrollPageUp"/>
      <handler event="keypress" keycode="VK_PAGE_DOWN" command="cmd_scrollPageDown"/>

      <handler event="keypress" keycode="VK_LEFT" modifiers="alt" command="cmd_wordPrevious" />
      <handler event="keypress" keycode="VK_RIGHT" modifiers="alt" command="cmd_wordNext" />
      <handler event="keypress" keycode="VK_LEFT" modifiers="alt,shift" command="cmd_selectWordPrevious" />
      <handler event="keypress" keycode="VK_RIGHT" modifiers="alt,shift" command="cmd_selectWordNext" />
      <handler event="keypress" keycode="VK_LEFT" modifiers="shift" command="cmd_selectCharPrevious" />
      <handler event="keypress" keycode="VK_RIGHT" modifiers="shift" command="cmd_selectCharNext" />
      <handler event="keypress" keycode="VK_UP" modifiers="shift" command="cmd_selectLinePrevious" />
      <handler event="keypress" keycode="VK_DOWN" modifiers="shift" command="cmd_selectLineNext" />
	</handlers>
  </binding>

  <binding id="editor">
    <handlers>
      <handler event="keypress" keycode="VK_HOME" command="cmd_scrollTop" /> 
      <handler event="keypress" keycode="VK_END"  command="cmd_scrollBottom" /> 
      <handler event="keypress" keycode="VK_HOME" modifiers="shift" command="cmd_scrollTop"/>
      <handler event="keypress" keycode="VK_END" modifiers="shift" command="cmd_scrollBottom"/>
      <handler event="keypress" keycode="VK_PAGE_UP" command="cmd_scrollPageUp"/>
      <handler event="keypress" keycode="VK_PAGE_DOWN" command="cmd_scrollPageDown"/>

      <handler event="keypress" keycode="VK_LEFT"  modifiers="alt" command="cmd_wordPrevious" /> 
      <handler event="keypress" keycode="VK_RIGHT" modifiers="alt" command="cmd_wordNext" /> 
      <handler event="keypress" keycode="VK_LEFT"  modifiers="shift,alt" command="cmd_selectWordPrevious" /> 
      <handler event="keypress" keycode="VK_RIGHT" modifiers="shift,alt" command="cmd_selectWordNext" /> 

      <handler event="keypress" keycode="VK_LEFT"  modifiers="accel" command="cmd_beginLine"/>
      <handler event="keypress" keycode="VK_RIGHT" modifiers="accel" command="cmd_endLine"/>
      <handler event="keypress" keycode="VK_LEFT"  modifiers="accel,shift" command="cmd_selectBeginLine"/>
      <handler event="keypress" keycode="VK_RIGHT" modifiers="accel,shift" command="cmd_selectEndLine"/>

      <handler event="keypress" keycode="VK_DELETE" modifiers="shift" command="cmd_deleteCharForward" /> 

      <handler event="keypress" keycode="VK_UP"   modifiers="alt" command="cmd_movePageUp"/>
      <handler event="keypress" keycode="VK_DOWN" modifiers="alt" command="cmd_movePageDown"/>
      <handler event="keypress" keycode="VK_UP"   modifiers="alt,shift" command="cmd_selectPageUp"/>
      <handler event="keypress" keycode="VK_DOWN" modifiers="alt,shift" command="cmd_selectPageDown"/>
      
      <handler event="keypress" keycode="VK_UP"   modifiers="accel" command="cmd_moveTop"/>
      <handler event="keypress" keycode="VK_DOWN" modifiers="accel" command="cmd_moveBottom"/>
      <handler event="keypress" keycode="VK_UP"   modifiers="accel,shift" command="cmd_selectTop"/>
      <handler event="keypress" keycode="VK_DOWN" modifiers="accel,shift" command="cmd_selectBottom"/>
      <handler event="keypress" keycode="VK_BACK" modifiers="alt" command="cmd_deleteWordBackward"/>
    </handlers>
  </binding>

   
</bindings>
