<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>18867</bug_id>
          
          <creation_ts>2012-09-13 06:11:56 +0000</creation_ts>
          <short_desc>Web developers cannot know whether a key event will cause text input actually</short_desc>
          <delta_ts>2013-08-17 22:20:15 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebAppsWG</product>
          <component>HISTORICAL - DOM3 Events</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>22071</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Masayuki Nakano">masayuki</reporter>
          <assigned_to name="Masayuki Nakano">masayuki</assigned_to>
          <cc>bugs</cc>
    
    <cc>garykac</cc>
    
    <cc>mike</cc>
    
    <cc>mounir</cc>
    
    <cc>termi1uc1</cc>
    
    <cc>www-dom</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>73743</commentid>
    <comment_count>0</comment_count>
    <who name="Masayuki Nakano">masayuki</who>
    <bug_when>2012-09-13 06:11:56 +0000</bug_when>
    <thetext>Under current D3E draft, .key and .char are always same value if the event is caused by a printable key. And the example for Ctrl+&apos;v&apos; defines the &apos;v&apos; key&apos;s .key and .char are &apos;v&apos;. So, the result of .getModifierState(&apos;Control&apos;) is the only difference between &apos;v&apos; key event with Ctrl and &apos;v&apos; key event without Ctrl key.

If web developers want to use text input editor with key events, they cannot know whether a key event would cause text input or not with .key or .char.

So, I&apos;d like to suggest that .key value should be same as current spec, but .char value should be empty string if the key event doesn&apos;t cause actual text input.

I.e.,

&apos;v&apos;:                     { key: &apos;v&apos;, char: &apos;v&apos; }
&apos;v&apos; with Shift:          { key: &apos;V&apos;, char: &apos;V&apos; }
&apos;v&apos; with Ctrl:           { key: &apos;v&apos;, char: &apos;&apos;  }
&apos;v&apos; with Ctrl and Shift: { key: &apos;V&apos;, char: &apos;&apos;  }</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73750</commentid>
    <comment_count>1</comment_count>
    <who name="Olli Pettay">bugs</who>
    <bug_when>2012-09-13 07:54:16 +0000</bug_when>
    <thetext>I like that approach, since it is hard to know which combination does
and which doesn&apos;t cause actual input. It all can be platform dependent.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>76304</commentid>
    <comment_count>2</comment_count>
    <who name="Egor Khalimonenko">termi1uc1</who>
    <bug_when>2012-10-15 13:51:47 +0000</bug_when>
    <thetext>I am posted the similar proposal to w3 mailing list http://lists.w3.org/Archives/Public/www-dom/2012JulSep/0108.html

In short, I proposed to &quot;key&quot; and &quot;char&quot; logical division. &quot;char&quot; property is an input character and it work as it describe in current draft. In the other hand, &quot;key&quot; property for any character keys with any special keys (Shift, Alt, Win/OS, Ctrl) is a US-en keyboard layout lowercased character representation similar to String.fromCharCode(key.keyCode).toLowerCase(). For non-character keys (http://www.w3.org/TR/DOM-Level-3-Events/#key-values-list) &quot;key&quot; property stay the same as in current drafg.

In example:
&apos;ы&apos;:                     { key: &apos;s&apos;, char: &apos;ы&apos; }
&apos;ы&apos; with Shift:          { key: &apos;s&apos;, char: &apos;Ы&apos;, shiftKey : true }
&apos;ы&apos; with Ctrl:           { key: &apos;s&apos;, char: &apos;&apos; , ctrlKey : true }
&apos;ы&apos; with Ctrl and Shift: { key: &apos;s&apos;, char: &apos;&apos; , shiftKey : true, ctrlKey : true }

As you can see the &quot;char&quot; property is useful only when it was a character input in some text field, in other cases we need cross-location case insensitive value to detect the current keyboard key pressed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82393</commentid>
    <comment_count>3</comment_count>
    <who name="Masayuki Nakano">masayuki</who>
    <bug_when>2013-01-31 09:17:09 +0000</bug_when>
    <thetext>I posted some additional detail to the ML:
http://lists.w3.org/Archives/Public/www-dom/2013JanMar/0098.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82570</commentid>
    <comment_count>4</comment_count>
    <who name="Egor Khalimonenko">termi1uc1</who>
    <bug_when>2013-02-05 06:44:21 +0000</bug_when>
    <thetext>I don&apos;t understand the desire to bring the same value to &quot;key&quot; and &quot;char&quot; properties. And I don&apos;t understand the desire to make our (js-developers) work harder. What are good reasons to modify &quot;key&quot; value when one of modifier key pressed? We have crtlKey, shiftKey and altKey for that. We have &quot;char&quot; property for the original input symbol. So why I need to write extra code to detect to key I need, while I have good-old &quot;keyCode&quot; value.

So instead use the new API, I will continue to use the old one.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84285</commentid>
    <comment_count>5</comment_count>
    <who name="Masayuki Nakano">masayuki</who>
    <bug_when>2013-03-12 02:42:45 +0000</bug_when>
    <thetext>(In reply to comment #4)
&gt; I don&apos;t understand the desire to bring the same value to &quot;key&quot; and &quot;char&quot;
&gt; properties.

Anyway, if you still think so even you see D4E&apos;s .code, please file a new bug. This bug is opened only for the spec change request of .char value.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87861</commentid>
    <comment_count>6</comment_count>
    <who name="Gary Kacmarcik">garykac</who>
    <bug_when>2013-05-18 01:19:43 +0000</bug_when>
    <thetext>If we get rid of &apos;char&apos; as proposed in bug 22071, then I don&apos;t believe this is an issue anymore.

Masayuki, please verify and close if you agree.  Or add details if you think this is still an issue that needs to be addressed. Thanks.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87866</commentid>
    <comment_count>7</comment_count>
    <who name="Masayuki Nakano">masayuki</who>
    <bug_when>2013-05-18 01:29:55 +0000</bug_when>
    <thetext>Absolutely. I&apos;ll close this bug after actually bug 22071 is fixed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>92227</commentid>
    <comment_count>8</comment_count>
    <who name="Gary Kacmarcik">garykac</who>
    <bug_when>2013-08-17 22:20:15 +0000</bug_when>
    <thetext>#22071 has been fixed in the latest ED.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>