Source language: Translate to:

Using SendKeys to unlock the keyboard shift state

Questions about using NeoBook's scripting language

Moderator: Neosoft Support

Using SendKeys to unlock the keyboard shift state

Postby Enigman » Sun Dec 28, 2014 6:50 pm

I have an application that uses SendKeys to transmit usernames and passwords to websites. I have noticed that if the physical keyboard shift lock is on, then all transmitted characters are sent as upper case even though what I am sending is lower case.

I have not seen a key code that works against the shift lock. I have tried the {Shiftup} and {ShiftDn] codes and they have no effect on the lock status.

Does anyone know how I can turn off the shift lock prior to using SendKeys or as a part of the string of SendKeys codes?

And why on earth does the shift lock override the Sendkeys command content?

Thanks.
User avatar
Enigman
 
Posts: 314
Joined: Tue Apr 12, 2005 3:57 pm
Location: Foothill Ranch, CA

Re: Using SendKeys to unlock the keyboard shift state

Postby Tony Kroos » Sun Dec 28, 2014 8:08 pm

And why on earth does the shift lock override the Sendkeys command content?

Because it doesn't send text strings like you type it in SendKeys parameters. It sends system messages emulating keyboard key press events, and results may vary, depending on current keyboard and key status, active layout, etc...
I have tried the {Shiftup} and {ShiftDn] codes and they have no effect on the lock status.

Check OS keyboard settings (sticky keys options maybe?) and/or keyboard manual to find out which key press disables shiftlock, or maybe you should press shift and hold it for some specified time before releasing...
Tony Kroos
 
Posts: 402
Joined: Thu Oct 15, 2009 3:43 pm

Re: Using SendKeys to unlock the keyboard shift state

Postby Enigman » Sun Dec 28, 2014 8:43 pm

Check OS keyboard settings (sticky keys options maybe?) and/or keyboard manual to find out which key press disables shiftlock, or maybe you should press shift and hold it for some specified time before releasing...

Uh ... what? This is on a laptop. No keyboard manual. Besides, what I am looking for is something specific to Neobook to disable the shift lock using SendKeys. Something undocumented maybe like {ShiftLockOff}, or an ascii number combination. No laptop or desktop manual or OS settings are going to document what to use with the Neobook Sendkeys command. I'm looking for something someone may have discovered that does it. Or a chime in from Dave?

Thanks.
User avatar
Enigman
 
Posts: 314
Joined: Tue Apr 12, 2005 3:57 pm
Location: Foothill Ranch, CA

Re: Using SendKeys to unlock the keyboard shift state

Postby CN_Iceman » Mon Dec 29, 2014 12:04 am

Hi...

The rtFileSystemMgt Plug-In Library (rtFSM) has some interesting features to control the keyboard.

- rtGetCapsLock (Check CapsLock status)
- rtSetCapsLockOFF (Set the Caps Lock to Off mode)
- rtSetCapsLockON (Set the Caps Lock to ON mode)
- rtGetNumLock (Check Num Lock status)
- rtSetNumLockOFF (Set the Num Lock to Off mode)
- rtSetNumLockON (Set the Num Lock to ON mode)
- rtGetScrollLock (Check the Scroll Lock status)
- rtSetScrollLockOFF (Set the Scroll Lock to Off mode)
- rtSetScrollLockON (Set the Scroll Lock to ON mode)

The Plugin is distributed as SHAREWARE, and is available on evaluation for 30 days trial period.
Greetings/Saludos, Jose.
www.icemansoft.es
User avatar
CN_Iceman
 
Posts: 297
Joined: Tue Mar 01, 2011 11:04 am
Location: España

Re: Using SendKeys to unlock the keyboard shift state

Postby Enigman » Mon Dec 29, 2014 9:01 am

The Plugin is distributed as SHAREWARE, and is available on evaluation for 30 days trial period.

Thanks for that pointer. I'll keep that in mind.

Still looking for a way to do it in native NB.

Thanks.
User avatar
Enigman
 
Posts: 314
Joined: Tue Apr 12, 2005 3:57 pm
Location: Foothill Ranch, CA

Re: Using SendKeys to unlock the keyboard shift state

Postby dpayer » Mon Dec 29, 2014 11:11 am

David Payer
Des Moines, Iowa
USA
User avatar
dpayer
 
Posts: 1380
Joined: Mon Apr 11, 2005 5:55 am
Location: Iowa - USA

Re: Using SendKeys to unlock the keyboard shift state

Postby Enigman » Mon Dec 29, 2014 12:24 pm


:-) Thanks for that pointer, but I am not going to tell my customers to perform a registry change just to solve this issue. I am not looking for a permanent disabling of the shift lock. I looking for a native NB programatic way to turn off the lock before a username and password are transmitted with SendKeys.

Thanks.
User avatar
Enigman
 
Posts: 314
Joined: Tue Apr 12, 2005 3:57 pm
Location: Foothill Ranch, CA

