I am trying to type APL characters in a text component. Having editted the
font.properties file to use my font, the characters ( at positions >127 )
display correctly, but I don't know how to generate them from the keyboard.
I would like, for example, <alt>+a to produce the character at 0xc1 ( alpha ).
I have tried using the AWTapp.translations resource as follows:
AWTapp*translations: #override \
: Mod1 <Key>a: string(0xc1)
"string", however, is not a valid action. Is there an appropriate action
for this? Is there a list of the actions table?
I have also tried writing SillyKeyAdapter.java:
import java.awt.event.*;
class SillyKeyAdapter extends KeyAdapter
{
public void keyPressed(KeyEvent e)
{
int cod = e.getKeyCode();
int mod = e.getModifiers();
if ( ( cod == KeyEvent.VK_A ) &&
( (0<(mod&InputEvent.ALT_MASK))
||(0<(mod&InputEvent.META_MASK))))
{
//e.setKeyChar((char) 0x0062); // (*)
e.setKeyChar((char) 0x00c1); // (**)
e.setModifiers(0);
}
}
}
with Silly.java:
import java.awt.*;
class Silly {
public static void main( String args[] )
{
Frame F = new Frame("Hmm");
TextField TF = new TextField("\xccav\xc9'\xc1'");
TF.setFont(new Font("Monospaced",Font.PLAIN,20));
TF.addKeyListener(new SillyKeyAdapter());
F.add(TF);
F.pack();
F.show();
}
}
Using line (*), <alt>+a gives me b, but using line (**), I get a
segmentation violation.
I am running:
Debian Linux v1.2 ( Linux 2.0.2.7 )
jdk1.1.6
libc.so.5.4.46
ldconfig: version 1.8.12
XFree86:
version number: 11.0
vendor string: The XFree86 Project, Inc
vendor release number: 3200
Thank-you for any advice that you might have.
Sincerely,
James Rhyness
[EMAIL PROTECTED]
----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]