分类 笔记本 下的文章

adb命令模拟按键


整理一下adb里面模拟按键的指令
用法:adb shell input keyevent 编号
下面是每个按键对应的编号:

0 "KEYCODE_UNKNOWN"
1 "KEYCODE_MENU"
2 "KEYCODE_SOFT_RIGHT"
3 "KEYCODE_HOME"    //主页键
4 "KEYCODE_BACK"    //返回键
5 "KEYCODE_CALL"    //拨号键
6 "KEYCODE_ENDCALL"    //挂机键
7 "KEYCODE_0"    //按键"0"
8 "KEYCODE_1"    //按键"1"
9 "KEYCODE_2"    //按键"2"
10 "KEYCODE_3"    //按键"3"
11 "KEYCODE_4"    //按键"4"
12 "KEYCODE_5"    //按键"5"
13 "KEYCODE_6"    //按键"6"
14 "KEYCODE_7"    //按键"7"
15 "KEYCODE_8"    //按键"8"
16 "KEYCODE_9"    //按键"9"
17 "KEYCODE_STAR"    //按键"*"
18 "KEYCODE_POUND"    //按键"#"
19 "KEYCODE_DPAD_UP"    //导航键上
20 "KEYCODE_DPAD_DOWN"    //导航键下
21 "KEYCODE_DPAD_LEFT"    //导航键左
22 "KEYCODE_DPAD_RIGHT"    //导航键右
23 "KEYCODE_DPAD_CENTER"    //导航键确定
24 "KEYCODE_VOLUME_UP"    //音量加
25 "KEYCODE_VOLUME_DOWN"    //音量减
26 "KEYCODE_POWER"    //电源键
27 "KEYCODE_CAMERA"    //拍照键
28 "KEYCODE_CLEAR"
29 "KEYCODE_A"    //按键"A"
30 "KEYCODE_B"    //按键"B"
31 "KEYCODE_C"    //按键"C"
32 "KEYCODE_D"    //按键"D"
33 "KEYCODE_E"    //按键"E"
34 "KEYCODE_F"    //按键"F"
35 "KEYCODE_G"    //按键"G"
36 "KEYCODE_H"    //按键"H"
37 "KEYCODE_I"    //按键"I"
38 "KEYCODE_J"    //按键"J"
39 "KEYCODE_K"    //按键"K"
40 "KEYCODE_L"    //按键"L"
41 "KEYCODE_M"    //按键"M"
42 "KEYCODE_N"    //按键"N"
43 "KEYCODE_O"    //按键"O"
44 "KEYCODE_P"    //按键"P"
45 "KEYCODE_Q"    //按键"Q"
46 "KEYCODE_R"    //按键"R"
47 "KEYCODE_S"    //按键"S"
48 "KEYCODE_T"    //按键"T"
49 "KEYCODE_U"    //按键"U"
50 "KEYCODE_V"    //按键"V"
51 "KEYCODE_W"    //按键"W"
52 "KEYCODE_X"    //按键"X"
53 "KEYCODE_Y"    //按键"Y"
54 "KEYCODE_Z"    //按键"Z"
55 "KEYCODE_COMMA"    //按键","
56 "KEYCODE_PERIOD"    //按键"."
57 "KEYCODE_ALT_LEFT"    //左Alt键
58 "KEYCODE_ALT_RIGHT"    //右Alt键
59 "KEYCODE_SHIFT_LEFT"    //左Shift键
60 "KEYCODE_SHIFT_RIGHT"    //右Shift键
61 "KEYCODE_TAB"    //Tab键
62 "KEYCODE_SPACE"    //空格键
63 "KEYCODE_SYM"    
64 "KEYCODE_EXPLORER"
65 "KEYCODE_ENVELOPE"
66 "KEYCODE_ENTER"    //回车键
67 "KEYCODE_DEL"    //删除键
68 "KEYCODE_GRAVE"    //按键"`"
69 "KEYCODE_MINUS"    //按键"-"
70 "KEYCODE_EQUALS"    //按键"="
71 "KEYCODE_LEFT_BRACKET"    //按键"["
72 "KEYCODE_RIGHT_BRACKET"    //按键"]"
73 "KEYCODE_BACKSLASH"    //按键"\"
74 "KEYCODE_SEMICOLON"    //按键";"
75 "KEYCODE_APOSTROPHE"    //按键"'"
76 "KEYCODE_SLASH"    //按键"/"
77 "KEYCODE_AT"    //按键"@"
78 "KEYCODE_NUM"
79 "KEYCODE_HEADSETHOOK"
80 "KEYCODE_FOCUS"    //对焦键
81 "KEYCODE_PLUS"    //按键"+"
82 "KEYCODE_MENU"    //菜单键
83 "KEYCODE_NOTIFICATION"    //通知键
84 "KEYCODE_SEARCH"    //搜索键
85 "TAG_LAST_KEYCODE"    //上次按键

利用Nginx实现反向代理


如何利用Nginx实现反向代理

关于什么是反向代理这里就不多说明了,知乎上有不少通俗易懂的解释。

至于反向代理能用来做什么,反向代理的用途其实很多,比如用来访问某些“不存在”的网站,更多的用途是用来访问外网无法连接的内网,像是本机未开放的端口亦或者是局域网。

要用Nginx来实现反向代理比较简单,只需要在网站配置文件中添加下面这些:

location / 
{
    proxy_pass 目标URL;
    proxy_set_header Host 发送域名;
    proxy_set_header X-Forwarded-For $remote_addr;
    #proxy_cache_key 发送域名$request_uri$is_args$args;
    #proxy_cache_valid 200 304 12h;
    
    expires 2d;
}

location ~ .*\.(php|jsp|cgi|asp|aspx|flv|swf|xml)?$
{ 
    proxy_set_header Host 发送域名;
    proxy_set_header X-Forwarded-For $remote_addr;
    proxy_pass 目标URL;
    
}