-
Notifications
You must be signed in to change notification settings - Fork 220
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
Sending 'Enter' key event on input field #45
Comments
I don't remember the details, but I do remember having the exact same issue. This code worked for me: https://github.com/ChromeDevTools/EmulatedDeviceLab/blob/master/lib/device.js#L192 Try providing |
Also, looking at the protocol docs, you are providing invalid value for |
Thank you so much for the help. It is a bit late now to test it out, but it looks very promising. |
I'm communicating directly to Chrome via websocket (without going through chrome-remote-interface). For me I use Input.dispatchKeyEvent and '\r' to send the enter key event and it works for my use case (simulating enter on input boxes). |
async pressedEnter() {
await Input.dispatchKeyEvent({ "type": "rawKeyDown", "windowsVirtualKeyCode": 13, "unmodifiedText": "\r", "text": "\r" })
await Input.dispatchKeyEvent({ "type": "char", "windowsVirtualKeyCode": 13, "unmodifiedText": "\r", "text": "\r" })
await Input.dispatchKeyEvent({ "type": "keyUp", "windowsVirtualKeyCode": 13, "unmodifiedText": "\r", "text": "\r" })
} it works for me |
The issue was originally submitted to 'chrome-remote-interface' repo at cyrus-and/chrome-remote-interface#226 and I was redirected to this repo.
Is Chrome running in a container? NO
My issue is with firing 'Enter' key on input field.
I thought that the code
await Input.dispatchKeyEvent({ type: 'rawKeyDown', keyIdentifier: 'Enter' })
would work, but it did not.This is my code:
Any help will be appreciated. Thanks!
The text was updated successfully, but these errors were encountered: