Important! This is an automatic machine translated page. If you can read english, you should Click Here to read the original English version of the article.

Keyboard Ninja: Assign a Hotkey to any Window Keyboard Ninja: Piešķirt Hotkey uz jebkuru Window

When I need to perform a repetitive task such as checking my email or switching to an open IM window, the quickest option is to assign a hotkey directly to the window, so I can toggle the window minimized/restored with nothing more than a single keystroke. Kad man ir nepieciešams, lai veiktu atkārtotu uzdevumu, piemēram, pārbaudīt savu e-pastu vai pārejot uz atvērtu tērzēšanas logu, ātrākais risinājums ir piešķirt tieši Hotkey uz loga, lai es varētu pārslēgšanas logu minimizēt / atjaunots ar neko vairāk kā vienu taustiņu .

How did I accomplish this? Kā es paveikt? AutoHotkey AutoHotkey , a small scripting framework that allows you to automate anything in Windows. , Nelielu skriptu sistēmu, kas ļauj automatizēt neko Windows. Before we begin, I'm going to assume that you've downloaded and installed it. Pirms mēs sāksim, es esmu gatavojas pieņemt, ka esat lejupielādēt un uzstādīt to.

I've created a small function that you can add to a script which will do the hard work of finding and toggling the window. Esmu izveidojis mazu funkciju, ko varat pievienot skriptu, kas to smago darbu, secinājumu un ieslēdzot logu. All you have to do is assign the hotkeys you want at the top of the script. Viss, kas Jums jādara, ir piešķirt hotkeys vēlaties augšpusē skriptu. Keyboard Ninja

The first thing you will need to do is Pirmā lieta, kas jums būs jādara, ir download the script download script and save it somewhere useful. un saglabājiet to kaut kur noderīgs. You should be able to simply double-click on the script to start it, and then you will notice a new tray icon (The green one with the H) Jūs varat vienkārši dubultklikšķi uz skripta sākumā, un pēc tam jūs paziņojums jaunu ikonu (zaļa viens ar H)

image

Right-click on the icon, and choose Edit This Script from the menu. Ar peles labo pogu noklikšķiniet uz ikonas un izvēlieties Rediģēt šo skriptu no izvēlnes. You'll have to add in your own hotkeys since none are defined in the script, so let's go take a look at the script… Jums nāksies pievienot savu hotkeys, jo tie nav definēti skriptu, lai let's go ņemt apskatīt skriptu ...

; —————————————————————– ; ----------------------
; Declare Your hotkeys in this section ; Atzīt Jūsu hotkeys šajā sadaļā
; —————————————————————– ; ----------------------
;  —- these are samples —- - Tie ir paraugos --
;  !j::ToggleWindow(”- Mozilla Firefox”) – Win + J ;! J: ToggleWindow ( "- Mozilla Firefox") - Win + J
;  #c::ToggleWindow(”SecureCRT”)         – Win + C ; # C:: ToggleWindow ( "SecureCRT") - Win + C
;  !x::ToggleWindow(”cmd.exe”)           – Alt + X ;! X: ToggleWindow ( "cmd.exe") - Alt + X

; —————————————————————– ; ----------------------
; Function for toggling windows - Do not edit ; Funkciju ieslēdzot logi - Nerediģējiet
; —————————————————————– ; ----------------------
ToggleWindow(TheWindowTitle) ToggleWindow (TheWindowTitle)
{ (
SetTitleMatchMode,2 SetTitleMatchMode, 2
DetectHiddenWindows, Off DetectHiddenWindows, Off
IfWinActive, %TheWindowTitle% IfWinActive,% TheWindowTitle%
{ (
WinMinimize, %TheWindowTitle% WinMinimize,% TheWindowTitle%
} )
Else Citādi
{ (
IfWinExist, %TheWindowTitle% IfWinExist,% TheWindowTitle%
WinActivate WinActivate
Else Citādi
{ (
DetectHiddenWindows, On DetectHiddenWindows, On
IfWinExist, %TheWindowTitle% IfWinExist,% TheWindowTitle%
{ (
WinShow WinShow
WinActivate WinActivate
} )
} )
} )
} )

It might be a little complicated for some of you, but the only thing we need to do is add in some hotkey lines. Tas varētu būt nedaudz sarežģītāka, daži no jums, bet tikai lieta, kas mums jādara, ir pievienot dažus Hotkey līniju. You'll notice that there are a number of sample hotkey lines defined already, but commented out. Jūs pamanīsiet, ka ir vairākas izlases Hotkey līnijās, kas definētas jau, bet komentēja out.

Hotkeys are defined in this format: Hotkeys noteiktas šajā formātā:

<keys>::ToggleWindow(”Partial Window Title String”) <keys>:: ToggleWindow ( "Daļēja Window Title String")

For special keys, you'll use one of the following, which can be combined. Īpašu atslēgu, jums izmantot vienu no šiem, ko var apvienot. (get more information at (saņemtu vairāk informācijas Autohotkey Autohotkey documentation) dokumentācija)

# # Windows key Windows taustiņu
! ! Alt Alt
^ ^ Control Control
+ + Shift Maiņa
< < Use Left key (for instance <! means left Alt key only) Izmantojiet kreiso taustiņu (piemēram, <! Ir kreisā Alt taustiņu only)
> > Use Right key (for instance >! means right Alt key only) Izmantojiet labo taustiņu (piemēram,>! Ir tiesības Alt taustiņu only)

So for instance, if you wanted to trigger the keyboard shortcut of Ctrl+Alt+F and assign it to Firefox, you would use the following: Tā, piemēram, ja jūs vēlaties, lai iedarbinātu tastatūras īsinājumtaustiņu no Ctrl + Alt + F un piešķirt to Firefox, jūs varētu izmantot šo:

