如何识别Windows-mobile 6.5上缺少触摸屏和键盘?如何识别Windows Mobile 6.5上缺少触摸屏和键盘
如果我不触摸屏幕或按我需要回到主屏幕
我怎么能做到这一点在C#在Windows Mobile 6.5的任意键?
如何识别Windows-mobile 6.5上缺少触摸屏和键盘?如何识别Windows Mobile 6.5上缺少触摸屏和键盘
如果我不触摸屏幕或按我需要回到主屏幕
我怎么能做到这一点在C#在Windows Mobile 6.5的任意键?
我在我的设备上执行此操作。
只需添加一个Timer
和一个简短函数Reset()
。
const int TIME_LIMIT = 50000; // set to whatever you need
int timeout;
Timer Timer1;
void Form1() {
Timer1 = new Timer();
Timer1.Interval = 200; // 200 milliseconds
Timer1.Tick += new EventHandler(Timer_Tick);
}
void ShowSubPanel() {
Timer_Reset();
panelSub1.BringToFront();
}
void Timer_Reset() {
Timer_Stop();
Timer_Start();
}
void Timer_Start() {
timeout = 0;
Timer1.Start();
}
void Timer_Stop() {
Timer1.Stop();
}
void Timer_Tick() {
if (TIME_LIMIT < timeout++) {
Timer_Stop();
// Here, call your Main Form
Main.BringToFront(); // I use Panels instead of forms
}
}
就像一些信息,如果你有很多形式(我意识到你正在使用面板),这将有点乏味,这将是很难扩展/维护。 – ctacke
我同意Henk的意见,不清楚您是否想要检测缺少用户输入或检测是否存在这些接口。用于检测用户空闲状况,this might be of interest。用于检测硬件接口可用性,this might help。
你问这些设备的存在或关于空闲超时? –