当前仓库属于暂停状态,部分功能使用受限,详情请查阅 仓库状态说明
1 Star 0 Fork 1.7K

viyjk99 / QtScrcpy
暂停

forked from Barry / QtScrcpy 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
KeyMapDes.md 4.72 KB
一键复制 编辑 原始数据 按行查看 历史
rankun 提交于 2020-08-02 12:46 . feat: add click multi

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
![](image/debug-keymap-pos.png)

-The key codes in the key map are represented by Qt enumerations, detailed description can be refer to Qt documentation (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: ![](image/display pointer position.jpg)

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_CLICK_MULTI Click multiple times. According to the delay and pos in the clickNodes array, press one key to simulate touching multiple positions -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_CLICK_MULTI -delay Delay delay ms before simulating touch -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

C++
1
https://gitee.com/david2lf/QtScrcpy.git
git@gitee.com:david2lf/QtScrcpy.git
david2lf
QtScrcpy
QtScrcpy
master

搜索帮助