Bug with keyPressed/keyReleased

1998-07-16 Thread aking

 There seems to be a bug with keyboard handling in all version of the JDK
for linux with respect to KeyEvents.  The following small java program
demonstrates the problem.  Basically, when a key is pressed, and held down
multiple keyPressed/keyReleased events are generated, when only a
keyPressed event should be.  THe keyReleased event shouldn't occur
until the key is released.  This works correctly under both Sun's
and Microsoft's java implementation for windows.

To use the program, just click inside the Frame and hold down a key, 
you'll see keyReleased events generated.

import java.awt.*;
import java.awt.event.*;

public class KeyRepeatTest extends Frame
{
   public KeyRepeatTest()
   {
 super( "KeyRepeatTest" );
 
 addKeyListener( new KeyAdapter()
 {
   public void keyPressed( KeyEvent event )
   {
  System.out.println( "Key Pressed" );
   }
 
   public void keyReleased( KeyEvent event )
   {
 System.out.println( "Key Released" );
   }
 });

 requestFocus();
 setSize( 200, 200 );
 setVisible( true );
  }

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

Cheers,

 Adam   



Window handle in JAWT

2000-11-17 Thread aking

  I'm using the JAWT from 1.3 to do some native drawing.  Under windows,
getting the handle to the window is easy:

dsi_win32 = (JAWT_Win32DrawingSurfaceInfo*)dsi->platformInfo;
glHDC = dsi_win32->hdc;
glHWnd = dsi_win32->hwnd;

I'm also working on a Linux version, however, I need the Window reference
that the Canvas is attached too.  The 'JAWT_X11DrawingSurfaceInfo'
structure doesn't appear to include this info - just the Drawable and
Display.  Is there another way to retrieve the Window reference?

Adam

P.S.  BTW, I've tried both Sun's and IBMs JDK 1.3 and neither of their
  JAWTs seem to work with the demo code. But Blackdown's JDK1.3 works
  great!  Thanks!


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]