Skip to content

Instantly share code, notes, and snippets.

@Kambaa
Last active September 13, 2022 10:42
Show Gist options
  • Save Kambaa/15047e4ce78b390227915c0e06708dee to your computer and use it in GitHub Desktop.
Save Kambaa/15047e4ce78b390227915c0e06708dee to your computer and use it in GitHub Desktop.
Strokes Plus acsendkeys() method arguments special keys
// working examples of scripts
// ENABLE OR DISABLE
acEnableCapture()
acDisableCapture()
// MESSAGE DISPLAY
-- tray message
--acDisplayBalloonTip("Shortcut: Ctrl+Shift+Alt+X", "Strokes Plus Enabled", 1, 0)
-- win popup window
--acMessageBox("Shortcut: Ctrl+Shift+Alt+X", "Strokes Plus Enabled", nil )
-- text on screen with timeout, color and position setting
acDisplayText("Strokes Plus Enabled \nShortcut: G13","Helvetica",35,78, 252, 3,2000,20,1300)
-- SENDING WINDOW TO ANOTHER EXAMPLE
acMaximizeOrRestoreWindow(acGetForegroundWindow())
acSendWindowToPreviousMonitor(acGetForegroundWindow())
acMaximizeOrRestoreWindow(acGetForegroundWindow())
--acMaximizeWindow(acGetForegroundWindow())
FROM:
- https://www.strokesplus.com/forum/pop_printer_friendly.asp?TOPIC_ID=38
- https://www.strokesplus.com/help/#Preferences
Details on acSendKeys() Usage
Printed from: StrokesPlus Forum
Topic URL: https://www.strokesplus.com/forum/topic.asp?TOPIC_ID=38
Printed on: 05/17/2022
Topic:
Topic author: Rob
Subject: Details on acSendKeys() Usage
Posted on: 12/22/2011 09:49:41
Message:
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
Replies:
Reply author: Rob
Replied on: 02/19/2012 19:48:06
Message:
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".
Reply author: ycomp
Replied on: 10/03/2013 09:12:49
Message:
is there any way to send keys globally?
For instance I want to trigger a PrntScr or Alt-PrntScr
Reply author: Rob
Replied on: 10/03/2013 09:16:25
Message:
Sure, Windows calls the Print Screen function "snapshot":
--Print Screen
acSendKeys("{SNAPSHOT}")
--ALT+Print Screen
acSendKeys("%{SNAPSHOT}")
Reply author: mdx
Replied on: 01/30/2014 02:11:12
Message:
is there any way to send the Fn (function) key?
Also, SPACEBAR seems to be missing, so I used {VKEY 32} which worked fine.
Reply author: Rob
Replied on: 01/30/2014 10:40:21
Message:
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
Reply author: Mersine
Replied on: 05/05/2015 09:33:27
Message:
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
Reply author: Rob
Replied on: 05/05/2015 09:37:52
Message:
Should just have to escape it with a backslash, but not at my computer to confirm. E.g.
acSendKeys("Here is a \" ")
Reply author: freakpaul
Replied on: 05/31/2015 13:53:45
Message:
Hey,
any clue which virtual key is equal to "POS1"?
http://l7.alamy.com/zooms/dc6098deceff49a7b6cc03ffee15e5ce/pos1-key-on-a-keyboard-ct78gn.jpg
Reply author: Rob
Replied on: 06/01/2015 16:34:56
Message:
No clue. Maybe see if this detects the key press?
http://delphiforfun.org/programs/utilities/KeyCodes.htm
Reply author: freakpaul
Replied on: 06/03/2015 13:34:49
Message:
Hey Rob,
I have figured it out. On english keyboards this is the {HOME} button.
Thanks for your answer.
Reply author: limitless1689
Replied on: 06/14/2019 00:19:08
Message:
Is there a way to send double quotation marks "" ?
Reply author: Rob
Replied on: 06/14/2019 07:48:56
Message:
acSendKeys("\"") --Sends one "
acSendKeys("\"\"") --Sends two ""
You simply have to escape quotation marks with a preceding backslash.
Reply author: Windie
Replied on: 06/14/2019 20:54:13
Message:
How to send Pause key ?
Reply author: Hard.Wired
Replied on: 06/15/2019 00:25:54
Message:
{VKEY 0x13}
Reply author: limitless1689
Replied on: 02/18/2020 01:02:52
Message:
How to send the Slash key / ?
Reply author: Hard.Wired
Replied on: 02/20/2020 00:02:41
Message:
acSendKeys("/") should work.
StrokesPlus Forum : https://www.strokesplus.com/forum/
© 2011-2018 Rob Yapchanyk
STROKES PLUS ADVANCES SETTINGS EXPLANATIONS:
Stroke Button - the mouse button used to initiate firing action sequences
Ignore Key - held down before pressing the Stroke button if you do not want StrokesPlus to attempt to recognize an action. this is helpful when you want to perform some action in Windows or another application which requires using the Stroke Button.
Cancel Delay - this is how long StrokesPlus waits for an action to timeout. For example, if you decided to right-click and drag some files in Windows Explorer, StrokesPlus would begin to look for action sequences to fire when you let go of the Stroke button. However, if you want StrokesPlus to stop capturing the sequence, simply keep the Stroke button held down and stop moving the mouse. After the number of milliseconds specified for Cancel Delay, StrokesPlus will stop capturing mouse and keyboard events, then replay the mouse events that occurred. In this instance, it would instantly move the mouse back to the starting position and send the right-click message, then move the mouse back to where you had it. So in this example, you would see the files attached to the mouse cursor just as you would if you had right-clicked and dragged some files in Explorer without StrokesPlus running (or if you had held the Ignore Key before pressing the right mouse button).
Synaptics TouchPad - If a Synaptics TouchPad and software is detected, allows you to specify whether 1 (tap & hold), 2, or 3 fingers will be used to capture a gesture. Cursor Movement Sensitivity controls how fast or slow the mouse pointer moves while drawing on the TouchPad; this can be 5% and higher. 1 Finger Movement Threshold specifies the number of ticks from the TouchPad above which the TouchPad activity is not considered a gesture (meaning you're just moving the pointer). 1 Finger Hold Delay is how long you have to hold your finger still for S+ to begin capturing a gesture. Check Disable Integration to prevent S+ from even loading the Synaptics interface internally.
Stroke Style - These fields allow you to customize how StrokesPlus draws gestures on the screen. Pick Color...lets you select the color of the gesture draw line. Width specifies how thick the line is. Min. Gesture Length Specifies the distance that must be drawn before S+ considers a gesture should be recognized. Min. Segment Length specifies the distance between drawing segments. Length indicates the maximum length (trail) that StrokesPlus will draw, 0 for infinite. This doesn't affect the actual gesture being drawn, just how long the line is on the screen. Opacity affects the transparency of the line; 1 being nearly invisible and 255 being opaque (solid). Show instructs StrokesPlus whether or not to even draw the line at all.
Advanced / Experimental Options - these settings should used with caution as some of them could cause problems with StrokesPlus or other applications.
Match Precision - how finely StrokesPlus interpolates gestures to use for comparison. Default is 100 and there should be no need to change this setting.
Match Probability - the match likelihood of the drawn gesture to saved gestures. Higher makes the gesture matching more strict.
Aggressively Manage Memory - tells StrokesPlus to aggressively clean up memory at many points in the program's operation. Leave checked to ensure StrokesPlus uses the least amount of RAM while running. Uncheck if you want to let Windows manage the memory StrokesPlus uses; note that Windows is very liberal, only tidying up if other processes require memory used by other programs and available RAM has become limited.
Release/Reinitialize on Suspend/Resume - If checked, StrokesPlus will remove the tray icon, unhook the mouse and keyboard, and destroy the Synaptics (TouchPad) COM interface* when Windows enters a suspended mode (e.g. selecting Sleep from the shutdown menu). When Windows resumes, StrokesPlus will recreate its icon, re-hook the mouse and keyboard, and recreate the Synaptics (TouchPad) COM interface* (if S+ has not been disabled, of course).
* - Synaptics (TouchPad) COM interface is only destroyed/reinitialized when option 'Disable Integration' is not checked.
Disable New Gesture Message - prevents StrokesPlus from displaying the popup message when you click New to create a new gesture.
Reset Cancel Delay On Movement/Modifier - If unchecked, tells StrokesPlus to cancel gestures when the Cancel Delay is reached, regardless of mouse or keyboard activity.
Keep Gesture Draw Window On Top - always keep the transparent window to which StrokesPlus draws the gesture line on top. This can be helpful for low-power systems and prevent flickering UI elements for Windows XP users. However, there may be issues with other programs if they react to StrokesPlus' gesture window being above them. Therefore, this is an experimental feature.
Don't Hide Gesture Draw Window - when you're not drawing a gesture, the draw window is normally sent behind all other windows to increase performance and eliminate flickering and mouse lag when starting a new gesture. Uncheck this option to instruct StrokesPlus to hide the window completely. (This setting has no effect if Keep Gesture Draw Window On Top is checked.
Enable Mouse Wheel Relay - StrokesPlus will relay all mouse wheel scroll events directly to the control below the mouse cursor regardless of state. This lets you scroll controls, lists, windows which aren't active or selected by only scrolling the mouse wheel over top of them.
Fire Recognition on Mouse Wheel Scroll - StrokesPlus will attempt to recognize and fire actions when the mouse wheel is scrolled up or down (only when the Stroke button is being held down). This allows you to have actions which fire for each tick, this is helpful for volume actions, switching tabs, etc.
Allow Mouse Wheel Tick Script* - Enables the mouse wheel tick script described here.
Allow Horizontal Mouse Wheel Tick Script* - Enables the horizontal mouse wheel tick script described here.
Only Capture On Defined Applications (no Global Actions) - Global Actions are ignored, Ignored apps are not processed, the mouse/TouchPad are only captured when drawing on a window which is part of a defined application in the Actions tab. This basically puts S+ into white list mode.
Capture Modifiers on Stroke Button Down* - In addition to capturing modifiers when they occur after the Stroke button is pressed, StrokesPlus will also get their state at the moment the Stroke button is pressed. So if you had the Control key held prior to pressing the Stroke button pressed (and held down at the time), the Control modifier would be recognized as part of the action definition.
Allow After Action Script* - Enables the After Action script described here. To address script error issues for some folks, I separated the processing for the After Action functionality. So if you don't use it, leaving this unchecked will be slightly more efficient.
Allow After Release Script* - Enables the After Release script described here. Lets you define a function in Global Lua which is called whenever the stroke button is released.
Allow Middle Click Script* - Enables the Middle Click script described here.
Allow X1 Click Script* - Enables the X1 Click script described here.
Allow X2 Click Script* - Enables the X2 Click script described here.
Check Cursor Flags* - Determines if S+ will check the cursor flags and decide whether to capture the mouse or not. If you have a program that's doing funky stuff with the mouse cursor and S+ won't capture gestures, try unchecking this option.
Relay Gesture on No Match* - Replays the gesture sequence if there was no match in apps or Global Actions. Actions using odifiers or mouse wheel fire gestures are excluded from this feature.
Play Sound for No Match - Plays a sound if the gesture doesn't exist or doesn't match a defined action
Sound (file) - The WAV file to play when no match. If empty, the sound defined for Question within Windows is played.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment