155
edits
No edit summary |
|||
Line 200: | Line 200: | ||
</code> | </code> | ||
==keyPressEvent== | |||
In order to allow for a change in key effects, the CDU's 3D model's XML binds all key presses (and releases where appropriate) to a Nasal call to this function, giving the objects name (i.e. the keys name) as an argument. This name is then checked against the keys present in the KeyBinding hash (see below) and, if a match is found, that function is called. | |||
This function also keeps track of the current status of the plusminus, as this key either introduces a new char into the ScratchPad or toggles the last one entered. | |||
==KeyBinding== | |||
This hash represents the current key binding. The CDU's Nasal code then overwrites these functions, effectively changing the effect of a key press. Note that the KeyBinding does not use the Button class's timing systems, but directly uses the a CDU.timer instance of the Timer class. | |||
= Helping Functions and Classes = | = Helping Functions and Classes = |
edits