mirror of
https://github.com/barry-ran/QtScrcpy.git
synced 2025-04-20 03:25:02 +00:00
parent
4eafdc6577
commit
d440a0158c
4 changed files with 72 additions and 6 deletions
|
@ -33,10 +33,10 @@ It focuses on:
|
|||
|
||||

|
||||
|
||||
## Customized key mapping (Windows&MacOS only)
|
||||
You can write your own script to map keyboard and mouse actions to touches and clicks of the mobile phone according to your needs. [Here](docs/按键映射说明.md) are the rules.
|
||||
## Customized key mapping
|
||||
You can write your own script to map keyboard and mouse actions to touches and clicks of the mobile phone according to your needs. [Here](docs/KeyMapDes.md) are the rules.
|
||||
|
||||
A script for "PUBG mobile" and TikTok mapping is provided by default. Once enabled, you can play the game with your keyboard and mouse as the PC version. or you can use up/down/left/right direction keys to simulate up/down/left/right sliding. You can also write your own mapping files for other games according to [writing rules](docs/按键映射说明.md). The default key mapping is as follows:
|
||||
A script for "PUBG mobile" and TikTok mapping is provided by default. Once enabled, you can play the game with your keyboard and mouse as the PC version. or you can use up/down/left/right direction keys to simulate up/down/left/right sliding. You can also write your own mapping files for other games according to [writing rules](docs/KeyMapDes.md). The default key mapping is as follows:
|
||||
|
||||

|
||||
|
||||
|
|
|
@ -33,10 +33,10 @@ QtScrcpy可以通过USB(或通过TCP/IP)连接Android设备,并进行显示和
|
|||
|
||||

|
||||
|
||||
## 自定义按键映射(仅windows&MacOS平台开启)
|
||||
可以根据需要,自己编写脚本将PC键盘按键映射为手机的触摸点击,编写规则在[这里](docs/按键映射说明.md)。
|
||||
## 自定义按键映射
|
||||
可以根据需要,自己编写脚本将PC键盘按键映射为手机的触摸点击,编写规则在[这里](docs/KeyMapDes_zh.md)。
|
||||
|
||||
默认自带了针对和平精英手游和抖音进行键鼠映射的映射脚本,开启平精英手游后可以用键鼠像玩端游一样玩和平精英手游,开启抖音映射以后可以使用上下左右方向键模拟上下左右滑动,你也可以按照[编写规则](docs/按键映射说明.md)编写其他游戏的映射文件,默认按键映射如下:
|
||||
默认自带了针对和平精英手游和抖音进行键鼠映射的映射脚本,开启平精英手游后可以用键鼠像玩端游一样玩和平精英手游,开启抖音映射以后可以使用上下左右方向键模拟上下左右滑动,你也可以按照[编写规则](docs/KeyMapDes_zh.md)编写其他游戏的映射文件,默认按键映射如下:
|
||||
|
||||

|
||||
|
||||
|
|
66
docs/KeyMapDes.md
Normal file
66
docs/KeyMapDes.md
Normal file
|
@ -0,0 +1,66 @@
|
|||
# Custom key mapping instructions
|
||||
|
||||
The key map file is in json format, and the new key map file needs to be placed in the keymap directory to be recognized by QtScrcpy.
|
||||
|
||||
The specific writing format of the button mapping file will be introduced below, and you can also refer to the button mapping file that comes with it.
|
||||
|
||||
## Key mapping script format description
|
||||
|
||||
### General Instructions
|
||||
|
||||
-The coordinate positions in the key map are all expressed by relative positions, and the width and height of the screen are expressed by 1, for example, the pixels of the screen are 1920x1080, then the coordinates (0.5,0.5) indicate
|
||||
Taking the upper left corner of the screen as the origin, the position of the pixel coordinates (1920,1080)*(0.5,0.5)=(960,540).
|
||||
|
||||
Or when the left mouse button clicks, the console will output the pos at this time, just use this pos directly
|
||||

|
||||
|
||||
-The key codes in the key map are represented by Qt enumerations, detailed description can be [refer to Qt documentation](https://doc.qt.io/qt-5/qt.html) (search for The key names used by Qt. can be quickly located).
|
||||
-Open the following two settings in the developer options, you can easily observe the coordinates of the touch point:
|
||||

|
||||
|
||||
### Mapping type description
|
||||
|
||||
-switchKey: Switch the key of the custom key mapping. The default is the normal mapping. You need to use this key to switch between the normal mapping and the custom mapping.
|
||||
|
||||
-mouseMoveMap: mouse movement mapping, the movement of the mouse will be mapped to startPos as the starting point, and the direction of the mouse movement as the direction of the finger drag operation (after the mouse movement map is turned on, the mouse will be hidden, limiting the range of mouse movement).
|
||||
Generally used to adjust the character field of vision in FPS mobile games.
|
||||
-startPos finger drag starting point
|
||||
-speedRatio mouse movement is mapped to the ratio of finger dragging, you can control the mouse sensitivity, the value should be greater than 0.00, the greater the value, the lower the sensitivity
|
||||
-smallEyes The button that triggers the small eyes. After pressing this button, the mouse movement will be mapped to the finger drag operation with the smallEyes.pos as the starting point and the mouse movement direction as the movement direction
|
||||
|
||||
-keyMapNodes general key map, json array, all general key maps are placed in this array, map the keys of the keyboard to ordinary finger clicks.
|
||||
|
||||
There are several types of key mapping as follows:
|
||||
|
||||
-type The type of key mapping, each element in keyMapNodes needs to be specified, and can be of the following types:
|
||||
-KMT_CLICK Ordinary click, key press simulates finger press, key lift simulates finger lift
|
||||
-KMT_CLICK_TWICE Double click, key press simulates finger press and then lift, key lift simulates finger press and then lift
|
||||
-KMT_DRAG drag and drop, the key press is simulated as a finger press and drag a distance, the key lift is simulated as a finger lift
|
||||
-KMT_STEER_WHEEL steering wheel mapping, which is dedicated to the mapping of the steering wheel for moving characters in FPS games, requires 4 buttons to cooperate.
|
||||
|
||||
Description of the unique attributes of different key mapping types:
|
||||
|
||||
-KMT_CLICK
|
||||
-key The key code to be mapped
|
||||
-pos simulates the location of the touch
|
||||
-Whether the switchMap releases the mouse. After clicking this button, besides the default simulated touch map, whether the mouse operation is released. (You can refer to the effect of M map mapping in Peace Elite Map)
|
||||
|
||||
-KMT_CLICK_TWICE
|
||||
-key The key code to be mapped
|
||||
-pos simulates the location of the touch
|
||||
|
||||
-KMT_DRAG
|
||||
-key The key code to be mapped
|
||||
-startPos Simulate the start position of touch drag
|
||||
-endPos Simulate the end position of touch drag
|
||||
|
||||
-KMT_STEER_WHEEL
|
||||
-centerPos steering wheel center point
|
||||
-leftKey key control in the left direction
|
||||
-rightKey Right key control
|
||||
-UpKey key control
|
||||
-downKey key control in down direction
|
||||
-leftOffset After dragging the left arrow key, drag to the leftOffset horizontally to the centerPos
|
||||
-rightOffset After pressing the right direction key, drag it to the right offset of the center to the right of the centerPos position
|
||||
-upOffset After pressing the up arrow key, drag it to the upper offset position horizontally relative to the centerPos position
|
||||
-downOffset Press the down arrow key and drag it to the downOffset position horizontally relative to the centerPos position
|
Loading…
Add table
Reference in a new issue