Author |
Topic |
|
Rob
USA
2615 Posts |
Posted - 12/22/2011 : 09:49:41
|
SendKeys commands:
Based on the following project: http://www.codeproject.com/KB/cpp/sendkeys_cpp_Article.aspx
----
Key Modifiers (indicate the button should be pressed along with the following character, useful for sending ALT+H, which would read "%h"):
@ = WINKEY + = SHIFT ^ = CTRL % = ALT
Other Functions:
{VKEY X} - Sends the VKEY specified. Useful if there's a VKEY I don't have defined. For example, {VKEY 13} is equivalent to VK_RETURN. See: http://msdn.microsoft.com/en-us/library/dd375731%28v=VS.85%29.aspx {BEEP X Y} - Beeps with a frequency of X and a duration of Y ms. {DELAY X} - Delays sending the next key of X milliseconds. After the delaying the following key, the subsequent keys will not be further delayed unless there is a default delay value (see DELAY=X). Example: {DELAY 1000} <-- delays subsequent key stroke for 1 second.
{DELAY=X} - Sets the default delay value to X milliseconds. This will cause every key to be delayed X ms. If a value is already set and you specify {DELAY Y} you will have your following key delay Y ms but the subsequent keys will be delayed X ms. Example: {DELAY=1000} <-- all subsequent keys will be delayed for 1 second. Full SendKeys listing: {ADD} = VK_ADD {APPS} = VK_APPS {AT} = @ {BACKSPACE} = VK_BACK {BKSP} = VK_BACK {BREAK} = VK_CANCEL {BROWSERBACK} = VK_BROWSER_BACK {BROWSERFAVORITES} = VK_BROWSER_FAVORITES {BROWSERFORWARD} = VK_BROWSER_FORWARD {BROWSERHOME} = VK_BROWSER_HOME {BROWSERREFRESH} = VK_BROWSER_REFRESH {BROWSERSEARCH} = VK_BROWSER_SEARCH {BROWSERSTOP} = VK_BROWSER_STOP {BS} = VK_BACK {CAPSLOCK} = VK_CAPITAL {CARET} = ^ {CLEAR} = VK_CLEAR {DECIMAL} = VK_DECIMAL {DEL} = VK_DELETE {DELETE} = VK_DELETE {DIVIDE} = VK_DIVIDE {DOWN} = VK_DOWN {END} = VK_END {ENTER} = VK_RETURN {ESC} = VK_ESCAPE {ESCAPE} = VK_ESCAPE {F10} = VK_F10 {F11} = VK_F11 {F12} = VK_F12 {F13} = VK_F13 {F14} = VK_F14 {F15} = VK_F15 {F16} = VK_F16 {F_1} = VK_F1 {F_2} = VK_F2 {F_3} = VK_F3 {F_4} = VK_F4 {F_5} = VK_F5 {F_6} = VK_F6 {F_7} = VK_F7 {F_8} = VK_F8 {F_9} = VK_F9 {HELP} = VK_HELP {HOME} = VK_HOME {INS} = VK_INSERT {LBRACE} = { {LEFT} = VK_LEFT {LPAREN} = ( {LWIN} = VK_LWIN {MEDIANEXTTRACK} = VK_MEDIA_NEXT_TRACK {MEDIAPLAYPAUSE} = VK_MEDIA_PLAY_PAUSE {MEDIAPREVTRACK} = VK_MEDIA_PREV_TRACK {MEDIASTOP} = VK_MEDIA_STOP {MULTIPLY} = VK_MULTIPLY {NUMLOCK} = VK_NUMLOCK {NUMPAD0} = VK_NUMPAD0 {NUMPAD1} = VK_NUMPAD1 {NUMPAD2} = VK_NUMPAD2 {NUMPAD3} = VK_NUMPAD3 {NUMPAD4} = VK_NUMPAD4 {NUMPAD5} = VK_NUMPAD5 {NUMPAD6} = VK_NUMPAD6 {NUMPAD7} = VK_NUMPAD7 {NUMPAD8} = VK_NUMPAD8 {NUMPAD9} = VK_NUMPAD9 {PERCENT} = % {PGDN} = VK_NEXT {PGUP} = VK_PRIOR {PLUS} = + {PRTSC} = VK_PRINT {RBRACE} = } {RIGHT} = VK_RIGHT {RPAREN} = ) {RWIN} = VK_RWIN {SCROLL} = VK_SCROLL {SEPARATOR} - VK_SEPARATOR {SLEEP} - VK_SLEEP {SNAPSHOT} = VK_SNAPSHOT {SUBTRACT} - VK_SUBTRACT {TAB} = VK_TAB {TILDE} = ~ {UP} = VK_UP {VOLDOWN} = VK_VOLUME_DOWN {VOLMUTE} = VK_VOLUME_MUTE {VOLUP} = VK_VOLUME_UP {WIN} = VK_LWIN |
|
Rob
USA
2615 Posts |
Posted - 02/19/2012 : 19:48:06
|
The previous post reads "Full SendKeys listing", but it's really just a list of the special/reserved characters.
For example, acSendKeys("hello world") types "hello world".
|
|
|
ycomp
14 Posts |
Posted - 10/03/2013 : 09:12:49
|
is there any way to send keys globally?
For instance I want to trigger a PrntScr or Alt-PrntScr
|
|
|
Rob
USA
2615 Posts |
Posted - 10/03/2013 : 09:16:25
|
Sure, Windows calls the Print Screen function "snapshot":
--Print Screen acSendKeys("{SNAPSHOT}")
--ALT+Print Screen acSendKeys("%{SNAPSHOT}") |
|
|
mdx
3 Posts |
Posted - 01/30/2014 : 02:11:12
|
is there any way to send the Fn (function) key?
Also, SPACEBAR seems to be missing, so I used {VKEY 32} which worked fine. |
|
|
Rob
USA
2615 Posts |
Posted - 01/30/2014 : 10:40:21
|
The Fn key is very tricky as the combinations you probably want to use are generally captured by a driver which is watching the physical keyboard input, not synthesized input; I've had no luck getting it to work at all. Though technically, acSendKeyDown(255) / acSendKeyUp(255) sends the Fn down/up events.
acSendKeys(" ") works too |
|
|
Mersine
22 Posts |
Posted - 05/05/2015 : 09:33:27
|
Hi Rob,
Long time no talk. I'm glad your project is still going strong, I use strokeplus very often. Quick question, what is the key for quotes?
" = ???
Thanks |
|
|
Rob
USA
2615 Posts |
Posted - 05/05/2015 : 09:37:52
|
Should just have to escape it with a backslash, but not at my computer to confirm. E.g.
acSendKeys("Here is a \" ") |
|
|
freakpaul
4 Posts |
|
Rob
USA
2615 Posts |
|
freakpaul
4 Posts |
Posted - 06/03/2015 : 13:34:49
|
Hey Rob, I have figured it out. On english keyboards this is the {HOME} button. Thanks for your answer. |
|
|
limitless1689
Indonesia
11 Posts |
Posted - 06/14/2019 : 00:19:08
|
Is there a way to send double quotation marks "" ? |
Go Irwan Santoso |
|
|
Rob
USA
2615 Posts |
Posted - 06/14/2019 : 07:48:56
|
acSendKeys("\"") --Sends one " acSendKeys("\"\"") --Sends two ""
You simply have to escape quotation marks with a preceding backslash. |
|
|
Windie
6 Posts |
Posted - 06/14/2019 : 20:54:13
|
How to send Pause key ? |
|
|
Hard.Wired
84 Posts |
Posted - 06/15/2019 : 00:25:54
|
{VKEY 0x13}
|
|
|
limitless1689
Indonesia
11 Posts |
Posted - 02/18/2020 : 01:02:52
|
How to send the Slash key / ?
|
Go Irwan Santoso |
|
|
Hard.Wired
84 Posts |
Posted - 02/20/2020 : 00:02:41
|
acSendKeys("/") should work. |
|
|
|
Topic |
|