We have a situation where the hardware Return button performs a certain action, However this action is also triggerd wher using the Return button on the SIP control.
Is there anyway to determine if the KeyPressEventArg has come from the SIP?
/// <summary>
/// Handles the Enter button being pressed as navigation to complete the signature capture
/// </summary>
/// <param name="e">The key event args to quaify what button was pressed.</param>
public override void HandleKeyPress(KeyPressEventArgs e)
{
if (e.KeyChar == '\r') // and is not SIP '\r'
{
// need to handle only hard button not SIP
}
}
Many thanks for any enlightenment on this
Ok after another day of experimenting I have found a stable way to indicate SIP(InputPanel) key presses from hardbutton key presses.
Using
PeekMessagewe can check the keyvalue in the message queue and check for theLParamof ‘1’ which always seems to be 1 when coming from the SIP (accross all devices).Code below
Usage:
Hope this helps someone else 🙂