kana Posted August 8, 2010 Posted August 8, 2010 If a Insert or Delete is pressed, how do I make it send a certain set of keys in an order.
jaberwacky Posted August 8, 2010 Posted August 8, 2010 If a Insert or Delete is pressed, how do I make it send a certain set of keys in an order.Have a look at hotkeyset() and send() in the helpfile. Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum?
somdcomputerguy Posted August 8, 2010 Posted August 8, 2010 These functions, HotKeySet, or, _IsPressed and Send, will probably help you accomplish what you're trying to do.. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
kana Posted August 8, 2010 Author Posted August 8, 2010 If I'm making AutoIt to press a key, does it use the keyboard or can I do something else during those inputs?
somdcomputerguy Posted August 8, 2010 Posted August 8, 2010 Use ControlSend to Send in the 'background' - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
kana Posted August 8, 2010 Author Posted August 8, 2010 Is there anything wrong with this? HotkeySet("{N}","_func1") Func _func1() Send ("G") Sleep(10) Send("{TAB}") Sleep(10) Send ("G") Sleep(10) Send("{TAB}") Sleep(10) Send ("G") Sleep(10) Send("{TAB}") Sleep(10) Send ("G") Sleep(10) Send("{TAB}") Sleep(10) Send ("G") Sleep(10) Send("{TAB}") Sleep(10) Send ("G") Sleep(10) Send("{TAB}") Sleep(10) Send ("G") Sleep(10) Send("{TAB}") Sleep(10) EndFunc
Moderators Melba23 Posted August 8, 2010 Moderators Posted August 8, 2010 kana, Is there anything wrong with this?Yes. - 1. Look again at the syntax for HotKeySet. You only need the { } around the special keys - normal keys do not require them. - 2. You need something to keep the script active - at the moment you exit immediately. Try adding a While..WEnd loop and exit HotKey like this: HotKeySet("n", "_func1") ; See the difference? HotKeySet("{ESC}", "On_Exit") While 1 Sleep(10) ; You need this to prevent CPU overload WEnd Func On_Exit() Exit EndFunc Func _func1() ; code EndFunc All clear? 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
kana Posted August 8, 2010 Author Posted August 8, 2010 Is it case sensitive? I had // While 1 WEnd at the bottom from the earlier post //Edited one below but it doesn't work outside of Windows except for chats HotKeySet("G", "_func1") HotKeySet("{ESC}", "On_Exit") While 1 Sleep(10) WEnd Func On_Exit() Exit EndFunc Func _func1() Send ("G") Sleep(100) Send("{TAB}") Sleep(100) Send ("G") Sleep(100) Send("{TAB}") Sleep(100) Send ("G") Sleep(100) Send("{TAB}") Sleep(100) Send ("G") Sleep(100) Send("{TAB}") Sleep(100) Send ("G") Sleep(100) Send("{TAB}") Sleep(100) Send ("G") Sleep(100) Send("{TAB}") Sleep(100) Send ("G") Sleep(100) Send("{TAB}") Sleep(100) EndFunc
kana Posted August 8, 2010 Author Posted August 8, 2010 Never mind, I had to change the compatibility to Windows XP SP3... doesn't work with Windows 7 or something
kana Posted August 8, 2010 Author Posted August 8, 2010 For the left mouseclick, do I need the X/Y coordinates? Is there a command for just clicking the left mouse key?
Moderators Melba23 Posted August 8, 2010 Moderators Posted August 8, 2010 kana,Dog eaten your Help file? "MouseClick - Perform a mouse click operation.MouseClick ( "button" [, x, y [, clicks [, speed ]]] )Parametersbutton The button to clickx, y [optional] <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<clicks [optional] speed [optional] "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
kana Posted August 8, 2010 Author Posted August 8, 2010 (edited) Does the keyboard speed matter? It doesn't always do everything in the list. // expandcollapse popupHotKeySet("{INS}", "_func1") HotKeySet("{ESC}", "On_Exit") HotKeySet("{DEL}", "_func2") HotKeySet("{HOME}", "_func3") While 1 Sleep(10) WEnd Func On_Exit() Exit EndFunc Func _func1() Send("3") Sleep(10) Send("G") Sleep(10) Send("{TAB}") Sleep(10) Send("G") Sleep(10) Send("{TAB}") Sleep(10) Send("G") Sleep(10) Send("{TAB}") Sleep(10) Send("G") Sleep(10) Send("{TAB}") Sleep(10) Send("G") Sleep(10) Send("{TAB}") Sleep(10) Send("G") Sleep(10) Send("{TAB}") Sleep(10) Send("G") Sleep(10) Send("{TAB}") Sleep(10) Send("G") Sleep(10) Send("{TAB}") Sleep(10) Send("G") Sleep(10) Send("{TAB}") Sleep(10) Send("G") Sleep(10) Send("{TAB}") Sleep(10) Send("G") Sleep(10) Send("{TAB}") Sleep(10) Send("G") Sleep(10) Send("{TAB}") Sleep(10) Send("G") EndFunc Func _func2() Send(2) Sleep(10) Send("W") Sleep(10) Mouseclick("left") Sleep(10) Send("{TAB}") Sleep(10) Send("W") Sleep(10) Mouseclick("left") Sleep(10) Send("{TAB}") Sleep(10) Send("W") Sleep(10) Mouseclick("left") Sleep(10) Send("{TAB}") Sleep(10) Send("W") Sleep(10) Mouseclick("left") Sleep(10) Send("{TAB}") Sleep(10) Send("W") Sleep(10) Mouseclick("left") Sleep(10) Send("{TAB}") Sleep(10) Send("W") Sleep(10) Mouseclick("left") Sleep(10) Send("{TAB}") Sleep(10) Send("W") Sleep(10) Mouseclick("left") Sleep(10) Send("{TAB}") Sleep(10) Send("W") Sleep(10) Mouseclick("left") Sleep(10) Send("{TAB}") Sleep(10) Send("W") Sleep(10) Mouseclick("left") Sleep(10) Send("{TAB}") Sleep(10) Send("W") Sleep(10) Mouseclick("left") Sleep(10) Send("{TAB}") Sleep(10) Send("W") Sleep(10) Mouseclick("left") EndFunc Func _func3() Send("{DEL}") Sleep(360) Send("{INS}") EndFunc Edited August 8, 2010 by Jos added Code tags
Moderators Melba23 Posted August 8, 2010 Moderators Posted August 8, 2010 kana,Try increasing the Sleep time a bit.M23P.S. When you post code please use Code tags. Put [autoit ] before and [/autoit ] after your posted code (but omit the trailing space - it is only there so the tags display here). Or press the blue button just under the BOLD toolbar button. And if you could edit your previous posts to use code tags to make the thread shorter that would be really kind of you! 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
Moderators Melba23 Posted August 8, 2010 Moderators Posted August 8, 2010 kana, I have no idea as I imagine it depends on the particular system. Have you tried? M23 P.S. And are you going to edit your previous posts with code tags to shorten them? 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
somdcomputerguy Posted August 8, 2010 Posted August 8, 2010 @kana - have you read any of the help file? The arguments for the Sleep function are milliseconds. So 1000 is equal to one second, 500 would be half a second, 10000 or 10 * 1000 would be ten seconds.. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
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