Jump to content

Issue with Send("{SHIFTDOWN}")


Recommended Posts

Hi friends,

I'm trying to send SHIFTDOWN, to keep the Shift key pressed until I close the program or releases the key.

Send ( "{SHIFTDOWN}")
sleep(100)
$text = InputBox("Shift key down", "Shift key is down. Type something: ")
$ret = Msgbox(0,"", "Press and release shift key manually and select [Ok] to continue")
$text = InputBox("Shift key up", "Shift key is released manually, now type something: ")
Send ( "{SHIFTDOWN}")
sleep(100)
$text = InputBox("Shift key down Agin", "Shift key is pressed again, now type something: ")

In the above program sequence,

1. Send SHIFTDOWN from program, Works as we type in the text are in Capital letters

2. Manually presses and releases the SHIFT button. SHIFT key is released as when we type, text is in small letters only.

3. Again send SHIFTDOWN from program, but not working. When we type the letters are in small letters.

 

If we send a SHIFTUP  before  sending the SHIFTDOWN again, then it is working correctly and the text appears in capital letters only. Can any one explain why this happens?

Send ( "{SHIFTDOWN}")
sleep(100)
$text = InputBox("Shift key down", "Shift key is down. Type something: ")
$ret = Msgbox(0,"", "Press and release shift key and select [Ok] to continue")
$text = InputBox("Shift key up", "Shift key is released manually, now type something: ")
Send ( "{SHIFTUP}")
sleep(100)
Send ( "{SHIFTDOWN}")
sleep(100)
$text = InputBox("Shift key down", "Shift key is pressed, now type something: ")

 

Thank you.

Link to comment
Share on other sites

Yes but still, why is it not working after a manual shift press and release?

Only want to see, if there is a better solution than I applied now. Now, in my code, to make {SHIFTDOWN} to work always, I am calling a {SHIFTUP} before it.

Thank you.

Link to comment
Share on other sites

Thank you for your suggestion Bert but when I execute the script, I do not know the control. I'm trying to type in some previously saved  text and control keys to the active control on the active window.

Is there any issue in calling a {SHIFTUP} always before calling a {SHIFTDOWN}? 

Link to comment
Share on other sites

there might be issues because when you send SHIFTDOWN its leaks to what ever is open
make sure to send SHIFTUP especially before you exit the script otherwise it will continue to linger, manually needing to press shift to release its effect

Link to comment
Share on other sites

On 6/5/2018 at 7:45 AM, PoojaKrishna said:

Thank you for your suggestion Bert but when I execute the script, I do not know the control. I'm trying to type in some previously saved  text and control keys to the active control on the active window.

Is there any issue in calling a {SHIFTUP} always before calling a {SHIFTDOWN}? 

have you tried to get the control ID using the AutoIt Info tool?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...