hzzz 8 years ago
parent
commit
9c6a862e43
  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
*/
public class GridKeyListener implements KeyListener {
private static final int DIFF = 48; // 103 - 55 = 48, 小键盘和大键盘数字的差值 48
private Grid grid;
// Keypressed last time
private long keyPressedLastTime = 0;
@ -189,8 +189,7 @@ public class GridKeyListener implements KeyListener {
if (grid.getCellEditor() != null && grid.editorComponent != null) {
if (IS_NUM_PAD_KEY(code)) {
// 103 - 55 = 48, 小键盘和大键盘数字的差值 48
KeyEvent ke = new KeyEvent(grid, KeyEvent.KEY_PRESSED, 0, 0, code - 48, ch);
KeyEvent ke = new KeyEvent(grid, KeyEvent.KEY_PRESSED, 0, 0, code - DIFF, ch);
grid.editorComponent.dispatchEvent(ke);
ke.consume();
} else {

Loading…
Cancel
Save