LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading keystate of CAPS Lock.

Hello,
I'm developing a vi which takes username and password as input.I just want to display a tip saying CAPS Lock ON
if the CAPS key is pressed as the vi starts up.
This would be a standard login screen with tip being displayed if incorect password is entered.
It would be great if someone could help me out in reading the keystate of CAPS.
Thanks in advance.

-Nalin
0 Kudos
Message 1 of 9
(3,915 Views)
You don't need it.

Simply compare the entered password with itself converted to uppercase (it's in the strings palette) to see if they are equal.
IF the password is incorrect AND the above test is TRUE, give the capslock warning. 🙂
Message 2 of 9
(3,908 Views)
Hi Nalin,
You can make use of the Event case ,for a case of the input string of the password,you need to check for the VKey and char and make of this logic.
//if upper case, check if shift is not pressed. if lower case, check if shift is pressed
( ( char > 64 && char < 91 && !theShift ) || ( char > 96 && char < 123 && theShift ) );

do let me know if you cant implement it in LV i shall do it for you.
Best regards
vicky
Message 3 of 9
(3,906 Views)
Thanks for the help.
The logic is fine with the current scenario which i could implement in Labview.
Just thought whether without considering the password input by the user,a tip could be displayed.
That is just by checking the CAPS Lock state whether its (ON/OFF)once the vi is run.
If the CAPS Lock is ON,i would like to display a tip saying "CAPS LOCK ON".
This would be given as warning to the user before he types the password.
Thanks in advance for your time.

-Nalin
0 Kudos
Message 4 of 9
(3,902 Views)
Have a look here.

___________________
Try to take over the world!
0 Kudos
Message 5 of 9
(3,895 Views)
Thanks a lot.It works absolutely fine.
Just want to know whether,a tool tip could be displayed as well.
I have attached a jpg image which is a tool tip from Outlook(just for example on the kind of tool tip).
Similar to that,could a tool tip be displayed in Labview for incorrect password,
say for example "CAPS LOCK is ON".
It's not mandatory for the tool tip to be in that format(like the way windows displays),
for any kind of format is there any provision in Labview.
Thanks in advance for your help.

-Nalin
0 Kudos
Message 6 of 9
(3,892 Views)
The simplest way would be to have a control (let's say a customized boolean) with your text, and to hide\unhide it using its Visible property with a property node.
If you want something more advanced, the microsoft tooltips can probably be accessed through windows API functions, but you will have to look elsewhere for that.

___________________
Try to take over the world!
0 Kudos
Message 7 of 9
(3,886 Views)
Yeah i agree with TST else what you can do is just make use of the ToolStrip property,so when ever the Caps lock is ON then you can show the tool strip else you dont.
Cheers
vicky
0 Kudos
Message 8 of 9
(3,866 Views)
Thanks a lot tst and vicky.
I just tried customizing a boolean,as well displayed it on vi when
CAPS is on.Just trying to make the UI appear gorgeous with this addition.
Thanks once again for your time and help.
-Nalin
0 Kudos
Message 9 of 9
(3,863 Views)