eawedat Posted August 31, 2012 Share Posted August 31, 2012 hey all,, having this code : HotKeySet("jjj", "getJJJ") Func getJJJ() Send("bbb") EndFunc How to fix it so when I type three times character jjj , "bbb" will be sent thanks. Link to comment Share on other sites More sharing options...
FireFox Posted August 31, 2012 Share Posted August 31, 2012 Hi, Here you go : Local $iKeyPressCount = 0 HotKeySet("{j}", "_Main") While 1 Sleep(1000) WEnd Func _Main() If $iKeyPressCount = 2 Then $iKeyPressCount = 0 Send("bbb") Else $iKeyPressCount += 1 EndIf EndFunc Br, FireFox. eawedat 1 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted August 31, 2012 Moderators Share Posted August 31, 2012 eawedat,Perhaps:HotKeySet("j", "getJ") Func getJ() Send("b") EndFuncAnd then press the HotKey 3 times? 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...
eawedat Posted August 31, 2012 Author Share Posted August 31, 2012 thank you FireFoxThe main thing I needed is the infinite loop to keep the program alive & runningWhile 1 Sleep(1000) WEndwith that being said ,is there a major difference betweenHotKeySet("{j}", "_Main")andHotKeySet("j", "_Main")?({j} == j) ? Link to comment Share on other sites More sharing options...
FireFox Posted August 31, 2012 Share Posted August 31, 2012 is there a major difference betweenHotKeySet("{j}", "_Main")andHotKeySet("j", "_Main")?({j} == j) ?There is no difference if the second parameter is set to 0, it it's set to 1 then {j} will not be considered as a key but as a raw text, so you will need to tape {, j and } to activate it.In conclusion {} is set for associating keys.Br, FireFox. eawedat 1 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