luke-chang / js-spatial-navigation

A javascript-based implementation of Spatial Navigation.
Mozilla Public License 2.0
370 stars 117 forks source link

Repeated navigation #25

Open acontreras89 opened 6 years ago

acontreras89 commented 6 years ago

Feature request

When sn:willmove events are originated by key presses (i.e e.detail.cause === 'keydown'), it would be nice to know what value the original event's repeat flag had.

var willmoveProperties = {
  direction: direction,
  sectionId: currentSectionId,
  cause: 'keydown',
  repeat: evt.repeat // this is everything we need to add
};

I would love to have this information available on all events, but this is the simplest one to implement. Also, whether or not this makes sense for focus-related events might need some discussion, while here fits pretty nicely.

I can prepare a PR if needed.