sandin Posted August 24, 2007 Share Posted August 24, 2007 when I hold NUMPAD1 the script calls func over and over again rapidedly, is there a way for me to change this? for example if I hold down NUMPAD1 it cals func only 1 time and then if I press NUMPAD1 it calls the same func again (but only once as well)? here's the script: HotKeySet("{NUMPAD1}", "func1") HotKeySet("{NUMPAD0}", "_exit") Global $iCC Func func1() $iCC += 1 ToolTip('You have called func1 ' & $iCC & ' times.', 0, 0) Sleep(10) EndFunc func _exit() Exit EndFunc while 1 sleep(1) WEnd Some cool glass and image menu | WinLIRC remote controler | Happy Holidays to all... | Bounce the sun, a game in which you must save the sun from falling by bouncing it back into the sky | Hook Leadtek WinFast TV Card Remote Control Msges | GDI+ sliding toolbar | MIDI Keyboard (early alpha stage, with lots of bugs to fix) | Alt+Tab replacement | CPU Benchmark with pretty GUI | Ini Editor - Edit/Create your ini files with great ease | Window Manager (take total control of your windows) Pretty GUI! | Pop-Up window from a button | Box slider for toolbar | Display sound volume on desktop | Switch hotkeys with mouse scroll Link to comment Share on other sites More sharing options...
martin Posted August 24, 2007 Share Posted August 24, 2007 when I hold NUMPAD1 the script calls func over and over again rapidedly, is there a way for me to change this? for example if I hold down NUMPAD1 it cals func only 1 time and then if I press NUMPAD1 it calls the same func again (but only once as well)? here's the script: HotKeySet("{NUMPAD1}", "func1") HotKeySet("{NUMPAD0}", "_exit") Global $iCC Func func1() $iCC += 1 ToolTip('You have called func1 ' & $iCC & ' times.', 0, 0) Sleep(10) EndFunc func _exit() Exit EndFunc while 1 sleep(1) WEnd #include <misc.au3> $H1reset = False $H2reset = false HotKeySet("{NUMPAD1}", "func1") HotKeySet("{NUMPAD0}", "_exit") Global $iCC Func func1() HotKeySet("{NUMPAD1}") $H1reset = true $iCC += 1 ToolTip('You have called func1 ' & $iCC & ' times.', 0, 0) Sleep(10) EndFunc func _exit() Exit EndFunc while 1 if $H1reset and not _Ispressed("61") Then HotKeySet("{NUMPAD1}", "func1") $H1reset = false EndIf Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
Paulie Posted August 24, 2007 Share Posted August 24, 2007 Along the same Lines as Martin #Include <Misc.au3> HotKeySet("{NUMPAD1}", "func1") HotKeySet("{NUMPAD0}", "_exit") Global $iCC while 1 sleep(100) WEnd Func func1() $iCC += 1 ToolTip('You have called func1 ' & $iCC & ' times.', 0, 0) If _IsPressed(61) Then Do Sleep(100) Until NOT _IsPressed(61) EndIf EndFunc func _exit() Exit EndFunc Link to comment Share on other sites More sharing options...
martin Posted August 25, 2007 Share Posted August 25, 2007 Along the same Lines as Martin #Include <Misc.au3> HotKeySet("{NUMPAD1}", "func1") HotKeySet("{NUMPAD0}", "_exit") Global $iCC while 1 sleep(100) WEnd Func func1() $iCC += 1 ToolTip('You have called func1 ' & $iCC & ' times.', 0, 0) If _IsPressed(61) Then Do Sleep(100) Until NOT _IsPressed(61) EndIf EndFunc func _exit() Exit EndFunc That doesn't work Paulie, you need to stop the HotKey from working before you wait for the key to be released. Func func1() HotKeySet("{NUMPAD1}") $iCC += 1 ToolTip('You have called func1 ' & $iCC & ' times.', 0, 0) while _IsPressed(61) Sleep(100) wend HotKeySet("{NUMPAD1}", "func1") EndFunc Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
Paulie Posted August 25, 2007 Share Posted August 25, 2007 You are right, missed that. #Include <Misc.au3> HotKeySet("{NUMPAD1}", "func1") HotKeySet("{NUMPAD0}", "_exit") Global $iCC=0 while 1 sleep(100) WEnd Func func1() $iCC += 1 ToolTip('You have called func1 ' & $iCC & ' times.', 0, 0) If _IsPressed(61) Then HotKeySet(@HotKeyPressed) Do Sleep(100) Until NOT _IsPressed(61) HotKeySet(@HotKeyPressed,"Func1") EndIf EndFunc func _exit() Exit EndFunc Link to comment Share on other sites More sharing options...
sandin Posted August 25, 2007 Author Share Posted August 25, 2007 thank you all for all your help, it works. Some cool glass and image menu | WinLIRC remote controler | Happy Holidays to all... | Bounce the sun, a game in which you must save the sun from falling by bouncing it back into the sky | Hook Leadtek WinFast TV Card Remote Control Msges | GDI+ sliding toolbar | MIDI Keyboard (early alpha stage, with lots of bugs to fix) | Alt+Tab replacement | CPU Benchmark with pretty GUI | Ini Editor - Edit/Create your ini files with great ease | Window Manager (take total control of your windows) Pretty GUI! | Pop-Up window from a button | Box slider for toolbar | Display sound volume on desktop | Switch hotkeys with mouse scroll 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