Re: Using SendKeys to unlock the keyboard shift state

Postby Neosoft Support » Mon Dec 29, 2014 12:31 pm

You might be able to turn off the caps lock with a VBScript function:

https://www.google.com/webhp?q=vbscript+turn+off+capslock
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5593
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Re: Using SendKeys to unlock the keyboard shift state

Postby Garic » Mon Dec 29, 2014 4:44 pm

ksCapsLockStatus
ksCapsLockPush
You can also use commands from ksFunctions plugin to check the status mode CapsLock, and turn it on or off as needed.
The only but - Plugin has Russian interface .
ks
.............
Image
User avatar
Garic
 
Posts: 107
Joined: Wed Sep 26, 2012 8:42 am

Re: Using SendKeys to unlock the keyboard shift state

Postby Enigman » Mon Dec 29, 2014 7:14 pm

Neosoft Support wrote:You might be able to turn off the caps lock with a VBScript function:

https://www.google.com/webhp?q=vbscript+turn+off+capslock

After looking at the results of the above search I saw a code string of {CapsLock}. It turns out that the code is supported by the Neobook SendKeys command. However, it is a toggle and not an off switch. So you send it once and caps lock is toggled to the opposite state. Send it again and it is toggled again. That is no good without status detection. Additional searches for determining the status of the caps lock using VBScript shows that no one really knows a viable way to check the status using VBScript, at least not published. The only script seen requires that MS Word be preloaded on the target computer. Can't use that.

I know there is a plug-in that will check the status, but I prefer not to be dependant on someone's plug-in for this. Has anyone found a way to check the status either in VBScript as a function or in native Neobook?

Thanks.
User avatar
Enigman
 
Posts: 314
Joined: Tue Apr 12, 2005 3:57 pm
Location: Foothill Ranch, CA

Re: Using SendKeys to unlock the keyboard shift state

Postby dec » Tue Dec 30, 2014 4:02 am

Hello,

Just to add another way:

* npGetKeyboardLockKeys

* npSetKeyboardLockKeys
.
Enhance your NeoBook applications!
.
57 plugins, 1113 actions and 230 samples
.
NeoPlugins website: www.neoplugins.com
.
User avatar
dec
 
Posts: 1663
Joined: Wed Nov 16, 2005 12:48 am
Location: Spain

Re: Using SendKeys to unlock the keyboard shift state

Postby dpayer » Tue Dec 30, 2014 12:31 pm

Enigman wrote:
Neosoft Support wrote:You might be able to turn off the caps lock with a VBScript function:

https://www.google.com/webhp?q=vbscript+turn+off+capslock

After looking at the results of the above search I saw a code string of {CapsLock}. It turns out that the code is supported by the Neobook SendKeys command. However, it is a toggle and not an off switch. So you send it once and caps lock is toggled to the opposite state. Send it again and it is toggled again. That is no good without status detection.
Thanks.


You could do your own status detection by sending a keystroke to a hidden text field and then checking the results with the CASE SENSITIVE option of SearchStr ( a native NB command).
David Payer
Des Moines, Iowa
USA
User avatar
dpayer
 
Posts: 1380
Joined: Mon Apr 11, 2005 5:55 am
Location: Iowa - USA

Re: Using SendKeys to unlock the keyboard shift state

Postby Enigman » Tue Dec 30, 2014 6:50 pm

You could do your own status detection by sending a keystroke to a hidden text field and then checking the results with the CASE SENSITIVE option of SearchStr ( a native NB command).

Okay ... that works. I placed a text input box off stage and called it CaseCheck with a variable name of [CaseCheck]. The program initializes it blank on startup just to be sure. I made it so that if the caps lock was on for some reason, I turn it off to do the transmitting, then turn it back on. If it was off first, then nothing extra is done.

Here's how it codes out:

Code: Select all
. Find out if caps lock is on
FocusObject "CaseCheck"
SendKeys "" "a"
SearchStr "A" "[CaseCheck]" "[CapOffset]" "CaseSensitive"
IfEx "[CapOffset] > 0"
     . Caps lock is on, turn it off
     SendKeys "" "{CapsLock}"
EndIf

. Do transmitting stuff here...

IfEx "[CapOffset] > 0"
     . Caps lock was on, turn it back on
     SendKeys "" "{CapsLock}"
EndIf
SetVar "[CaseCheck]" ""

The trailing SetVar to clear the box is very important. Otherwise the test will be inaccurate on the second usage.

I always prefer native NB solutions over plug-ins unless I write the plug-in myself (which I haven't tried yet). I've had some bad experience where my program outlived the plug-in support and I lost a critical function that ended up killing my program viability.

Thanks.
User avatar
Enigman
 
Posts: 314
Joined: Tue Apr 12, 2005 3:57 pm
Location: Foothill Ranch, CA


Return to NeoBook Action Commands

Who is online

Users browsing this forum: No registered users and 1 guest