Problem:Yesterday to do test case, found an online game apk run interface, Uiautomator can not capture access.As a result, the input has to use (Dut.onclick (int a, int y)) coordinate click Method to enter the user name and password.Can not have the adaptability of the screen, but also make the input code complex, error-prone.Workaround: Use the Uidevice.getinstance (). Presskeycode (int x) methodString id= "Inteltest"; for (int i=0;iKeyCode:KeyCode 1 = left mouse buttonKeyCode 2 = right mouse b
In the English Input method mode:
0-9 corresponds to the keycode is 48-57
In the Chinese Input method mode:
The keys for numbers and letters, and the KeyCode of the TAB key is 229.
The KeyCode for carriage return is 8
Later in the JS less use the key keycode to ju
Keycode: obtains the enumeration of keys on the keyboard when the keydown or keyup is obtained.
KeyValue: Actually equal to keycode, keycode is enumeration, and keyValue is the integer value corresponding to enumeration.
Keydata: Get the keys value, which indicates the key code of the key to be pressed and the modifier sign (indicating the combination of Ctrl,
characters of the keypad and the main keyboard.6). Where Prscrn keys KeyPress, KeyDown, and KeyUp are not captured.KeyPress Event:private void Form1_keypress (object sender, KeyPressEventArgs e){if (e.keychar== ' 1 '){Button1. PerformClick ();//Perform the operation of button "1"E.handled = true;}}Keychar Value:2 additional special ASCII codes: Carriage return = 13, newline =10KeyDown event:private void Form1_keydown (object sender, KeyEventArgs e){Keys key = E.keycode;if (e.control!=true)//If
This article is mainly on the jquery to obtain KeyCode sample code is introduced, the need for friends can come to the reference, I hope to help you. As follows: The nbsp; code is as follows: Txtsearch: text box ID nbsp; $ ("#txtSearch"). KeyUp (function (event) {nbsp; nbsp; var keycode = event.whic H nbsp; nbsp; if (keycode = {nbsp; nbsp; nbsp; nbsp; alert ('
As shown below:
Copy Code code as follows:
Txtsearch: text Box ID
$ ("#txtSearch"). KeyUp (function (event) {var keycode = Event.which;if (keycode = = 13) {Alert (' You have pressed the Enter key ');
}
});
Or
Xobj.keyup (function (event) {Gets the key value of the current keyjquery's Event object has a which property to get the key value of the keyboard keyvar
KeyCode in Javascript)
Key code key code
A 65 J 74 S 83 1 49
B 66 K 75 T 84 2 50
C 67 L 76 U 85 3 51
D 68 M 77 V 86 4 52
E 69 N 78 W 87 5 53
F 70 O 79X88 6 54
G 71 P 80 Y 89 7 55
H 72 Q 81 Z 90 8 56
I 73 R 82 0 48 9 57
KeyCode function keyCode)
Key code key code
0 96 8 104 F1 112 F7 118
1 97 9 105 F2 113 F8 119
2 98*106 F3 114 F9 120
3 99 + 107 F4 115 F10 1
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.