Emu8255
Class MyKeyListener

java.lang.Object
  extended by Emu8255.MyKeyListener
All Implemented Interfaces:
java.awt.event.KeyListener, java.util.EventListener

public class MyKeyListener
extends java.lang.Object
implements java.awt.event.KeyListener

This class implements the listener for all the text fields. According to the input method, a character may be rejected or not. For example, if the input method is set to binary, only characters 1 and 0 are allowed. Besides, when in mode 0, values are written to the corresponding ports when the input is complete (i.e. 8 one/zeros when in binary mode, 1 bit for PCi, 1 character when in Ascii mode, 2 hex chars when in hexadecimal mode).


Constructor Summary
MyKeyListener(Emu8255GUI gui, Emu8255 mainclass, char me)
          Parameterized constructor.
 
Method Summary
 void keyPressed(java.awt.event.KeyEvent e)
          This method is invoked when a key has been pressed.
 void keyReleased(java.awt.event.KeyEvent e)
          This method is invoked when a key has been released.
 void keyTyped(java.awt.event.KeyEvent e)
          This method is invoked when a key has been typed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MyKeyListener

public MyKeyListener(Emu8255GUI gui,
                     Emu8255 mainclass,
                     char me)
Parameterized constructor.

Parameters:
gui - A reference to the main user interface
TextField - A reference to the text field this listener is associated to.
me - An identifier for text field.
Method Detail

keyPressed

public void keyPressed(java.awt.event.KeyEvent e)
This method is invoked when a key has been pressed.

Specified by:
keyPressed in interface java.awt.event.KeyListener
Parameters:
e - The KeyEvent

keyTyped

public void keyTyped(java.awt.event.KeyEvent e)
This method is invoked when a key has been typed.

Specified by:
keyTyped in interface java.awt.event.KeyListener
Parameters:
e - The KeyEvent

keyReleased

public void keyReleased(java.awt.event.KeyEvent e)
This method is invoked when a key has been released.

Specified by:
keyReleased in interface java.awt.event.KeyListener
Parameters:
e - The KeyEvent