^!f::ToggleWindow(”- Mozilla Firefox”) ^! f: ToggleWindow ( "- Mozilla Firefox")

Personally, I try to use keyboard shortcuts that don't require me to lift my hands off the keys. Personīgi es cenšos izmantot tastatūras īsceļus, kas neprasa, lai es paceļu rokas pie taustiņiem. I simply use Alt+J assigned to Firefox because I can hit that combination without moving my hands at all. Es vienkārši izmantojiet Alt + J piešķir uz Firefox, jo es varu hit, ka kombinācija nepārvietojot manas rokas vispār.

When you are done editing the script, just save it and then go up to the H icon again, and choose the “Reload This Script” option, which will load all of your changes. Kad tas ir paveikts montāžas skriptu, vienkārši saglabājiet to un tad aiziet līdz H ikonu vēlreiz, un izvēlieties "Pārlādēt šo skriptu" variantu, kas tiks ielādēta visas veiktās izmaiņas. If there was a problem, you'll get an error message, and you can always use Exit to stop the script entirely. Ja tur bija problēmas, jūs saņemsiet kļūdas paziņojumu, un jūs vienmēr varat izmantot Iziet, lai apturētu skriptu pilnīgi.

image

You'll have to decide which key combinations work best for you. Jums ir jāizlemj, kura taustiņu kombināciju vislabāk jums. My advice is to add one or two at a time, and get used to using them. Mans padoms ir pievienot vienu vai divus vienlaicīgi laikā un pierastu pie tos izmantot. Within a few days you'll wonder how you ever lived without them. Laikā dažām dienām jūs zināt kā jūs kādreiz dzīvoja bez tām. You should also read up on AutoHotkey as well… it can do much more than just this. Jums jāizlasa arī līdzi AutoHotkey arī ... to var darīt daudz vairāk nekā tikai to.

Note: The function ToggleWindowHide function in the script is for the more adventurous – it will toggle the window between hidden and restored… extremely useful for command prompt windows. Piezīme: ToggleWindowHide funkcija funkcija skripts ir daudz piedzīvojumu - tas pārslēgtos logu starp ēnu un atjaunota ... ļoti noderīgi komandu uzvednes logu. Essentially gives me Tilda or YaKuake on Windows. Galvenokārt dod man Tilda vai YaKuake uz Windows.

Download geek_autohotkey.ahk (Autohotkey script) Download geek_autohotkey.ahk (Autohotkey script)

This article was originally written on 06/29/07 Tagged with: Šis pants tika sākotnēji rakstīts uz 06/29/07 tagged with: Keyboard Ninja Keyboard Ninja

Daily Email Updates Daily Email Updates

You can get our how-to articles in your inbox each day for free. Jūs varat saņemt mūsu how-to rakstus savā pastkastītē katru dienu par brīvu. Just enter your name and email below: Vienkārši ievadiet jūsu vārdu un e-pasta zemāk:


Name: Vārds:
Email: E-pasts:

Comments (2) Komentāri (2)

  1. FredPT FredPT

    Thanks for this, its an awesome utility! Paldies par šo, tā awesome lietderību!

    If you don't mind I'll write some of my scripts: Ja jums nav prātā, es uzrakstīšu dažas manas skriptu:

    #IfWinActive ahk_class CabinetWClass # IfWinActive ahk_class CabinetWClass
    MButton::Send {backspace} MButton: Sūtīt (atpakaļatkāpe)

    This one checks if the active window is an explorer window and assigns middle click to have the same function as backspace, going to the parent folder, pretty useful for all-mouse browsing. Šis viena pārbauda, vai aktīvā loga Explorer logu un piešķir vidū noklikšķiniet, lai ir tāda pati funkcija kā atpakaļatkāpe, apmeklēt mātes mape, diezgan noderīgi visu peles pārlūkošanai.

    I also have some programing functions (for PHP and Flash), for example: Man arī ir dažas programing funkciju (PHP un Flash), piemēram:

    ::_if:: :: _if::
    Send if () {{}{}}{Left 4} Uzrakstīt ja () {{}{}}{ Left 4)
    return atpakaļ

    If I type “_if” the program will replace that by “if () {}” and will place the typing cursor between the “()” (moving the cursor 4 times to the left) , allowing me to continue coding right away. If I type "_if" programma aizstāt ar "if () ()" un tā vietā ierakstot kursoru starpā "()" (pārvietojot kursoru 4 reizes pa kreisi), kas ļauj man turpināt kodēšanas uzreiz. I also use this for my mail (using Es arī izmantot šo par manu pastu (izmantojot _@). _ @).

    Again, thank you for showing me this little beauty Vēlreiz, paldies, ka rāda man mazliet skaistuma :)

  2. Lee Lee

    The first sample in the screenshot ( ! j ) …. Pirmo paraugu screenshot (! J) .... that should be Alt + J kas būtu Alt + J


Our Friends Our Friends
Getting Started Getting Started


About How-To Geek Par How-To Geek
What Is That Process? Kas ir šis process?
svchost.exe svchost.exe
jusched.exe jusched.exe
dwm.exe dwm.exe
ctfmon.exe ctfmon.exe
wmpnetwk.exe wmpnetwk.exe
wmpnscfg.exe wmpnscfg.exe
rundll32.exe rundll32.exe
wfcrun32.exe wfcrun32.exe
Ipoint.exe Ipoint.exe
Itype.exe Itype.exe
Wfica32.exe Wfica32.exe
Mobsync.exe Mobsync.exe
conhost.exe conhost.exe
Dpupdchk.exe Dpupdchk.exe Adobe_Updater.exe Adobe_Updater.exe

Copyright © 2006-2009 HowToGeek.com. Copyright © 2006-2009 HowToGeek.com. All Rights Reserved. All Rights Reserved.