public synchronized void keyPressed (KeyEvent e)
	{
		if (e.isActionKey())
		{
			switch (e.getKeyCode())
			{
				case KeyEvent.VK_DOWN:
					forward();
					break;
				case KeyEvent.VK_UP:
					back();
					break;
				case KeyEvent.VK_LEFT:
					varleft();
					break;
				case KeyEvent.VK_RIGHT:
					varright();
					break;
				case KeyEvent.VK_PAGE_DOWN:
					fastforward();
					break;
				case KeyEvent.VK_PAGE_UP:
					fastback();
					break;
				case KeyEvent.VK_BACK_SPACE:
				case KeyEvent.VK_DELETE:
					undo();
					break;
				case KeyEvent.VK_HOME:
					varmain();
					break;
				case KeyEvent.VK_END:
					varmaindown();
					break;
			}
		}
		else
		{
			switch (e.getKeyChar())
			{
				case '*':
					varmain();
					break;
				case '/':
					varmaindown();
					break;
				case 'v':
				case 'V':
					varup();
					break;
				case 'm':
				case 'M':
					mark();
					break;
				case 'p':
				case 'P':
					resume();
					break;
				case 'c':
				case 'C':
					specialmark(Field.CIRCLE);
					break;
				case 's':
				case 'S':
					specialmark(Field.SQUARE);
					break;
				case 't':
				case 'T':
					specialmark(Field.TRIANGLE);
					break;
				case 'l':
				case 'L':
					letter();
					break;
				case 'r':
				case 'R':
					specialmark(Field.CROSS);
					break;
				case 'w':
					setwhite();
					break;
				case 'b':
					setblack();
					break;
				case 'W':
					white();
					break;
				case 'B':
					black();
					break;
				case '+':
					gotonext();
					break;
				case '-':
					gotoprevious();
					break;
				// Bug (VK_DELETE not reported as ActionEvent)
				case KeyEvent.VK_BACK_SPACE:
				case KeyEvent.VK_DELETE:
					undo();
					break;
			}
		}
	}