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

Toolkit.getLockingKeyState() does not work on XToolkit, but works on Motif

    Details

    • Subcomponent:
    • Resolved In Build:
      b48
    • CPU:
      x86
    • OS:
      linux, linux_sun
    • Verification:
      Not verified

      Description

      Toolkit.getLockingKeyState() is supposed to return the ststus of CAPS Lock, Num Lock and Scroll lock keys when called with respect to those key codes. This is supported on Motif and works fine on Motif. But with XToolkit, this method is throwing an unsupported operation exception. Though this exception is documented, this behavior is not compatible with previous releases since XToolkit is the default toolkit on linux since tiger. This must be supported on XToolkit which otherwise would appear as a regression in linux on tiger.

      This is reproducible with XToolkit on Linux and Solaris10. This is not reproducible on win32. This is not reproducible with JDK 1.4.2 on linux.

      I have attached a sample test. Execute the sample test. You would see a frame with a button. Click on the button. If an UnsupportedOperationException is thrown, the bug is reproduced.

        Issue Links

          Activity

          Hide
          yan Yuri Nesterenko added a comment -
          BT2:EVALUATION

          We should implement this in mustang
          ###@###.### 2004-09-13

          Not implemented yet.
          ###@###.### 2004-09-13
          ###@###.### 2004-09-13

          Implement this in dolphin together with port of KanaLock sniffer (see webrev attached to 4360364).
          ###@###.### 2005-06-17 07:55:29 GMT
          Show
          yan Yuri Nesterenko added a comment - BT2:EVALUATION We should implement this in mustang ###@###.### 2004-09-13 Not implemented yet. ###@###.### 2004-09-13 ###@###.### 2004-09-13 Implement this in dolphin together with port of KanaLock sniffer (see webrev attached to 4360364). ###@###.### 2005-06-17 07:55:29 GMT
          Hide
          defectconv Defect Conversion BT2 (Inactive) added a comment -
          BT2:CONVERTED DATA

          BugTraq+ Release Management Values

          COMMIT TO FIX:
          mustang

          Show
          defectconv Defect Conversion BT2 (Inactive) added a comment - BT2:CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: mustang
          Hide
          yan Yuri Nesterenko added a comment -
          BT2:EVALUATION

          Actually, it doesn't work in Motif: the implementation is buggy. To make it work, one need to XQueryPointer() passing a window to that call, not XQueryKeymap() as in MToolkit code. XQueryKeymap reports an actually pressed state of all the keys, not the toggled state of the modifier.

          To fix this in XAWT, one need
          (1) determine a keysym by a java keycode for a locking key;
          (2) calculate an X keycode via XKeysymToKeycode;
          (3) fetch an array of modifier lists (8 x Max_keycode_number): that one may be prefetched and stored in Java structures if MappingNotify is properly processed which is not, presently; anyway, it would be safer to reread it on demand;
          (4) call XQueryPointer for an application window, if any, or for a root window;
          (5) compare a mask returned in the last argument with a value in array of modifier lists.
          Show
          yan Yuri Nesterenko added a comment - BT2:EVALUATION Actually, it doesn't work in Motif: the implementation is buggy. To make it work, one need to XQueryPointer() passing a window to that call, not XQueryKeymap() as in MToolkit code. XQueryKeymap reports an actually pressed state of all the keys, not the toggled state of the modifier. To fix this in XAWT, one need (1) determine a keysym by a java keycode for a locking key; (2) calculate an X keycode via XKeysymToKeycode; (3) fetch an array of modifier lists (8 x Max_keycode_number): that one may be prefetched and stored in Java structures if MappingNotify is properly processed which is not, presently; anyway, it would be safer to reread it on demand; (4) call XQueryPointer for an application window, if any, or for a root window; (5) compare a mask returned in the last argument with a value in array of modifier lists.

            People

            • Assignee:
              yan Yuri Nesterenko
              Reporter:
              pmohansunw Praveen Mohan (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: