Auto merge of #26675 - azerupi:doc-js-keyevent, r=alexcrichton
Auto merge of #26675 - azerupi:doc-js-keyevent, r=alexcrichton

Like explained in #26016, typing `?` had no effect with non-english keyboard layouts in the docs. 

This patch seems to resolve this issue, **tested with AZERTY keyboard in Google Chrome and Firefox**. I haven't tested it with more exotic keyboard layouts or with other browsers though.

This code is based on the information found on: http://javascript.info/tutorial/keyboard-events

**More specifically:**

> The only event which reliably provides the character is keypress.

**And**

>```
// event.type must be keypress
function getChar(event) {
  if (event.which == null) {
    return String.fromCharCode(event.keyCode) // IE
  } else if (event.which!=0 && event.charCode!=0) {
    return String.fromCharCode(event.which)   // the rest
  } else {
    return null // special key
  }
}
```

`?` and `S` work, `escape` however does not (on an Azerty keyboard). 

It would be good if some people could test it with other browsers and keyboard layouts: http://www.mathieudavid.org/test/rustdoc/std/index.html

**Edit:**
- swedish layout works on Firefox and Chromium
- french (azerty) mac layout works on Safari

pshc/rust,zubron/rust,dwillmer/rust,aidancully/rust,reem/rust,mvdnes/rust,KokaKiwi/rust,jroesch/rust,jroesch/rust,l0kod/rust,KokaKiwi/rust,pshc/rust,jashank/rust,jashank/rust,nwin/rust,zubron/rust,dwillmer/rust,jashank/rust,GBGamer/rust,nwin/rust,aidancully/rust,mvdnes/rust,graydon/rust,pshc/rust,GBGamer/rust,graydon/rust,graydon/rust,graydon/rust,graydon/rust,nwin/rust,aidancully/rust,reem/rust,mvdnes/rust,zubron/rust,reem/rust,zubron/rust,jashank/rust,zubron/rust,nwin/rust,aidancully/rust,pshc/rust,GBGamer/rust,mvdnes/rust,graydon/rust,l0kod/rust,mvdnes/rust,l0kod/rust,l0kod/rust,vhbit/rust,vhbit/rust,l0kod/rust,zubron/rust,aidancully/rust,pshc/rust,GBGamer/rust,jashank/rust,reem/rust,jroesch/rust,KokaKiwi/rust,reem/rust,GBGamer/rust,jroesch/rust,jroesch/rust,vhbit/rust,jroesch/rust,l0kod/rust,pshc/rust,dwillmer/rust,dwillmer/rust,dwillmer/rust,GBGamer/rust,jroesch/rust,mvdnes/rust,GBGamer/rust,KokaKiwi/rust,vhbit/rust,vhbit/rust,aidancully/rust,jroesch/rust,vhbit/rust,jashank/rust,jashank/rust,l0kod/rust,reem/rust,KokaKiwi/rust,dwillmer/rust,GBGamer/rust,KokaKiwi/rust,zubron/rust,nwin/rust,dwillmer/rust,pshc/rust,nwin/rust,l0kod/rust,nwin/rust,vhbit/rust,pshc/rust,nwin/rust,dwillmer/rust,vhbit/rust,jashank/rust,zubron/rust