Skip to content

相对移动

使鼠标指针相对当前位置发生位移。

语法

cpp
class RX784::Device {
    Status moveRel(
        int16_t x,
        int16_t y
    );
};
class RX784::Device {
    Status moveRel(
        int16_t x,
        int16_t y
    );
};
e
类名基类公开备注
RX784设备
方法名返回值类型公开备注
相对移动整数型
参数名类型参考可空数组备注
x短整数型
y短整数型
.版本 2 .程序集 RX784设备, , 公开 .子程序 相对移动, 整数型, 公开 .参数 x, 短整数型 .参数 y, 短整数型
py
class Device:
    def move_rel(self,
        x: int
        y: int
    ) -> Status: ...
class Device:
    def move_rel(self,
        x: int
        y: int
    ) -> Status: ...

参数

名称英文说明
xx水平方向偏移值,左负右正。
yy竖直方向偏移值,上负下正。

返回值

名称英文说明
状态码status成功返回

备注

若鼠标移动不准确,可参照 常见问题 页面进行设置。

示例

cpp
#include "rx784.hpp"

int main() {
    RX784::Device device;

    device.open("COM1");

    device.moveRel(100, 90);  // 光标往右下方偏移

    device.close();
}
#include "rx784.hpp"

int main() {
    RX784::Device device;

    device.open("COM1");

    device.moveRel(100, 90);  // 光标往右下方偏移

    device.close();
}
e
方法名返回值类型公开备注
_启动子程序整数型
变量名类型静态数组备注
设备RX784设备
设备.打开 (“COM1”)
设备.相对移动 (100, 90) ' 光标往右下方偏移
设备.关闭 ()
返回 (0)
.版本 2 .子程序 _启动子程序, 整数型 .局部变量 设备, RX784设备 设备.打开 (“COM1”) 设备.相对移动 (100, 90) ' 光标往右下方偏移 设备.关闭 () 返回 (0)
py
import rx784

device = rx784.Device()

device.open('COM1')

device.move_rel(100, 90)  # 光标往右下方偏移

device.close()
import rx784

device = rx784.Device()

device.open('COM1')

device.move_rel(100, 90)  # 光标往右下方偏移

device.close()