如何检测鼠标是否空闲 [英] How to detect if mouse is idle

查看:97
本文介绍了如何检测鼠标是否空闲的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

程序员,我正在创建高级视频播放器

i想要当鼠标空闲(不移动)时全屏父模式改为全屏仅视频模式

我的这个代码



< pre lang =   C#>如果 //  鼠标空闲我想参加此活动发生 
{
Player1.FullScreenMode = FullScreenMode.Display;
}
如果 // 鼠标未空闲(移动)我想要发生此事件
Player1.FullScreenMode = FullScreenMode.Parent; < / pre >

感谢 你的帮助





我的尝试:



i尝试检测鼠标是否空闲以更改全屏模式以显示暂停,停止..按钮

解决方案

因为Windows环境下的所有编程都是事件只要没有为该设备触发事件,您可以将所有设备视为空闲。您可以通过在进入/退出事件过程时设置/重置全局标志来跟踪鼠标事件。


hi programmers, i'm in creating advanced video player
i want when mouse is idle(not moving) fullscreen parent mode change to fullscreen only video mode
its my code for this

<pre lang="C#">if //mouse is idle i want to this event happen
 {
Player1.FullScreenMode = FullScreenMode.Display;
}
if //mouse is not idle(moving) i want this event happen
 Player1.FullScreenMode = FullScreenMode.Parent;</pre>

thanks for your help



What I have tried:

i trying to detect if mouse is idle or not to change fullscreen mode to display pause, stop..etc buttons

解决方案

Because all programming under Windows environment is event-oriented you can consider all devices as idle as long as no event is fired for that device. You can track mouse events by simply set/reset a global flag on entering/exiting it's event procedures.


这篇关于如何检测鼠标是否空闲的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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