DonationCoder.com Software > Post New Requests Here
IDEA : Start-Quit Program w/Single Key?
MourningStar:
I request help to configure a keyboard key to run and quit a task. For example a desktop clock, calendar, cpu meter, etc (app, gadget, pgm etc,). It should function as follows :
key press-hold = app (e.g. clock) appears (executes a run command?)
key release = app (e.g. clock) disappears (executes a exit/quit command?)
In the clock example, I would like to simply press-hold a key and a custom desktop clock appears (program start) and then disappears (program quit) when I release the key. Defining many tasks in this manner would prevent the need for having multiple tasks running and eating cpu/ram when occasionally 'checking in' super-quickly on something is all that's required.
-thnx
TaoPhoenix:
With a slight modification, something like this can kill an existing service.
AppleMobileDeviceSupport service prevents my comp from rebooting!
So rather than fish for it in Task Manager, some random defined key could kill it.
BigVent:
--- Code: Autohotkey ---#SingleInstance, force ;//change hotkey to your desired keyNumpad5:: ;//Number Pad 5 hotkey{ while GetKeyState("Numpad5") ;//while Number Pad 5 key is held { Traytip, Key Is Held, Your hotkey is being held., ,1 IfWinExist, Date and Time Properties ;//Windows clock & date Continue IfWinNotExist, Date and Time Properties run, Timedate.cpl } Traytip WinClose, Date and Time Properties ;//upon release close the window}Return ESC & Numpad5:: ;//esc & Number Pad 5 will exit the script Critical ExitAppReturn
MourningStar:
^
thank you BigVent - I tied your script, unfortunately the date-time window does not close upon key release.
BigVent:
Perhaps I should've clarified that this was an example that can be modified to suit your needs & I only tested it on my XP box, sorry about that.
Anyway, I've made an adjustment to the window & it should work as desired. (e.g. "Date and Time Properties" on XP & "Date and Time" on > Vista)
Tested on Win XP, Vista, & 7
Enjoy!
--- Code: Autohotkey ---#SingleInstance, force SetTitleMatchMode, 2 ;//change hotkey to your desired key Numpad5:: ;//Number Pad 5 hotkey { while GetKeyState("Numpad5") ;//while Number Pad 5 key is held { Traytip, Key Is Held, Your hotkey is being held., ,1 IfWinExist, Date and Time ;//Windows clock & date Continue IfWinNotExist, Date and Time run, Timedate.cpl } sleep, 3000 ;//small delay Traytip WinClose, Date and Time ;//upon release close the window } Return ESC & Numpad5:: ;//esc & Number Pad 5 will exit the script Critical ExitApp Return
Navigation
[0] Message Index
[#] Next page
Go to full version