如何識別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。
你問這些設備的存在或關於空閒超時? –