$(event.target) works on click, but not keydown... alternative?

$(event.target) works on click, but not keydown... alternative?

I have this script working just fine when I click on it using the mouse, but it doesn't trigger the while() loop if I move to it using arrows:

  1.  $('[data-ce]')
  2.       .on('keydown click', function(e) {
  3.             var node = $(e.target);

  4.             while (node.is('contenteditable') !== 'true') {
  5. alert('node - ' + node[0].nodeName);
  6. alert('this - ' + this.nodeName);

  7.                   if (node[0].nodeName == 'B' && !$('[data-richcont="B"]').hasClass('richbuttonOn'))
  8.                         $('[data-richcont="B"]').removeClass('richbuttonOff').addClass('richbuttonOn');

  9.                   node = node.parentNode;
  10.             }
  11.       });
  12. })

This is within a contenteditable section, much like the reply field in this forum. When the user has bolded something, I'm changing the class for the "Bold" button to highlight.

I'm pretty sure that the problem is that when I key over to the bolded section manually, $(e.target) becomes equal to "this" instead of to the innermost node.

Is $(e.target) the wrong thing to use here? If not, can you guys suggest how to make it recognize properly when I key over to it?