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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 1.4.0
    • client-libs
    • None
    • unknown
    • generic

      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.

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: