keymaster icon indicating copy to clipboard operation
keymaster copied to clipboard

Added triggerKey

Open toots opened this issue 12 years ago • 5 comments

Hi,

It is nice to be able to trigger programatically a given key/shortcut.

Here's a patch to allow it, with proper tests.

Please consider for inclusion :-)

toots avatar May 10 '12 20:05 toots

Excellent work. This came up huge for helping write tests/specs for a bit of work depending on keymaster.

Thanks @toots!

jayroh avatar Jun 02 '12 14:06 jayroh

I think this is the same use case for PR #9 . As you can see, there's a better way to do the same without a triggering system.

gerardo avatar Dec 06 '12 19:12 gerardo

As @jayroh mentioned above and although it is unfortunately not very common yet in JS webapps, there is a strong case in favor of being able to trigger a key in testing/specing.

Until keymaster has such support for automated tests, I would not consider it fit for serious release in one of my webapp..

toots avatar Dec 06 '12 19:12 toots

@toots You realize that keymaster comes with automated tests that tests triggering keys with the proper DOM events for this?

madrobby avatar Dec 06 '12 19:12 madrobby

Yes, I've seen it but I would like to be able to write tests that do not rely on the DOM in order to test things in a more modular way..

toots avatar Dec 06 '12 19:12 toots