Skip to content

取滚轮值

获取滚轮当前滚动状态。

语法

cpp
class RX784::Device {
    Status getWheelAxis(
        int16_t& w
    );
};
class RX784::Device {
    Status getWheelAxis(
        int16_t& w
    );
};
e
类名基类公开备注
RX784设备
方法名返回值类型公开备注
取滚轮值整数型
参数名类型参考可空数组备注
w短整数型
.版本 2 .程序集 RX784设备, , 公开 .子程序 取滚轮值, 整数型, 公开 .参数 w, 短整数型, 参考
py
class Device:
    def get_wheel_axis(self) -> Tuple[Status, int]: ...
class Device:
    def get_wheel_axis(self) -> Tuple[Status, int]: ...

返回值

名称英文说明
状态码status成功返回
ww滚轮值,向前为正。

备注

使用前必须先 初始化绝对坐标系统。滚轮值可能溢出,需要妥善处理。

示例

cpp
#include <iostream>
#include "rx784.hpp"

int main() {
    RX784::Device device;
    int16_t w;

    device.open("COM1");

    device.initAbsSystem(1920, 1080);
    device.getWheelAxis(w);
    std::cout << w << std::endl;

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

int main() {
    RX784::Device device;
    int16_t w;

    device.open("COM1");

    device.initAbsSystem(1920, 1080);
    device.getWheelAxis(w);
    std::cout << w << std::endl;

    device.close();
}
e
方法名返回值类型公开备注
_启动子程序整数型
变量名类型静态数组备注
设备RX784设备
w短整数型
设备.打开 (“COM1”)
设备.初始化绝对坐标系统 (1920, 1080)
设备.取滚轮值 (w)
调试输出 (w)
设备.关闭 ()
返回 (0)
.版本 2 .子程序 _启动子程序, 整数型 .局部变量 设备, RX784设备 .局部变量 w, 短整数型 设备.打开 (“COM1”) 设备.初始化绝对坐标系统 (1920, 1080) 设备.取滚轮值 (w) 调试输出 (w) 设备.关闭 () 返回 (0)
py
import rx784

device = rx784.Device()

device.open('COM1')

device.init_abs_system(1920, 1080)
status, w = device.get_wheel_axis()
print(w)

device.close()
import rx784

device = rx784.Device()

device.open('COM1')

device.init_abs_system(1920, 1080)
status, w = device.get_wheel_axis()
print(w)

device.close()