Caps Lock detection - InfoPath Dev
in

InfoPath Dev

Caps Lock detection

Last post 11-19-2009 11:34 AM by rcant. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 11-17-2009 07:46 AM

    • rcant
    • Top 500 Contributor
      Male
    • Joined on 03-24-2008
    • Rochester
    • Posts 27

    Caps Lock detection

    Anyone have any thoughts or ideas on a good way to detect if the a the caps lock is while someone is filling out a Infopath 07 form. (not a web form)

     

    Thanks!

     

    ~Rcant

  • 11-17-2009 08:20 PM In reply to

    if you are using code behind then it is easy

    using System;
    using System.Runtime.InteropServices;
    using System.Windows.Forms;

    public class CapsLockControl
    {
        [DllImport("user32.dll")]
            static extern void keybd_event(byte bVk, byte bScan, uint dwFlags,UIntPtr dwExtraInfo);
        const int KEYEVENTF_EXTENDEDKEY = 0x1;
        const int KEYEVENTF_KEYUP = 0x2;

        public static void Main()
        {
            if (Control.IsKeyLocked(Keys.CapsLock))
      //         Caps Lock key is ON.

            else
    //            Caps Lock key is OFF
        }
    }

    Qazi Anis
    Technical Architect
    Bitwise Inc
  • 11-19-2009 11:34 AM In reply to

    • rcant
    • Top 500 Contributor
      Male
    • Joined on 03-24-2008
    • Rochester
    • Posts 27

     i am using some plenty of jscript code behind --

     not sure if i can accomplish the same thing  as above

     does jscript have a similar method?.

    thanks

Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.