Guest Posted March 8, 2013 Share Posted March 8, 2013 Hello. i worte a start of code that When I briefly pressing one of two buttons set, then an first the code check to see if this is long press or short press. If if is long press, then a message appears: MsgBox(0,"","long press",1) If it short press, then a message appears: MsgBox(0,"","short press",1) The problem is that I want to Block the Input of these keys and i don't know how.. when i press of one of them so they send Input.. this is my code: expandcollapse popup#include <Misc.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> HotKeySet("{ESC}", "Terminate") ;Settings $VolumeUpKey = 68 $VolumeDownKey = 62 ;-->EndSettings Local $Sleep = 80 , $ChangeVolume = False , $Case , $timer , $dif , $SendOne = True , $StartTumer = False , $hDLL = DllOpen("user32.dll") While 1 Sleep($Sleep) If _IsPressed($VolumeDownKey, $hDLL) Or _IsPressed($VolumeUpKey, $hDLL) Then If $StartTumer = True Then ;MsgBox(0,"","",1) $timer = TimerInit() $SendOne = True $StartTumer = False EndIf If $ChangeVolume = False Then $ChangeVolume = True If _IsPressed($VolumeUpKey, $hDLL) Then $Case = 1 If _IsPressed($VolumeDownKey, $hDLL) Then $Case = 2 Else If $ChangeVolume = True Then $ChangeVolume = False If $StartTumer = False Then $StartTumer = True EndIf If $ChangeVolume = True Then $dif = TimerDiff($timer) Else ;ToolTip($dif) If $dif > 0 Then If $dif < 800 Then If $SendOne = True Then MsgBox(0,"","short press",1) $SendOne = False EndIf Else MsgBox(0,"","long press",1) EndIf EndIf If $dif > 0 Then $dif = 0 EndIf ;ToolTip($dif) WEnd Link to comment Share on other sites More sharing options...
FireFox Posted March 8, 2013 Share Posted March 8, 2013 The problem is that I want to Block the Input of these keys and i don't know how.. HotKeySet("{NUMPAD8}", "toto") HotKeySet("{NUMPAD2}", "toto") ;your code Func toto() EndFunc Br, FireFox. Link to comment Share on other sites More sharing options...
Guest Posted March 8, 2013 Share Posted March 8, 2013 i don't want to do it with HotKeySet .i want to do it on what i did... Link to comment Share on other sites More sharing options...
FireFox Posted March 8, 2013 Share Posted March 8, 2013 (edited) i don't want to do it with HotKeySet .i want to do it on what i did...This is too vague, because I exactly did what you asked.Edit: Why HotKeySet does not fit your need? Edited March 8, 2013 by FireFox Link to comment Share on other sites More sharing options...
Guest Posted March 8, 2013 Share Posted March 8, 2013 This is too vague, because I exactly did what you asked.Edit: Why HotKeySet does not feet you need?yes i got it and it working..i don't like the way it looks but it is do the job.thanks..if there is better way so i will heppey to know that.i am looking for function to convert for example the 68 to {NUMPAD8} or {NUMPAD8} to 68.. Link to comment Share on other sites More sharing options...
FireFox Posted March 8, 2013 Share Posted March 8, 2013 i am looking for function to convert for example the 68 to {NUMPAD8} or {NUMPAD8} to 68..IIRC, some of us discussed about that in my IsPressed UDF topic, you should find what you need. Link to comment Share on other sites More sharing options...
PhoenixXL Posted March 8, 2013 Share Posted March 8, 2013 UDF My code: PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners. MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression. 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