了解橙色按钮的摩托罗拉MC65状态 [英] Knowing the state of orange button in motorola MC65
问题描述
我需要能够知道什么是橙色按钮的当前状态,并得到通知,如果这种状态已经改变摩托罗拉设备MC65。 可悲的是我不能使用Symbol.Keyboard.KeyPad类,因为它不支持MC65
I need to be able to know what is the current state of orange button and be notified if this state has changed on Motorola device MC65. Sadly I can't use Symbol.Keyboard.KeyPad class since it is not supported on MC65
推荐答案
在docos状态:
键盘支持的功能 - 只有以下两个API的是 在MC65支持。
Keyboard Supported feature - Only the following two API’s are supported on MC65.
Symbol.Keyboard.KeyPad.SetKeyState。 Symbol.Keyboard.KeyPad.GetKeyStateEx。
Symbol.Keyboard.KeyPad.SetKeyState. Symbol.Keyboard.KeyPad.GetKeyStateEx.
以下键不MC65支持。 KEYSTATE_ALT,KEYSTATE_CTRL, KEYSTATE_NUMLOCK,KEYSTATE_NUMERIC_LOCK,KEYSTATE_CAPSLOCK
Following keys are not supported in MC65. KEYSTATE_ALT, KEYSTATE_CTRL, KEYSTATE_NUMLOCK, KEYSTATE_NUMERIC_LOCK, KEYSTATE_CAPSLOCK
有关的MC65,微软API,不能用于获取橙键 状态。 的Symbol.Keyboard.KeyPad类提供了一个新的 GetKeyStateEx()函数来获取改性剂的当前状态 键。参考API函数的页为这个API的说明。
For the MC65, Microsoft APIs cannot be used to get the Orange key states. The Symbol.Keyboard.KeyPad class provides a new GetKeyStateEx() function to get the current state of the modifier keys. Refer to the API function’s page for a description of this API.
和它有这个code样品:</ P>
And it has this code sample:
// Get the key states
int keyState = keypad.GetKeyStateEx();
bool lockedState = false;
// Checking for a lock state first as it cannot be combined with others
switch (keyState)
{
case KeyStates.KEYSTATE_ORANGE_SHIFT_LOCK:
checkBoxOrangeShiftLock.Checked = true;
lockedState = true;
break;
case KeyStates.KEYSTATE_FUNCTION_LOCK:
checkBoxFuncLock.Checked = true;
lockedState = true;
break;
case KeyStates.KEYSTATE_ORANGE_LOCK:
checkBoxOrangeLock.Checked = true;
lockedState = true;
break;
case KeyStates.KEYSTATE_NUMERIC_LOCK:
checkBoxNumLock.Checked = true;
lockedState = true;
break;
case KeyStates.KEYSTATE_SHIFT_LOCK:
checkBoxShiftLock.Checked = true;
lockedState = true;
break;
default:
break;
}
if (lockedState)
{
// No need to continue if a locked state
this.Update();
return;
}
// Process unlock or temp lock states if any
this.checkBoxUnShift.Checked = (keyState & KeyStates.KEYSTATE_UNSHIFT) != 0;
this.checkBoxShift.Checked = (keyState & KeyStates.KEYSTATE_SHIFT) != 0;
this.checkBoxCtrl.Checked = (keyState & KeyStates.KEYSTATE_CTRL) != 0;
this.checkBoxAlt.Checked = (keyState & KeyStates.KEYSTATE_ALT) != 0;
this.checkBoxNum.Checked = (keyState & KeyStates.KEYSTATE_NUMLOCK) != 0;
this.checkBoxCaps.Checked = (keyState & KeyStates.KEYSTATE_CAPSLOCK) != 0;
this.checkBoxFunc.Checked = (keyState & KeyStates.KEYSTATE_FUNC) != 0;
this.checkBoxOrangeTemp.Checked = (keyState & KeyStates.KEYSTATE_ORANGE_TEMP) != 0;
希望帮助!
这篇关于了解橙色按钮的摩托罗拉MC65状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!