zxtnt09 Posted March 26, 2016 Share Posted March 26, 2016 Hi guys I can not know that how can i use this : ;if _ispress("31") and (after _ispress("31") pressed then typing "Hello i am here") and ;if _ispress("31") "again" , then typing "i am not here" ;endif ;============================================ It's meaning , For "first" time if click on "Number 1 Button On Keyboard" , do something... ,and For "second" time if click on "Number 1 Button On Keyboard", do something else. thanks. Link to comment Share on other sites More sharing options...
AutoBert Posted March 26, 2016 Share Posted March 26, 2016 HotkeySet is what you are searching. The example in helpfile shows how to toggle a boolean variable. If ... Then ... Else ... EndIf is also needed. zxtnt09 1 Link to comment Share on other sites More sharing options...
iamtheky Posted March 26, 2016 Share Posted March 26, 2016 #include <Misc.au3> $i = "" while 1 If _IsPressed("31") Then ConsoleWrite("I am" & $i & " Here" & @LF) $i = $i = "" ? " Not" : "" sleep(500) EndIf sleep(50) WEnd That's not a terrible first post, thanks for the pseudo code. When you use a new UDF like you may be now with Misc, i suggest hitting alt-i on the include line and browsing it. Lots of fun things inside. zxtnt09 1 ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__) Link to comment Share on other sites More sharing options...
zxtnt09 Posted March 26, 2016 Author Share Posted March 26, 2016 Thanks but my question is like this : 1 ) Click on "enter" or "1" 2 ) Type something ( example hello ,etc ) in every where ( ex : notepad , inputbox ,etc ) 3 ) Click again on "1" 4 ) MsgBox that typed ( example : hello ) it's like chat but contrariwise its meant ( 2 time click on "enter" and type some thing ) .. Thanks alot. Link to comment Share on other sites More sharing options...
Alex1986 Posted March 26, 2016 Share Posted March 26, 2016 Try this : #include <Misc.au3> HotKeySet("{ESC}" , "_Exit") while 1 If _IsPressed("31") Then MSgBox(0,0,"Msg 1") sleep(100) Do $statKey = _IsPressed("31") Until $statKey = 1 MSgBox(0,0,"Msg 2") EndIf WEnd Func _Exit() Exit EndFunc zxtnt09 1 Link to comment Share on other sites More sharing options...
zxtnt09 Posted March 26, 2016 Author Share Posted March 26, 2016 @Alex1986 Thanks it's true, Now how can i detect wich keys are pressed ? This time we have : 1 ) Press on "1" 2* ) Type something , like "Hello" 3 ) Press again on "1" 4 ) MsgBox "Hello" All steps is true but we missed step (2), Thanks. Link to comment Share on other sites More sharing options...
Alex1986 Posted March 26, 2016 Share Posted March 26, 2016 #include <Misc.au3> HotKeySet("{ESC}" , "_Exit") while 1 If _IsPressed("31") Then $text = InputBox("InputBox" , "Type something : " , "") sleep(100) Do $statKey = _IsPressed("31") Until $statKey = 1 MSgBox(0,0,$text) EndIf WEnd Func _Exit() Exit EndFunc zxtnt09 1 Link to comment Share on other sites More sharing options...
zxtnt09 Posted March 26, 2016 Author Share Posted March 26, 2016 @Alex1986 It's true , but i don't like to use with "inputbox" i need to use that in everywhere, for example in : notepad,notepad++,phpstorm,etc. Link to comment Share on other sites More sharing options...
zxtnt09 Posted March 26, 2016 Author Share Posted March 26, 2016 I use this : #include <String.au3> #include <Misc.au3> While 1 _Ex() WEnd Func _Ex() For $iX = 1 To 254 If _IsPressed(Hex($iX)) Then $B = _HexToString(Hex($iX,2)) If _IsPressed("0D") Then Sleep(100) Do $statKey = _IsPressed("0D") Until $statKey = 1 MsgBox(0,0,$B) EndIf EndIf Next EndFunc but when i press "enter" and type "hello" after press "enter" no result found Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 26, 2016 Moderators Share Posted March 26, 2016 panda_k3, You were straying into keylogger territory with that last post - please read this announcement to see what is and what is not permitted here. M23 zxtnt09 1 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...
zxtnt09 Posted March 26, 2016 Author Share Posted March 26, 2016 1 minute ago, Melba23 said: panda_k3, You were straying into keylogger territory with that last post - please read this announcement to see what is and what is not permitted here. M23 Hi melba i don't want to create keylogger , i want to send key to website and get result, i copy this code from other guys, i'm zxtnt09 i forgot my password and i can not reset my password.. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 26, 2016 Moderators Share Posted March 26, 2016 panda_k3, I know you do not want to create a keylogger - or this thread would already be closed - but you are straying into keylogger territory by looking for too many keys, as explained in the announcement to which I linked. If you have forgotten your password, PM me with the email address you used for the zxtnt09 account and I will reset it for you (and merge the 2 accounts). 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...
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