           editor.setText("abcd efg")
           editor.setCursorScreenPosition([0,2])
 
-          editor.trigger keydownEvent('d')
-          editor.trigger keydownEvent('b')
+          keydown('d', element: editor[0])
+          keydown('b', element: editor[0])
 
           expect(editor.getText()).toBe "cd efg"
           expect(editor.getCursorScreenPosition()).toEqual([0,0])


      describe "the h keybinding", ->
        it "moves the cursor left, but not to the previous line", ->
          editor.trigger keydownEvent('h')
          expect(editor.getCursorScreenPosition()).toEqual([1,0])
          editor.trigger keydownEvent('h')
          expect(editor.getCursorScreenPosition()).toEqual([1,0])

      describe "the j keybinding", ->
        it "moves the cursor down, but not to the end of the last line", ->
          editor.trigger keydownEvent 'j'
          expect(editor.getCursorScreenPosition()).toEqual([2,1])
          editor.trigger keydownEvent 'j'
          expect(editor.getCursorScreenPosition()).toEqual([2,1])

      describe "the k keybinding", ->
        it "moves the cursor up, but not to the beginning of the first line", ->
          editor.trigger keydownEvent('k')
          expect(editor.getCursorScreenPosition()).toEqual([0,1])
          editor.trigger keydownEvent('k')
          expect(editor.getCursorScreenPosition()).toEqual([0,1])

      describe "the l keybinding", ->
        it "moves the cursor right, but not to the next line", ->
          editor.setCursorScreenPosition([1,3])
          editor.trigger keydownEvent('l')
          expect(editor.getCursorScreenPosition()).toEqual([1,4])
          editor.trigger keydownEvent('l')
          expect(editor.getCursorScreenPosition()).toEqual([1,4])

      describe "the w keybinding", ->

          editor.setText("one two three four")
          editor.setCursorScreenPosition([0,11])

          keydown('d', element: editor[0])
          keydown('3', element: editor[0])
          keydown('b', element: editor[0])

          expect(editor.getText()).toBe "ee four"
          expect(editor.getCursorScreenPosition()).toEqual([0,0])
