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 Klaviatūros Ninja: Priskirti Hotkey į bet kurį langą

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. Kai reikia atlikti pasikartojančių užduočių, pavyzdžiui, patikrinti savo elektroninio pašto ar pereiti prie atviro lango MP, greičiausias variantas yra priskirti "karštą" klavišą tiesiai į langą, kad galėčiau Perjungti lango mažinimą / atkurti ne daugiau kaip vieną klaviatūros .

How did I accomplish this? Kaip man pasiekti tai? AutoHotkey AutoHotkey , a small scripting framework that allows you to automate anything in Windows. , Nedidelis scenarijus sistema, kuri leidžia automatizuoti nieko Windows. Before we begin, I'm going to assume that you've downloaded and installed it. Prieš pradedant darbą, I'm going to daryti prielaidą, kad jums parsisiųsti ir įdiegti jį.

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. Aš sukūriau maža funkcija, galite pridėti scenarijų, kuris bus padaryti sunku darbą rasti ir perjungti langą. All you have to do is assign the hotkeys you want at the top of the script. Viskas, ką jums reikia padaryti, tai priskirti klavišus norite prie scenarijaus pradžią. Klaviatūros Ninja

The first thing you will need to do is Pirmas dalykas, kurį turėsite padaryti tai download the script Atsisiųsti scenarijus and save it somewhere useful. ir išsaugokite jį kur nors naudinga. 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) Jums turėtų tiesiog dukart paspauskite ant scenarijų pradėti jį, ir tada jūs pastebėsite naują piktogramą (žalia vienas su H)

vaizdas

Right-click on the icon, and choose Edit This Script from the menu. Dešiniuoju pelės mygtuku spustelėkite piktogramą ir pasirinkite Redaguoti šį scenarijų iš meniu. 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… Jūs turite įdėti į savo klavišus, nes nė apibrėžtos scenarijų, so let's go atsižvelgti ne scenarijus atrodo ...

