Skip to content

Commit

Permalink
Fix the bug which some characters can't be typed to device.
Browse files Browse the repository at this point in the history
  • Loading branch information
kennyliu committed Mar 11, 2019
1 parent 54e0331 commit ece42c8
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import com.cxplan.projection.MonkeyConstant;
import com.cxplan.projection.ui.util.GUIUtil;
import com.cxplan.projection.util.StringUtil;

import java.awt.*;
import java.awt.event.*;
Expand Down Expand Up @@ -117,7 +116,7 @@ public void mouseDragged(MouseEvent e) {
@Override
public void keyTyped(KeyEvent event) {
char keyChar = event.getKeyChar();
if (keyMap.containsKey((int)keyChar)) {
if (event.getModifiers() == 0 && keyMap.containsKey((int)keyChar)) {
return;
} else {
inputListener.type(keyChar + "");
Expand All @@ -135,7 +134,7 @@ public void keyPressed(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_BACK_SPACE) {//back: alt + delete/back
inputListener.press(MonkeyConstant.KEYCODE_BACK);
} else if (e.getKeyCode() == KeyEvent.VK_M) { // menu: alt + m
inputListener.press(MonkeyConstant.KEYCODE_MENU);
inputListener.press(MonkeyConstant.KEYCODE_APP_SWITCH);
} else if (e.getKeyCode() == KeyEvent.VK_H) { //home : alt + h
inputListener.press(MonkeyConstant.KEYCODE_HOME);
}
Expand Down

0 comments on commit ece42c8

Please sign in to comment.