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

fp.bugs 3333: Win32 handleEvent not called for '.' KEY_PRESS

XMLWordPrintable

    • 1.0.2
    • x86
    • windows_95
    • Not verified

        1. This is a bug.
        2. This applies to the JDK.
        3. The version of the JDK is 1.0 Final (and 1.0 Beta 2...)
        4. The handleEvent method does not get called for the KEY_PRESS event
        when the key is a period in Win32. It will get called for a KEY_RELEASE
        event, however. All other keys work fine.
        5. I am using Windows 95.
        6-9. Here is a sample that will demonstrate the problem (on Win32
        only). I have posted it to comp.lang.java and received a response from
        someone stating that the same bug is apparent when running this code as
        an applet. You can also see this happen with the program 'jev'
        available on Gamelan. Here is the code:

        ---------------------BEGIN event.java------------------------
        import java.awt.*;

        public class event extends Frame
        {
                TextArea ta;

                public event()
                {
                        ta = new TextArea(10,40);
                        add("Center",ta);
                        pack();
                        show();
                }

           public static void main(String args[])
           {
                        new event();
           }

                public boolean handleEvent(Event e)
                {
                        if(e.id == Event.KEY_PRESS)
                        {
                                ta.appendText("Key pressed: " + e.key + '\\n');
                                return true;
                        }

                        // so we can exit the application
                        else if(e.id == Event.WINDOW_DESTROY)
                        {
                                System.exit(0);
                                return true;
                        }
                        return false;
                }
        }
        Thanks,
        --
        Thomas Lea
        ###@###.###

              tballsunw Tom Ball (Inactive)
              bhagen Benjamin Hagen (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: