public class MathKeyListener extends MathListener implements java.awt.event.KeyListener
In response to a KeyEvent, objects of this class send to Mathematica:
userCode[theKeyEvent, theKeyEvent.getKeyChar(), theKeyEvent.getKeyCode()]
userFunc is specified as a string, either a function name or an expression
(like a pure function "foo[##]&"), via the setHandler() method.| Constructor and Description |
|---|
MathKeyListener()
The constructor that is called from Mathematica.
|
MathKeyListener(KernelLink ml)
You must use this constructor when using this class in a Java program,
because you need to specify the KernelLink that will be used.
|
MathKeyListener(java.lang.String[][] handlers)
This form of the constructor lets you skip having
to make a series of setHandler() calls.
|
| Modifier and Type | Method and Description |
|---|---|
void |
keyPressed(java.awt.event.KeyEvent e) |
void |
keyReleased(java.awt.event.KeyEvent e) |
void |
keyTyped(java.awt.event.KeyEvent e) |
callMathHandler, callVoidMathHandler, getHandler, getLink, setHandlerpublic MathKeyListener()
public MathKeyListener(KernelLink ml)
ml - The link to which computations will be sent when KeyEvents arrive.public MathKeyListener(java.lang.String[][] handlers)
handlers - An array of {meth, func} pairs associating methods in the KeyListener
interface with Mathematica functions.public void keyPressed(java.awt.event.KeyEvent e)
keyPressed in interface java.awt.event.KeyListenerpublic void keyReleased(java.awt.event.KeyEvent e)
keyReleased in interface java.awt.event.KeyListenerpublic void keyTyped(java.awt.event.KeyEvent e)
keyTyped in interface java.awt.event.KeyListenerJ/Link is Copyright (c) 1999-2012, Wolfram Research, Inc. All rights reserved.