Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8971743
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:02:17+00:00 2026-06-15T18:02:17+00:00

We have a situation where the hardware Return button performs a certain action, However

  • 0

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T18:02:18+00:00Added an answer on June 15, 2026 at 6:02 pm

    Ok after another day of experimenting I have found a stable way to indicate SIP(InputPanel) key presses from hardbutton key presses.

    Using PeekMessage we can check the keyvalue in the message queue and check for the LParam of ‘1’ which always seems to be 1 when coming from the SIP (accross all devices).

    Code below

    public class InputHelper
    {
        #region Static Members
    
        /// <summary>
        /// Determines whether the key value pressed originated from the SIP
        /// </summary>
        /// <param name="keyValue">The key value.</param>
        /// <param name="handle">The widget handle.</param>
        /// <returns>
        ///   <c>true</c> if is sip key press; otherwise, <c>false</c>.
        /// </returns>
        public static bool IsSipKeyPress(int keyValue, IntPtr handle)
        {
            NativeMessage m;
            if (PeekMessage(out m, handle, 0, 0, PM_NOREMOVE))
            {
                // All SIP inputs have LParam of 1, so ignore these
                if (m.msg == WM_CHAR && m.wParam == (IntPtr)keyValue && m.lParam == (IntPtr)1)
                {
                    return true;
                }
            }
            return false;
        }
    
        #endregion
    
    
        #region P-Invoke
    
        const uint PM_NOREMOVE = 0x0000;
        const uint WM_CHAR = 258;
    
        [DllImport("coredll.dll")]
        [return: MarshalAs(UnmanagedType.Bool)]
        static extern bool PeekMessage(out NativeMessage lpMsg, IntPtr hWnd, uint wMsgFilterMin, uint wMsgFilterMax, uint wRemoveMsg);
    
        [StructLayout(LayoutKind.Sequential)]
        public struct NativeMessage
        {
            public IntPtr handle;
            public uint msg;
            public IntPtr wParam;
            public IntPtr lParam;
            public uint time;
            public System.Drawing.Point p;
        }
    
        #endregion
    }
    

    Usage:

    /// <summary>
    /// Handle a KeyDown event and check for Hardbutton Return key
    /// </summary>
    /// <param name="e">A KeyEventArgs instance</param>
    public override void HandleKeyDown(KeyEventArgs e)
    {
        if (e.KeyValue == 13)
        {
            if (!InputHelper.IsSipKeyPress(13, base.Handle))
            {
                CompleteProcess();
            }
        }
        base.HandleKeyDown(e);
    }  
    

    Hope this helps someone else 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have situation like this: user submits form with action='/pay' in '/pay' I have
I have this situation: $(#button).toggle(function(){ $(#window).animate({top:'0%'},1000); },function(){ $(#window).animate({top:'-100%'},1000); }); but I need change it
i have situation like this: class IData { virtual void get() = 0; virtual
this is my situation: I have a XPS under Ubuntu 10.04 LTS 64-bit I
My situation is : I have a number of client applications, which is using
This is the situation I am facing. I have developed a web application that
I have situation, where running a query that filters by an indexed column in
I have situation in which I read a record from a database. And if
I have situation where I need to change the order of the columns/adding new
I have situation where a user can manipulate a large set of data (presented

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.