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

Backslash char is code 220, not 5C. Others chars also mapped incorrectly.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4
    • 1.2.0
    • 1.1.3, 1.2.0
    • client-libs
    • 1.2fcs
    • x86
    • windows_95, windows_nt
    • Not verified

    Description



      Name: joT67522 Date: 11/05/97


      I'm trying to map key codes to key characters. VK_BACKSLASH is defined as 5Ch, or 92 decimal.
      Yet when I trap key events and display the key code, it prints 220 decimal. There are other
      punctuation characters that don't work, such as slash, comma, open and closed brackets, and
      a few others. I had to hard code their decimal values because the VK constants did not have
      the correct values.

      To populate my hash table for key lookups, I had to use:

       keyTable.put( ".", new Integer( 190 ) );
       keyTable.put( "/", new Integer( 191 ) );
       keyTable.put( ";", new Integer( 186 ) );
       keyTable.put( "=", new Integer( 187 ) );
       keyTable.put( "\\", new Integer( 220 ) );
       keyTable.put( "[", new Integer( 219 ) );
       keyTable.put( "]", new Integer( 221 ) );
       keyTable.put( ",", new Integer( 188 ) );

      For others, I used:

      keyTable.put( "F1",
                            new Integer( KeyEvent.VK_F1 ) );
      keyTable.put( "F2",
                            new Integer( KeyEvent.VK_F2 ) );
      keyTable.put( "F3",
                            new Integer( KeyEvent.VK_F3 ) );
       keyTable.put( "F4",
                            new Integer( KeyEvent.VK_F4 ) );
      keyTable.put( "F5",
                            new Integer( KeyEvent.VK_F5 ) );

      Why am I doing all of this? We have to may Retail POS keyboards to 101 key
      mappings. Some keys on the keyboard send out alpha chars, others send out
      numpad chars, and other send out special chars like F1. Our application allows
      the user to remap the keys for different application functions. That is what the
      hash table is for.


      (Review ID: 19747)
      ======================================================================

      Attachments

        Issue Links

          Activity

            People

              ehawkessunw Eric Hawkes (Inactive)
              johsunw Joon Oh (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: