|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcodesimian.CS<CSGeneric>
codesimian.DefaultCS
codesimian.KeyListenerOnComponent
public class KeyListenerOnComponent
THIS CLASS NEEDS TO BE TESTED.
Adds a KeyListner, defined by P(1) - P(3), to the java.awt.Component inside P(0).
P(4) P(5) and P(6) are optional.
keyPressed(KeyEvent) causes P(1).setC(charTyped).
keyReleased(KeyEvent) causes P(2).setC(charTyped).
keyTyped(KeyEvent) causes P(3).setC(charTyped).
If P(4) exists, its a list of 128 numbers
describing the keyboard right now, 0 for key up, 1 for key down.
When P(0) is replaced, the KeyListener is removed from P(0).L(java.awt.Component.class)
If there is a P(5), it is the number of seconds (can be a fraction) to wait
after the last key event, before delivering all events.
This lets the user type a whole string before being interrupted.
If there is a P(6), its the max queued key events.
Set this to 1 to only do the last event.
If an other event occurs while waiting, it would replace the currently waiting event,
and it is delayed from that point in time. If its 5, you get up to the last 5 events
when the wait is over.
Field Summary |
---|
Fields inherited from class codesimian.CS |
---|
DESCRIPTION, END, EXECPROXY, HEAP, JAVACODE, MYFUEL, NAME, NEWINSTANCE, NULL, PARENT, PARSEPRIORITY, PREV, TESTER, THIS |
Constructor Summary | |
---|---|
KeyListenerOnComponent()
|
Method Summary | |
---|---|
void |
delayEvents()
P(5).D() number of seconds after the last call of this, doLater is executed then emptied. |
java.lang.String |
description()
a short description of this CS, shorter than the javadoc, but long enough to tell what the params are for. |
double |
DForProxy()
Execute this CS and cast to double. |
void |
keyPressed(java.awt.event.KeyEvent e)
|
void |
keyReleased(java.awt.event.KeyEvent e)
|
void |
keyTyped(java.awt.event.KeyEvent e)
|
java.lang.String |
keyword()
For the CodeSimian language as a String. CodeSimian language keyword, like "+" "*" "max" ">" etc. Override this function if you want to specify a keyword other than how I derive them from the class name, like + for Add. Some CSs might never be intended to be used in the language by their keyword. The best example (4/05) is Num, because it is used in the language like "3.4" instead of "num()". |
int |
maxP()
Maximum quantity of Params |
int |
minP()
For DForProxy(). Minimum number of parameters in param[] needed to call DForProxy(). Defines which indexs of param[] DForProxy() can use. Functions with a different number of parameters must override this. OVERRIDE THIS FUNCTION IF EXEC USES A DIFFERENT NUMBER OF PARAMETERS. Default is 1. |
char |
nameToChar(java.lang.String name)
example: nameToChar("\n") returns '\n', but maybe later exceptions like "HOME" will also work. |
CS[] |
reorderByName128(CS[] keyList)
This function lets you select a small quantity of keys to watch. |
void |
reorderP4()
calls reorderByName128 and forces P(4) to update itself. |
boolean |
setP(int index,
CS value)
Every CS is a list of other CSs, between size minP() and maxP() inclusive. |
static void |
tellListener(CS listener,
char input)
|
void |
tellListenerLater(CS listener,
char input)
TODO: this function needs to be tested. |
void |
updateKeyInP4(char key,
boolean down)
|
Methods inherited from class codesimian.DefaultCS |
---|
B, C, countP, decrementMyFuel, deleteP, F, fuel, getExec, getObject, heap, I, indexP, indexPName, insertB, insertC, insertD, insertF, insertI, insertJ, insertL, insertL, insertL1, insertP, insertS, insertZ, J, javaCode, LForProxy, LForProxy, myFuel, name, newInstance, objectToCS, objectToCSArray, objectToCSArray, P, prevD, prevL, PType, S, setB, setC, setCountP, setD, setD, setExec, setF, setFuel, setI, setJ, setL, setL, setL, setL1, setMyFuel, setName, setObject, setPrevExec, setPType, setS, setZ, start, toString, V, Z |
Methods inherited from class codesimian.CS |
---|
addB, addC, addD, addF, addI, addJ, addL, addP, addP, addP, addP, addP, addS, addZ, BForProxy, CForProxy, clone, cost, D, deleteP, FForProxy, GETB, GETC, GETD, GETF, GETI, GETJ, GETL, GETS, GETZ, IForProxy, isIllusion, JForProxy, L, L, L, L, L, maxD, minD, overwrites, parent, parsePriority, PB, PC, PD, PF, PI, PJ, PL, prevB, prevC, prevF, prevI, prevJ, prevS, prevZ, proxyOf, PS, PZ, reflect, reflect, reflect6, setB, SETB, setC, SETC, setCost, SETD, setDescription, setF, SETF, setHeap, setI, SETI, setJ, SETJ, SETL, setL, setL, setParent, setParsePriority, setProxyOf, setS, SETS, setTester, setZ, SETZ, SForProxy, tester, toJavaCode, VForProxy, voidReflect, ZForProxy |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public KeyListenerOnComponent()
Method Detail |
---|
public java.lang.String keyword()
DefaultCS
keyword
in class DefaultCS
CS.parent()
,
CS.newInstance()
,
CS.name()
public java.lang.String description()
CS
description
in class DefaultCS
public double DForProxy()
CS
DForProxy
in class DefaultCS
public int minP()
DefaultCS
minP
in class DefaultCS
public int maxP()
CS
maxP
in class CS
public boolean setP(int index, CS value)
CS
setP
in class DefaultCS
public void keyPressed(java.awt.event.KeyEvent e)
keyPressed
in interface java.awt.event.KeyListener
public void keyReleased(java.awt.event.KeyEvent e)
keyReleased
in interface java.awt.event.KeyListener
public void keyTyped(java.awt.event.KeyEvent e)
keyTyped
in interface java.awt.event.KeyListener
public void updateKeyInP4(char key, boolean down)
public CS[] reorderByName128(CS[] keyList)
keyList
- a list of CSs that each represent a key on the keyboard.
That list can be any size between 0 and 128.
public void reorderP4()
public char nameToChar(java.lang.String name)
public static void tellListener(CS listener, char input)
public void tellListenerLater(CS listener, char input)
public void delayEvents()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |