Skip to content
This repository has been archived by the owner on Nov 29, 2018. It is now read-only.

IE: Javascript event details claim meta keys (control, shift, alt) aren't held down #4973

Open
lukeis opened this issue Mar 4, 2016 · 3 comments

Comments

@lukeis
Copy link
Member

lukeis commented Mar 4, 2016

Originally reported on Google Code with ID 4973

Sending a CONTROL or SHIFT key followed by a character, either by sendKeys or an Actions
class call, when the javascript event is fired for the character, it should have ctrlKey/shiftKey
set to true.  This is not currently the case.

This means that if a page hooks an event listener for Ctrl + FunctionKey, rather than
the event listener being called, the default browser action is taken as if control
were not pressed - for example Ctrl + F12 should not bring up the F12 developer tools,
but it does.  Interestingly, this appears to be FunctionKey specific - Ctrl + a will
select all of the text on the page, but the javascript event will still be fired claiming
ctrl was not pressed.


By inspecting with Spy++, the exact same events are being sent to the browser as are
sent when actually pressing the keys.  It seems that IE is itself checking the keyboard
state (possibly via the process-local GetKeyboardState), and overriding whatever we
spoof.


There doesn't appear to be a way to override this behaviour other than forcing the
window to focus and using SendInput to send the control/shift character.  The WebDriver
spec does not allow focus to be required, and so we cannot do this.

Reported by dawagner on 2013-01-04 11:32:43


- _Attachment: [Bug.java](https://storage.googleapis.com/google-code-attachments/selenium/issue-4973/comment-0/Bug.java)_ - _Attachment: [index.html](https://storage.googleapis.com/google-code-attachments/selenium/issue-4973/comment-0/index.html)_
@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Issue 4972 has been merged into this issue.

Reported by dawagner on 2013-01-04 11:32:57

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Hi,
I am experiencing the same issue. Currently I am using selenium-server-standalone-2.35.0
and IEDriverServer - 2.35.3.0. I have the problem sending keys(CONTROL, SHIFT and ALT)
followed by character. Is there any update on this issue? Or what's the chance that
the issue wont be fixed at all?

Reported by peter.stephen.marin on 2013-10-08 10:35:45

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Reported by luke.semerau on 2015-09-17 17:45:10

  • Labels added: Restrict-AddIssueComment-Commit

@SeleniumHQ SeleniumHQ locked and limited conversation to collaborators Mar 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant