private List<TInputEvent> eventQueue;
/**
- * The reader thread.
+ * The last reported mouse X position.
*/
- private Thread readerThread;
+ private int oldMouseX = -1;
+
+ /**
+ * The last reported mouse Y position.
+ */
+ private int oldMouseY = -1;
/**
* true if mouse1 was down. Used to report mouse1 on the release event.
boolean ctrl = false;
char ch = ' ';
boolean isKey = false;
- int fnKey = 0;
if (key.isActionKey()) {
isKey = true;
} else {
keypress = kbEnter;
break;
case 0x09:
- keypress = kbTab;
+ if (shift) {
+ keypress = kbShiftTab;
+ } else {
+ keypress = kbTab;
+ }
break;
case 0x7F:
keypress = kbDel;
break;
default:
if (!alt && ctrl && !shift) {
- ch = key.getKeyText(key.getKeyCode()).charAt(0);
+ ch = KeyEvent.getKeyText(key.getKeyCode()).charAt(0);
}
// Not a special key, put it together
keypress = new TKeypress(false, 0, ch, alt, ctrl, shift);
public void mouseMoved(final MouseEvent mouse) {
int x = screen.textColumn(mouse.getX());
int y = screen.textRow(mouse.getY());
+ if ((x == oldMouseX) && (y == oldMouseY)) {
+ // Bail out, we've moved some pixels but not a whole text cell.
+ return;
+ }
+ oldMouseX = x;
+ oldMouseY = y;
+
TMouseEvent mouseEvent = new TMouseEvent(TMouseEvent.Type.MOUSE_MOTION,
x, y, x, y, mouse1, mouse2, mouse3, false, false);