Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4180051

Wrong keyChars generated for Control characters

    XMLWordPrintable

Details

    • generic
    • generic

    Description

      When the a key combination using the CTRL modifier is typed, the wrong
      keyCharacter is generated. The behavior is different on Windows than
      on Solaris, but it is wrong on both. A test case is provided below.

      The behavior I would expect when typing CTRL-d into the textField
      in the test case is similar to the behavior I see when typing ALT-d
      or SHIFT-d into the textField. It should look like this:

      params= KEY_PRESSED,keyCode=17,keyChar='?'
      KeyChar: ? = 65535
      keyText= Ctrl

      params= KEY_PRESSED,keyCode=68,keyChar='d',modifiers=Ctrl
      KeyChar: d = 100
      keyText= D

      params= KEY_TYPED,keyCode=0,keyChar='d'
      KeyChar: d = 100
      keyText= Unknown keyCode: 0x0

      params= KEY_RELEASED,keyCode=68,keyChar='d',modifiers=Ctrl
      KeyChar: d = 100
      keyText= D

      params= KEY_RELEASED,keyCode=17,keyChar='?',modifiers=Ctrl
      KeyChar: ? = 65535
      keyText= Ctrl


      On Solaris, typing control characters produces garbage output on the xterm
      to which the ouput is sent. Even closing the application doesn't help -
      subsequent keypresses produce only garbage. The window has to be closed
      since it is now useless.

      The situation is not as bad on Windows. The keyCharacters are wrong,
      but that's about it. Here is some sample output:
       
      params= KEY_PRESSED,keyCode=17,keyChar='?',modifiers=Ctrl
      KeyChar: ? = 65535
      keyText= Ctrl

      params= KEY_PRESSED,keyCode=68,keyChar='?',modifiers=Ctrl
      KeyChar: ? = 4
      keyText= D

      params= KEY_TYPED,keyCode=0,keyChar='?',modifiers=Ctrl
      KeyChar: ? = 4
      keyText= Unknown keyCode: 0x0

      params= KEY_RELEASED,keyCode=68,keyChar='?',modifiers=Ctrl
      KeyChar: ? = 4
      keyText= D

      params= KEY_RELEASED,keyCode=17,keyChar='?'
      KeyChar: ? = 65535
      keyText= Ctrl


      On the Windows (DOS) output, the keyChar appears as extended characters,
      not as question marks.

      Attachments

        Activity

          People

            son Oleg Sukhodolsky (Inactive)
            ehawkessunw Eric Hawkes (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: