Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Hotkeys Help!!


  • Please log in to reply
3 replies to this topic

#1 perobearr

perobearr

  • Members
  • 2 posts
  • OFFLINE
  •  
  • Local time:01:12 AM

Posted 04 May 2014 - 06:45 AM

Hey guys I was wondering whether any of you knew how I can assign a hotkey (or combination or keys) to minimize the active program to the system tray?

 

i have zero knowledge of scripting and hotkeys. 

 

 



BC AdBot (Login to Remove)

 


#2 Scoop8

Scoop8

  • Members
  • 326 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Dallas TX
  • Local time:07:12 PM

Posted 04 May 2014 - 07:07 AM

perobearr

 

23shh55.jpg to the forum.

 

If you're using Windows, it's got a built-in key combination that will minimize all open windows to the Taskbar:

 

<win>d    Hold down the "win" key, while pressing the d key.

 

It's actually a "desktop active" key which minimizes open windows and makes the cursor active on the desktop screen.

 

There's another key combo that will minimize the currently active window which is <win>m .

 

If you're interested in a freeware hotkey program, I use AutoHotkey .   I use it for a lot of hotkey combinations along with some scripts.

 

A couple of examples would be to define a key that will substitute for the "refresh" keys (F5 or <ctrl>r .  I use my right-hand <alt> key as a refresh key.

 

I also use keys for my frequently-visit web sites, such as <win>a for my Amazon home page, or a weather page with <win>w .

 



#3 perobearr

perobearr
  • Topic Starter

  • Members
  • 2 posts
  • OFFLINE
  •  
  • Local time:01:12 AM

Posted 15 May 2014 - 01:11 PM

ok i downloaded the autohotkey, what do i input to minimize the current window to the system tray



#4 Scoop8

Scoop8

  • Members
  • 326 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Dallas TX
  • Local time:07:12 PM

Posted 16 May 2014 - 10:05 AM

Hi,

 

It's been about 3 years since I installed AutoHotKey so my memory may be a little fuzzy here :), but if I recall, when the program is first launched, the default script file will open using Notepad, and then you can begin adding hotkey definitions to the script.

 

If the Notepad script file doesn't open, you can access it by right-clicking on the AutoHotKey icon in the System Tray.  You'll see several choices from the right-clock menu.  One choice is "Edit this script".  Click on that choice and the Notepad script file will open.

 

Once you have the script open for editing, you can define any key to remap the Windows default <win>d key combination.

 

For example, I use my right-hand <win> key to do the same thing as <win>d with this line within the script file:

 

RWin::#d      ; Remap right Win key to #d (Win Desktop active)

 

 

The next one remaps my <win>x key to do the same function as the Windows default <alt>F4 combination, which closes almost anything in Windows.

 

It also opens the Windows "shutdown" dialog (shutdown, sleep, restart, log off user, etc) when one is at the Desktop mode.

 

#x::!f4       ; Remap Win x = alt+f4  

 

I attached my AutoHotKey default script in this post to show some examples on how you can use various hotkey combinations to launch browser sites, run additional scripts, etc.

 

One feature that I like with AutoHotKey is that I can use the Windows default <ctrl>w function that closes many things in Windows, folder windows, IE browser tabs, etc.

 

One example of this would be to close my Outlook program with <ctrl>w :

 

#IfWinActive ahk_class rctrl_renwnd32       ; Outlook (will close with any folder active)
^w::WinClose

 

Another option that I like is the Sound control options that can be mapped.  In this example. I'm remapping the F10,11, & 12 keys for my volume controls when I'm using my IE browser:

 

#IfWinActive ahk_class IEFrame         ; Default IE Browser windows
F10::Send {Volume_Down}
F11::Send {Volume_Up}
F12::Send {Volume_Mute}

 

The basic premise of AutoHotKey is that, for keyboard geeks like me :) who don't use the mouse much on their PC's, you can define nearly any keyboard key or combination to do anything, open frequently-edited excel files, launch the browser to a specific site, or run other scripts.

 

One example of other scripts would be something like what I use to periodically copy a few of my "must-save" frequently-edited files to an external HDD or to my Laptop PC via the Router/LAN connection.

 

I also have a short script that will open a few of the %temp% folders to see if excessive unused files, or other possible "suspicious" named files may be present in those folders.

 

I wrote this last week so that I can access those folders with one script command instead of individually opening them with the "run" dialog.

 

This script will open the folders, then wait until I press a key that I define in the script to continue.  This way, I can explore the folder if I want to take a look at its contents before the script will close that folder window and continue to the next folder.

 

Once the script is complete, it will play one of the Windows default media sound *.wav files to let me know that it's done.

 

Loop, 4
{
if A_Index = 1
dir_name = "%temp%"
if A_Index = 2
dir_name = "%appdata%"
if A_Index = 3
dir_name = "%localappdata%"
if A_Index = 4
dir_name = "C:\Windows\Temp"
Run %dir_name%
WinMaximize
KeyWait, |, D
if A_Index <4
SoundPlay, C:\Windows\Media\Windows Logoff Sound.wav, wait
WinClose, ahk_class CabinetWClass
}
SoundPlay, C:\Windows\Media\Garden\Windows Logoff Sound.wav, wait
Exit

 

One that I use to return my Desktop PC to sleep mode after my daily backup program runs daily at 12pm, is this script.  It's launched by Windows Task Scheduler.  It will chime 4 times in case I happen to be at my PC at the time the task is launched, to let me know that the PC will be put in Sleep mode shortly.  That way, I can kill the process if I need to remain at my PC interactively.

 

Then it plays one of my music tunes, and then "fades out" slowly like a song on the radio.  Then it puts the PC to sleep.

 

SoundSet, 100
Loop, 4
{
SoundPlay, C:\Windows\Media\Afternoon\Windows Notify.wav, wait
}
SoundSet, 60
SoundPlay, C:\Users\Jeff\Documents\Music\WAV FILES\Lonnie Liston Smith - Quiet Moments.wav
Sleep 120000
Loop, 70
{
SoundSet, -1
Sleep 375
}
Sleep 2000
DllCall("PowrProf\SetSuspendState", "int", 0, "int", 0, "int", 0)
Sleep 5000        ; Keeps sound off for 5 sec after wakeup to mute residual wav output
SoundSet, 100
Exit

 

These scripts may give you some ideas on how the AutoHotKey program can be used for a variety of things.

 

 

If you want AutoHotKey to start at Windows login, you can add the shortcut into your "Startup" folder.  With Windows 7, the path is:

 

C:\Users\name\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

 

To create the shortcut, go to the AutoHotKey install folder here:

 

C:\Program Files\AutoHotkey

 

Create a shortcut of the program file (AutoHotkey.exe).  Move that shortcut into your Startup folder.

 

Then, AutoHotKey will launch when you startup Windows.

 

Attached Files






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users