小鼠数量 [英] Number of Mice

查看:88
本文介绍了小鼠数量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我试图计算连接到计算机的鼠标数量并使用"MultiPointSDK.Instance.MouseDeviceList.Count"


Hi,

I was trying to count the number of mice connected to the computer and used "MultiPointSDK.Instance.MouseDeviceList.Count"

int test = MultiPointSDK.Instance.MouseDeviceList.Count;


当我检查值时变量" test" ,它返回'0'。我连接了2只鼠标。能够与按钮进行交互。

我错误地使用了它吗?

when i was checking the value of the variable "test" , it returned a '0' . I had 2 mouse connected. Was able to interact with the buttons.

Am i using it wrongly?

推荐答案

嗨!你的代码似乎没问题。但是,在SDK实例初始化之前,你可以获得0作为返回鼠标计数的方法之一就是这样做,如下所示:

 

Hi! Your code seems to be OK. But one of the ways you might get 0 as a return to the Count of mice is doing this before the initialization of the SDK Instance, as I show below:

 

void MultiPointWindow_Loaded(object sender, RoutedEventArgs e) { 
        int testThatResultsInZero = MultiPointSDK.Instance.MouseDeviceList.Count;
        MultiPointSDK.Instance.Initialize(this);
        int testThatGetsRightCount = MultiPointSDK.Instance.MouseDeviceList.Count; 
} 



希望有帮助!

Hugo RSF [MIC ETEPAM]


这篇关于小鼠数量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