• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * This file is part of "JTA - Telnet/SSH for the JAVA(tm) platform".
3  *
4  * (c) Matthias L. Jugel, Marcus Meißner 1996-2005. All Rights Reserved.
5  *
6  * Please visit http://javatelnet.org/ for updates and contact.
7  *
8  * --LICENSE NOTICE--
9  * This program is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License
11  * as published by the Free Software Foundation; either version 2
12  * of the License, or (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22  * --LICENSE NOTICE--
23  *
24  */
25 package de.mud.terminal;
26 
27 import java.util.Properties;
28 
29 /**
30  * An interface for a terminal that accepts input from keyboard and mouse.
31  *
32  * @version $Id: VDUInput.java 499 2005-09-29 08:24:54Z leo $
33  */
34 public interface VDUInput {
35 
36   public final static int KEY_CONTROL = 0x01;
37   public final static int KEY_SHIFT = 0x02;
38   public final static int KEY_ALT = 0x04;
39   public final static int KEY_ACTION = 0x08;
40 
41 
42 
43   /**
44    * Direct access to writing data ...
45    * @param b
46    */
write(byte b[])47   void write(byte b[]);
48 
49   /**
50    * Terminal is mouse-aware and requires (x,y) coordinates of
51    * on the terminal (character coordinates) and the button clicked.
52    * @param x
53    * @param y
54    * @param modifiers
55    */
mousePressed(int x, int y, int modifiers)56   void mousePressed(int x, int y, int modifiers);
57 
58   /**
59    * Terminal is mouse-aware and requires the coordinates and button
60    * of the release.
61    * @param x
62    * @param y
63    * @param modifiers
64    */
mouseReleased(int x, int y, int modifiers)65   void mouseReleased(int x, int y, int modifiers);
66 
67   /**
68    * Override the standard key codes used by the terminal emulation.
69    * @param codes a properties object containing key code definitions
70    */
setKeyCodes(Properties codes)71   void setKeyCodes(Properties codes);
72 
73   /**
74    * main keytyping event handler...
75    * @param keyCode the key code
76    * @param keyChar the character represented by the key
77    * @param modifiers shift/alt/control modifiers
78    */
keyPressed(int keyCode, char keyChar, int modifiers)79   void keyPressed(int keyCode, char keyChar, int modifiers);
80 
81   /**
82    * Handle key Typed events for the terminal, this will get
83    * all normal key types, but no shift/alt/control/numlock.
84    * @param keyCode the key code
85    * @param keyChar the character represented by the key
86    * @param modifiers shift/alt/control modifiers
87    */
keyTyped(int keyCode, char keyChar, int modifiers)88   void keyTyped(int keyCode, char keyChar, int modifiers);
89 }
90