hzzz 8 years ago
parent
commit
dca652ba71
  1. 5
      designer/src/com/fr/grid/GridKeyListener.java

5
designer/src/com/fr/grid/GridKeyListener.java

@ -16,7 +16,7 @@ import java.awt.event.KeyListener;
* @since 2012-3-23上午10:55:36 * @since 2012-3-23上午10:55:36
*/ */
public class GridKeyListener implements KeyListener { public class GridKeyListener implements KeyListener {
private static final int DIFF = 48; // 103 - 55 = 48, 小键盘和大键盘数字的差值 48
private Grid grid; private Grid grid;
// Keypressed last time // Keypressed last time
private long keyPressedLastTime = 0; private long keyPressedLastTime = 0;
@ -189,8 +189,7 @@ public class GridKeyListener implements KeyListener {
if (grid.getCellEditor() != null && grid.editorComponent != null) { if (grid.getCellEditor() != null && grid.editorComponent != null) {
if (IS_NUM_PAD_KEY(code)) { if (IS_NUM_PAD_KEY(code)) {
// 103 - 55 = 48, 小键盘和大键盘数字的差值 48 KeyEvent ke = new KeyEvent(grid, KeyEvent.KEY_PRESSED, 0, 0, code - DIFF, ch);
KeyEvent ke = new KeyEvent(grid, KeyEvent.KEY_PRESSED, 0, 0, code - 48, ch);
grid.editorComponent.dispatchEvent(ke); grid.editorComponent.dispatchEvent(ke);
ke.consume(); ke.consume();
} else { } else {

Loading…
Cancel
Save