; —————————————————————– ; ----------------------
; Declare Your hotkeys in this section ; Deklaruoti Hotkeys šiame skyriuje
; —————————————————————– ; ----------------------
;  —- these are samples —- - Šie mėginiai --
;  !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 ; Funkcija už perjungti langus - Neredaguokite
; —————————————————————– ; ----------------------
ToggleWindow(TheWindowTitle) ToggleWindow (TheWindowTitle)
{ (
SetTitleMatchMode,2 SetTitleMatchMode, 2
DetectHiddenWindows, Off DetectHiddenWindows, Off
IfWinActive, %TheWindowTitle% IfWinActive,% TheWindowTitle%
{ (
WinMinimize, %TheWindowTitle% WinMinimize,% TheWindowTitle%
} )
Else Kitas
{ (
IfWinExist, %TheWindowTitle% IfWinExist,% TheWindowTitle%
WinActivate WinActivate
Else Kitas
{ (
DetectHiddenWindows, On DetectHiddenWindows, Apie
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. Jis gali būti šiek tiek komplikuotas, kai kurie iš jūsų, bet vienintelis dalykas, mes turime padaryti, tai įdėti tam Hotkey linijos. You'll notice that there are a number of sample hotkey lines defined already, but commented out. Jūs pastebėsite, kad yra imties Hotkey eilučių jau apibrėžta, tačiau iš komentarų.

Hotkeys are defined in this format: Hotkeys apibrėžti šį formatą:

<keys>::ToggleWindow(”Partial Window Title String”) <keys>: ToggleWindow ( "dalinis Window Title String")

For special keys, you'll use one of the following, which can be combined. Dėl specialių raktų, turite naudoti vieną iš šių veiksmų, kurie gali būti sujungiami. (get more information at (gauti daugiau informacijos Autohotkey Autohotkey documentation) documentation)

# # Windows key Windows Key
! ! Alt Alt
^ ^ Control Kontrolės
+ + Shift Pamaina
< < Use Left key (for instance <! means left Alt key only) Naudokite Liko klavišą (pvz., <! Reiškia Left Alt klavišą tik)
> > Use Right key (for instance >! means right Alt key only) Teisę naudoti klavišą (pvz.,>! Į dešinę Alt klavišą tik)

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: Taigi, pavyzdžiui, jei norite įjungti spartieji klavišai Ctrl + Alt + F ir priskirti jį prie "Firefox", jums bus panaudoti taip:

^!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. Asmeniškai aš stengiuosi naudoti sparčiuosius klaviatūros klavišus, kad nereikia man pakelti savo rankas raktus. I simply use Alt+J assigned to Firefox because I can hit that combination without moving my hands at all. Aš tiesiog naudokite klavišų kombinaciją Alt + J priskiriamos Firefox, nes aš, galite paspausti, kad kartu be juda mano rankos ne visi.

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. Kai baigsite redaguoti scenarijų, tiesiog įrašykite jį ir tada eiti į H piktograma vėl ir pasirinkite "Atnaujinti šį scenarijų" variantą, kuris bus įkelti visus savo keitimus. If there was a problem, you'll get an error message, and you can always use Exit to stop the script entirely. Jei ten buvo problema, jūs gausite pranešimą apie klaidą, ir jūs visada galite naudotis Išėjimas į stabdymo scenarijus visiškai.

vaizdas

You'll have to decide which key combinations work best for you. Jūs turite nuspręsti, kurios klavišų kombinacijos darbas Jums geriausiai tinka. My advice is to add one or two at a time, and get used to using them. Mano patarimas yra pridėti vieną ar du tuo metu, ir priprasti prie juos naudojant. Within a few days you'll wonder how you ever lived without them. Per kelias dienas jums įdomu, kaip jūs kada nors gyveno ir be jų. You should also read up on AutoHotkey as well… it can do much more than just this. Jūs taip pat turėtumėte perskaityti ant AutoHotkey taip pat ... tai gali padaryti daug daugiau nei tik tai.

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. Pastaba: ToggleWindowHide funkcija funkcija scenarijus yra skirtas daugiau drąsus - jis bus perjungti tarp paslėpto ir vėl ... labai naudinga komandų eilutę langai langas. Essentially gives me Tilda or YaKuake on Windows. Esmės suteikia man Tilda arba yakuake Windows.

Download geek_autohotkey.ahk (Autohotkey script) Parsisiųsti geek_autohotkey.ahk (Autohotkey script)

This article was originally written on 06/29/07 Tagged with: Šis straipsnis buvo parašytas ant 06/29/07 Tagged with: Keyboard Ninja Klaviatūros Ninja

Daily Email Updates Dienos paštas Atnaujinimai

You can get our how-to articles in your inbox each day for free. Galite gauti mūsų kaip prie straipsnių į Jūsų pašto dėžutę kasdien nemokamai. Just enter your name and email below: Tiesiog įveskite vardą ir elektroninio pašto adresą žemiau:


Name: Vardas:
Email: Paštas:

Comments (2) Komentarai (2)

  1. FredPT FredPT

    Thanks for this, its an awesome utility! Ačiū už tai, jo naudingumas awesome!

    If you don't mind I'll write some of my scripts: Jei ne tai aš parašyti savo scenarijų:

    #IfWinActive ahk_class CabinetWClass # IfWinActive ahk_class CabinetWClass
    MButton::Send {backspace} MButton:: Siųsti (Backspace)

    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. Tai vienas patikrina, ar aktyvaus lango Explorer ir priskiria viduriniosios Paspauskite, jei norite turėti pačias funkcijas kaip ir Backspace, einu į aukštesnio lygio kataloge, gana naudinga visiems pelės naršymo.

    I also have some programing functions (for PHP and Flash), for example: Aš taip pat turiu kai kurių funkcijų programavimas (PHP, "Flash"), pavyzdžiui:

    ::_if:: : _if:
    Send if () {{}{}}{Left 4} Siųsti if () {{}{}}{ Left 4)
    return atgal

    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" programa bus pakeisti, kad "jeigu () ()" ir vieta rašyti kursorių tarp "()" (perkelti kursorių 4 kartus į kairę), todėl man tęsti kodavimo karto. I also use this for my mail (using Aš taip pat naudoti šį mano laišką (naudojant _@). _ @).

    Again, thank you for showing me this little beauty Dar kartą dėkojame Jums už parodyta man truputį grožį :)

  2. Lee Lee

    The first sample in the screenshot ( ! j ) …. Pirmasis mėginys iš ekrano (! J) .... that should be Alt + J kad turėtų būti Alt + J


Our Friends Mūsų draugai
Getting Started Paruo


About How-To Geek Apie How-To Geek
What Is That Process? Kas yra šis procesas?
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.