-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CLOSED] SpecRunnerUtils#SimulateKeyEvent should support modifier keys #10951
Comments
Comment by haslam22 Am I right in thinking we need to pass the modifier arguments to these two methods?
So perhaps the fourth parameter could be a modifiers list, such as: |
Comment by petetnt Not sure why those are there in the first place as they are deprecated from the spec 🤔 Nor I am sure if we could require all those hacks anymore either. IMHO it could just use KeyboardEvent constructor and the last parameter could/should just be an object containing all the values acccepted by the |
Comment by haslam22 I think the hacks are still required, for some reason it's still impossible to pass Here's the method updated to use the new KeyboardEvent constructor like you suggested, having the fourth argument be a KeyboardEventInit dictionary:
I've run the unit/integration tests and it seems to be all OK. Any thoughts, or should I create a pull request? |
Comment by petetnt Sure, open a PR and we can work forward from there 👍 |
Comment by petetnt Fixed in 7732d93 |
Issue by petetnt
Friday Oct 28, 2016 at 07:57 GMT
Originally opened as adobe/brackets#12859
Prerequisites
Debug \ Reload Without Extensions
?Description
There's a long running TODO in the SpecRunnerUtils here: https://github.com/adobe/brackets/blob/master/test/spec/SpecRunnerUtils.js#L998
Basically the
SimulateKeyEvent
method doesn't support modifier keys (ALT, CTRL, SHIFT and so on).See https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/getModifierState for modifier states available.
Notice that this change should be done in a non-API breaking way, for example by passing
{ modifier: KeyEvent.DOM_VK_ALT }
as the fourth parameter to theSimulateKeyEvent
Expected behavior: [What you expected to happen]
Modifier keys get applied to
SimulateKeyEvents
callsActual behavior: [What actually happened]
There's no way to apply modifier keys to Simulate
Versions
Marking this is a starter bug, but it might require some intermediate knowledge on how KeyEvents work in Chrome / etc.
The text was updated successfully, but these errors were encountered: