autogcd
autogcd copied to clipboard
KeyboardEvent fired as a result of SendKeys does not have all the fields set properly
When you issue a SendKey() the resulting keydown/keypress/keyup events do not have code, keyCode, which fields set.
Example: inputs[0].SendKeys("a") results in:
altKey:false
bubbles:true
cancelBubble:false
cancelable:true
charCode:0
code:""
composed:true
ctrlKey:false
currentTarget:null
defaultPrevented:false
detail:0
eventPhase:0
isComposing:false
isTrusted:true
key:"a"
keyCode:0
location:0
metaKey:false
path:Array(5)
repeat:false
returnValue:true
shiftKey:false
sourceCapabilities:InputDeviceCapabilities
srcElement:input#txt
target:input#txt
timeStamp:0
type:"keydown"
view:Window
which:0
whereas a real key generates:
altKey:false
bubbles:true
cancelBubble:false
cancelable:true
charCode:0
code:"KeyA"
composed:true
ctrlKey:false
currentTarget:null
defaultPrevented:false
detail:0
eventPhase:0
isComposing:false
isTrusted:true
key:"a"
keyCode:65
location:0
metaKey:false
path:Array(5)
repeat:false
returnValue:true
shiftKey:false
sourceCapabilities:InputDeviceCapabilities
srcElement:input#txt
target:input#txt
timeStamp:184020.115
type:"keydown"
view:Window
which:65
Thanks for the report. I'll be honest, the key handling in autogcd is pretty garbage, I will look at re-writing it to be more standardized with how chromium actually handles key strokes.
I temporally use EvaluateScript("$(#id).keydown()") to send key and trigger js functions