Ask a Question

How to Send "Right Alt" key using shell object.

HKosova
Moderator

RE: How to Send "Right Alt" key using shell object.

In my system it showing as Unknown key and virtual key code is - 21. Is this issye with keyboard or anything in the system configuration.

with Sys.Desktop.KeyDown(Win32API.RMENU) is not working.
First of all, please note that the constant name is VK_RMENU, not RMENU. I assume it's just a misprint in your post, but I'm clarifying just in case.



If the VK_RMENU constant doesn't work for you, it means that the key in question has some other function rather than simply Right Alt. The Virtual-Key Codes article in MSDN says that key code 21 (0x15) corresponds to VK_HANGUL and VK_KANA, that is, Hangul and Kana IMEs. Have you tried using one of these constants instead of VK_RMENU as I previously suggested? E.g.:

Sys.Desktop.KeyDown(Win32API.VK_HANGUL)

Sys.Desktop.KeyUp(Win32API.VK_HANGUL)
Does this work for you?

Helen Kosova
SmartBear Documentation Team Lead
________________________
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
manojgovikari
Contributor

RE: How to Send "Right Alt" key using shell object.

Thank you very much for your support. I was able to change to HANGUL. Do we have key codes for each input method like this? Suppose i would like to change to English input method.. so which virtual key code needs to be used? please share reference link if we have any key codes for each language input methods.
Thanks,
Manoj Govikari
HKosova
Moderator

RE: How to Send "Right Alt" key using shell object.

Hi Manoj,



I'm glad I could help!



Unfortunately, I don't know much about Korean keyboards, but from what I've read, I believe that VK_HANGUL is used to toggle between Korean and English. So, you can probably use the same key code to switch back to English.



If you have many input languages installed, I'd actually recommend using the specialized aqEnvironment.SetKeyboardLayout operation to activate the needed language. It will be more robust and less obscure that using key codes.

Helen Kosova
SmartBear Documentation Team Lead
________________________
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
cancel
Showing results for 
Search instead for 
Did you mean: