title: Send a numpad key (with Num Lock off)
body: <p>I want to test how my app reacts to numpad keys. I found in <a href="https://www.w3.org/TR/webdriver/" rel="nofollow noreferrer">https://www.w3.org/TR/webdriver/</a> specs that for example for Numpad Home (with location = <code>DOM_KEY_LOCATION_NUMPAD</code> = <code>3</code>) a symbol <code>\uE057</code> should be used. However, it doesn't work for me: I get Home with default location (<code>0</code>), moreover, <code>event.code</code> is empty. It gives me a different result when I physically press NUMPAD7 button with Num Lock off: it that case, I get correct location <code>3</code> and <code>event.code</code> is <code>Numpad7</code>.</p>
  <pre class="lang-java prettyprint-override"><code>var options = FirefoxOptions();
  options.setLogLevel(FirefoxDriverLogLevel.TRACE);
  var driver = FirefoxDriver(options);
  driver.navigate().to(&quot;https://keycode.info/&quot;);
  driver.findElementByTagName(&quot;body&quot;).sendKeys(&quot;\uE057&quot;);
  </code></pre>
  <p>So how can I send such a key? I'm now thinking of manual recording of generated events when I physically press a key, and then sending these events via Selenium's execution of JS script. However, I haven't tried it yet; maybe there is a better way to do it in Selenium; maybe there is another framework that allows it better.</p>
  <p>By the way, I've filed a <a href="https://github.com/mozilla/geckodriver/issues/1854" rel="nofollow noreferrer">similar ticket in geckodriver</a> because it looks like a bug of webdriver to me...</p>