Keyboard event event.key is unidentified on android webview

Asked
Active3 hr before
Viewed126 times

8 Answers

keyboardunidentifiedandroidwebviewevent
90%

Keyboard event event.key is unidentified #1473,event.key is unidentified or event.keyCode is 229 always, its not react-native-webview issue its issue with android chrome browser – bittu Jun 25 at 16:12 , Stack Overflow Public questions & answers

The only workaround is dealing the actual input text:

inputElement.addEventListener('beforeinput', e => {
   if (e.inputType === 'deleteContentBackward') {
      // check whatever you want to check for
      if (!myCondition(e))
         e.preventDefault() // will block the deletion
   }
})
load more v
88%

Try load webview with this html on react native,event.key is unidentified or event.keyCode is 229 always, How change ui jitsi meet video library in android?,Ask Android Questions

Try load webview with this html on react native

    <div
          tabindex="1"
          contenteditable="true"
          id="test-test"
          style="width: 300px; height: 300px;"
        >
   </div>
   <script>
          document
            .getElementById(“test-test”)
            .addEventListener(“keydown”, function (e) {
              alert(e.key || e.keyCode || “empty”);
            });
   </script>
72%

Bug description: I have a texteditor ( quill.js ) in my webview, and there is a bug in it, enter ( new line ) does not change text focus, In this organization All GitHub ↵ Jump to ↵ ,react-native version: 62.2, No suggested jump to results

<div
      tabindex="1"
      contenteditable="true"
      id="test-test"
      style="width: 300px; height: 300px;"
    ></div>
    <script>
      document
        .getElementById("test-test")
        .addEventListener("keydown", function (e) {
          alert(e.key || e.keyCode || "empty");
        });
    </script>
65%

If the key cannot be identified, the returned value is Unidentified.,If the pressed key has a printed representation, the returned value is a non-empty Unicode character string containing the printable representation of the key.,If the pressed key is a control or special character, the returned value is one of the pre-defined key values.,As we finally release the shift key, another keyup event is fired for it, and the key attribute value remains Shift.

<div class="fx">
   <div>
      <textarea rows="5" name="test-target" id="test-target"></textarea>
      <button type="button" name="btn-reset" id="btn-reset">Reset</button>
   </div>
   <div class="flex">
      <pre id="console-log"></pre>
   </div>
</div>
load more v
75%

Ask questionsKeyboard event event.key is unidentified ,Bug description: I have a texteditor ( quill.js ) in my webview, and there is a bug in it, enter ( new line ) does not change text focus,Expected behavior: event.key or event.keyCode has value, Answer questions aliazizi

To Reproduce: Try load webview with this html

<div
      tabindex="1"
      contenteditable="true"
      id="test-test"
      style="width: 300px; height: 300px;"
    ></div>
    <script>
      document
        .getElementById("test-test")
        .addEventListener("keydown", function (e) {
          alert(e.key || e.keyCode || "empty");
        });
    </script>
40%

most often key is Unidentified,most often keyCode is 229,when the event is Unidentified then preventDefault() does not work,After running some experiments to track down, what is causing this event, we were able to understand the characteristics of that event:

Problem

Our error tracking software caught reports for Android users that were unable to use the beautiful input components we built. To apply our magic we listen to the HTML keydown event. We realized on Android the keyCode was 229 for almost every non-printable character, which left us perplex. Time for investigation.

keydown

Problem

Our error tracking software caught reports for Android users that were unable to use the beautiful input components we built. To apply our magic we listen to the HTML keydown event. We realized on Android the keyCode was 229 for almost every non-printable character, which left us perplex. Time for investigation.

keyCode

Problem

Our error tracking software caught reports for Android users that were unable to use the beautiful input components we built. To apply our magic we listen to the HTML keydown event. We realized on Android the keyCode was 229 for almost every non-printable character, which left us perplex. Time for investigation.

229
load more v
22%

Set when a key event has been synthesized to implement default behavior for an event that the application did not handle. ,Set when a key event has been synthesized to implement default behavior for an event that the application did not handle. Fallback key events are generated by unhandled trackball motions (to emulate a directional keypad) and by certain unhandled key presses that are declared in the key map (such as special function numeric keypad keys when numlock is off).,Deliver this key event to a Callback interface. If this is an ACTION_MULTIPLE event and it is not handled, then an attempt will be made to deliver a single normal event.,This key event was generated by a virtual (on-screen) hard key area. Typically this is an area of the touchscreen, outside of the regular display, dedicated to "hardware" buttons.

public static final int ACTION_DOWN
load more v
60%

XDA Developers was founded by developers, for developers. It is now a valuable resource for people who want to make the most of their mobile devices, from customizing the look and feel to adding new functionality., D Flex mode ruined... Latest: Dubini A moment ago Samsung Galaxy Z Fold 2 Guides, News, & Discussion , Topics Android Auto Android Mods Android TV Apps & Games Themes Wear OS Connected Car Q&A , Android Software Development

0

Other "keyboard-unidentified" queries related to "Keyboard event event.key is unidentified on android webview"