StrokesPlus Forum
                       
StrokesPlus Forum
Home | Profile | Register | Active Topics
Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Lua Scripts
 Internal Functions (actions)
 Details on acSendKeys() Usage
 New Topic  Reply to Topic
 Printer Friendly
Author  Topic Next Topic  

Rob

USA
2584 Posts

Posted - 12/22/2011 :  09:49:41  Show Profile  Visit Rob's Homepage  Reply with Quote
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
2584 Posts

Posted - 02/19/2012 :  19:48:06  Show Profile  Visit Rob's Homepage  Reply with Quote
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".
Go to Top of Page

ycomp

14 Posts

Posted - 10/03/2013 :  09:12:49  Show Profile  Reply with Quote
is there any way to send keys globally?

For instance I want to trigger a PrntScr or Alt-PrntScr
Go to Top of Page

Rob

USA
2584 Posts

Posted - 10/03/2013 :  09:16:25  Show Profile  Visit Rob's Homepage  Reply with Quote
Sure, Windows calls the Print Screen function "snapshot":

--Print Screen
acSendKeys("{SNAPSHOT}")

--ALT+Print Screen
acSendKeys("%{SNAPSHOT}")
Go to Top of Page

mdx

3 Posts

Posted - 01/30/2014 :  02:11:12  Show Profile  Reply with Quote
is there any way to send the Fn (function) key?

Also, SPACEBAR seems to be missing, so I used {VKEY 32} which worked fine.
Go to Top of Page

Rob

USA
2584 Posts

Posted - 01/30/2014 :  10:40:21  Show Profile  Visit Rob's Homepage  Reply with Quote
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
Go to Top of Page

Mersine

22 Posts

Posted - 05/05/2015 :  09:33:27  Show Profile  Reply with Quote
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
Go to Top of Page

Rob

USA
2584 Posts

Posted - 05/05/2015 :  09:37:52  Show Profile  Visit Rob's Homepage  Reply with Quote
Should just have to escape it with a backslash, but not at my computer to confirm. E.g.

acSendKeys("Here is a \" ")
Go to Top of Page

freakpaul

4 Posts

Posted - 05/31/2015 :  13:53:45  Show Profile  Reply with Quote
Hey,

any clue which virtual key is equal to "POS1"?
http://l7.alamy.com/zooms/dc6098deceff49a7b6cc03ffee15e5ce/pos1-key-on-a-keyboard-ct78gn.jpg
Go to Top of Page

Rob

USA
2584 Posts

Posted - 06/01/2015 :  16:34:56  Show Profile  Visit Rob's Homepage  Reply with Quote
No clue. Maybe see if this detects the key press?

http://delphiforfun.org/programs/utilities/KeyCodes.htm
Go to Top of Page

freakpaul

4 Posts

Posted - 06/03/2015 :  13:34:49  Show Profile  Reply with Quote
Hey Rob,
I have figured it out. On english keyboards this is the {HOME} button.
Thanks for your answer.
Go to Top of Page

limitless1689

Indonesia
7 Posts

Posted - 06/14/2019 :  00:19:08  Show Profile  Reply with Quote
Is there a way to send double quotation marks "" ?

Go Irwan Santoso
Go to Top of Page

Rob

USA
2584 Posts

Posted - 06/14/2019 :  07:48:56  Show Profile  Visit Rob's Homepage  Reply with Quote
acSendKeys("\"") --Sends one "
acSendKeys("\"\"") --Sends two ""

You simply have to escape quotation marks with a preceding backslash.
Go to Top of Page

Windie

5 Posts

Posted - 06/14/2019 :  20:54:13  Show Profile  Reply with Quote
How to send Pause key ?
Go to Top of Page

Hard.Wired

62 Posts

Posted - 06/15/2019 :  00:25:54  Show Profile  Reply with Quote
{VKEY 0x13}
Go to Top of Page
   Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
StrokesPlus Forum © 2011-2018 Rob Yapchanyk Go To Top Of Page
Snitz Forums 2000