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

awt_Component::GetJavaModifiers() should use GetKeyState() not GetAsyncKeyState(

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Duplicate
    • Affects Version/s: 1.4.0
    • Fix Version/s: None
    • Component/s: client-libs
    • Labels:
      None
    • Subcomponent:
    • CPU:
      unknown
    • OS:
      generic

      Description

      The method GetJavaModifiers() in src/win32/native/sun/windows/awt_Component.cpp calls GetAsyncKeyState() to get the state of the Control, Shift, etc. keys and then packages this info up into events (e.g. a WmKeyDown event). GetAsyncKeyState() gets the state of the keyboard at the time of the call, rather than at the time of the event (compare to GetKeyState()). This isn't a problem for user-driven input (e.g. a user hitting CTRL-RightArrow), but is a problem for native programs that generate keystrokes automatically, such as macro generators or screen readers. In fact, this is specifically a problem for the JAWS screen reader, which in some circumstances programatically generates CTRL-arrow key combinations.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              ehawkessunw Eric Hawkes (Inactive)
              Reporter:
              pkorn Peter Korn (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: