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:
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:
[ autoit ]
#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