lml Posted August 11, 2012 Share Posted August 11, 2012 I can't figure out how to do this for the life of me. How do you press and hold a key down? I see a MouseDown command, but no KeyDown command. I see a SendKeyDelay.. But that wouldn't let me hold down shift, then press a, then release shift? Example: Start() Func Start() Sleep(100) KeyDown( "{SHIFT}") Sleep(100) Send(A) Sleep(100) KeyUp( "{SHIFT"}) EndFunc Link to comment Share on other sites More sharing options...
Belini Posted August 12, 2012 Share Posted August 12, 2012 (edited) See if this is what you want: Send("{LSHIFT DOWN}"); Press Down Sleep(500); holding down Send("{LSHIFT UP}"); releases the key Edited August 12, 2012 by Belini lml 1 My Codes: Virtual Key Code UDF: http://www.autoitscript.com/forum/topic/138246-virtual-key-code-udf/ GuiSplashTextOn.au3: http://www.autoitscript.com/forum/topic/143542-guisplashtexton-udf/ Menu versions of Autoit: http://www.autoitscript.com/forum/topic/137435-menu-versions-of-autoit/#entry962011 Selects first folder of letters: ]http://www.autoitscript.com/forum/topic/144780-select-folders-by-letter/#entry1021708/spoiler] List files and folders with long addresses.: http://www.autoitscript.com/forum/topic/144910-list-files-and-folders-with-long-addresses/#entry102 2926 Program JUKEBOX made in Autoit:some functions:http://www.youtube.com/watch?v=WJ2tC2fD5Qs Navigation to search:http://www.youtube.com/watch?v=lblwOFIbgtQ Link to comment Share on other sites More sharing options...
Earendil Posted August 12, 2012 Share Posted August 12, 2012 See if this is what you want: Send("{LSHIFT DOWN}"); Press Down Sleep(500); holding down Send("{LSHIFT UP}"); releases the key I spotted this post,and as a noobie now starting scripting,i have a question:Based on these 3 lines can i (using sleep command)make a combined keystroke?(like Shift+T or something similar for hotkeys) Thank you in advance, Earendil Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted August 12, 2012 Moderators Share Posted August 12, 2012 Earendil,Welcome to the AutoIt forum. If you look at the Help file entry for HotKeySet, you will see that you can define key combinations directly when you assign the HotKey - the syntax for the various combinations can be found on the Send page of the Help file. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Earendil Posted August 12, 2012 Share Posted August 12, 2012 Earendil,Welcome to the AutoIt forum. If you look at the Help file entry for HotKeySet, you will see that you can define key combinations directly when you assign the HotKey - the syntax for the various combinations can be found on the Send page of the Help file. M23Thank you again,I'll try this immediatelly. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now