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 Klávesnice Ninja: Prideĺ každému Window Hotkey

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. Keď som potrebné vykonať opakované úlohy, ako je kontrola môj e-mail alebo prechodu na otvorené okno chatu, najrýchlejší možnosťou je priradiť klávesová skratka priamo k oknu, takže môžem prepínať minimalizované okno / restored s ničím viac ako jeden stlačenie klávesy .

How did I accomplish this? Ako som to dosiahli? AutoHotkey AutoHotkey , a small scripting framework that allows you to automate anything in Windows. , Malá skriptovací rámec, ktorý umožňuje automatizovať niečo v systéme Windows. Before we begin, I'm going to assume that you've downloaded and installed it. Než začneme, budem predpokladať, že ste si stiahli a nainštalovali ho.

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. Vytvoril som malú funkciu, ktorú môžete pridať do skriptu, ktorý bude robiť ťažkú prácu s hľadaním a prepínanie okien. All you have to do is assign the hotkeys you want at the top of the script. Jediné, čo musíte urobiť, je priradiť skratkové klávesy, ktoré chcete v hornej časti skriptu. Klávesnice Ninja

The first thing you will need to do is Prvé, čo musíte urobiť, je download the script stiahnuť skript and save it somewhere useful. a uložte ho niekde užitočné. 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) Mali by ste byť schopní jednoducho double-kliknite na skript ho spustiť, a potom si všimnete novú ikonu (zelené s H)

image

Right-click on the icon, and choose Edit This Script from the menu. Pravým-kliknite na ikonu a vyberte Upraviť Tento skript z menu. 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… Budete musieť pridať na svoje vlastné klávesové skratky sú definované, pretože ani v scenári, tak poďme sa pozrieť na skript ...

; —————————————————————– ; ----------------------
; Declare Your hotkeys in this section ; Určiť Váš skratkové klávesy v tejto sekcii
; —————————————————————– ; ----------------------
;  —- these are samples —- , - Ide o vzorky --
;  !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 ; Funkcia pre prepínanie okien - Needitujte
; —————————————————————– ; ----------------------
ToggleWindow(TheWindowTitle) ToggleWindow (TheWindowTitle)
{ (
SetTitleMatchMode,2 SetTitleMatchMode, 2
DetectHiddenWindows, Off DetectHiddenWindows, Off
IfWinActive, %TheWindowTitle% IfWinActive, TheWindowTitle%%
{ (
WinMinimize, %TheWindowTitle% WinMinimize, TheWindowTitle%%
} )
Else Iné
{ (
IfWinExist, %TheWindowTitle% IfWinExist, TheWindowTitle%%
WinActivate WinActivate
Else Iné
{ (
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. To by mohlo byť trochu zložité pre niektoré z vás, ale jediné, čo musíme urobiť, je pridať do nejakej horúcej klávesy riadkov. You'll notice that there are a number of sample hotkey lines defined already, but commented out. Všimnite si, že existuje niekoľko riadkov vzorky hotkey už definovaných, ale komentár.

Hotkeys are defined in this format: Zkratkové klávesy sú definované v tomto formáte:

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

For special keys, you'll use one of the following, which can be combined. Pre špeciálne kľúče, môžete použiť jeden z nasledujúcich, ktoré možno kombinovať. (get more information at (viac informácií na Autohotkey Autohotkey documentation) dokumentácia)

# # Windows key Klávesa Windows
! ! Alt Alt
^ ^ Control Ovládanie
+ + Shift Smena
< < Use Left key (for instance <! means left Alt key only) Ľavý kľúča (napr. <! Znamená len ľavou kláves Alt)
> > Use Right key (for instance >! means right Alt key only) Použite tlačidlo pravým (napríklad>! Znamená pravej klávesy Alt len)

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: Tak napríklad, ak by ste chceli spustiť klávesovú skratku Ctrl + Alt + F a priradiť ju k Firefoxu, mali by ste použiť nasledovné:

^!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. Osobne sa snažím používať klávesové skratky, ktoré nevyžadujú, aby mi zdvihnúť ruky z klávesnice. I simply use Alt+J assigned to Firefox because I can hit that combination without moving my hands at all. Jednoducho som použiť skratku Alt + J pridelený k Firefoxu, pretože som si, že kombinácia hit, bez toho sa mojej ruky vôbec.

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. Po dokončení úprav skriptu, stačí ju uložiť a potom hore na ikonu H znova a vyberte "Obnoviť Tento skript", ktorá sa načíta všetky vaše zmeny. If there was a problem, you'll get an error message, and you can always use Exit to stop the script entirely. Ak tam bol problém, dostanete chybové hlásenie, a môžete vždy použiť Koniec zastaviť skript úplne.

image

You'll have to decide which key combinations work best for you. Budete sa musieť rozhodnúť, ktoré kombinácie klávesov pracovať pre vás najvýhodnejšie. My advice is to add one or two at a time, and get used to using them. Moja rada je pridať jeden alebo dva naraz, a zvyknúť si na ich používanie. Within a few days you'll wonder how you ever lived without them. Počas niekoľkých dní budete sa diviť, ako ste kedy žili bez nich. You should also read up on AutoHotkey as well… it can do much more than just this. Mali by ste tiež prečítali o AutoHotkey rovnako ... to môžete robiť oveľa viac než len toto.

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. Poznámka: Funkcia ToggleWindowHide funkciu vo skripte je pre odvážnejšie - to bude prepínať okná medzi skrytou a znova ... nesmierne užitočné pre príkazový riadok Windows. Essentially gives me Tilda or YaKuake on Windows. V podstate mi dáva Tilda alebo YaKuake na Windows.

Download geek_autohotkey.ahk (Autohotkey script) Stiahnuť geek_autohotkey.ahk (autohotkey skrípt)

This article was originally written on 06/29/07 Tagged with: Tento článok bol pôvodne napísaný na 06/29/07 Tagged s: Keyboard Ninja Klávesnice Ninja

Daily Email Updates Denný Svářeč

You can get our how-to articles in your inbox each day for free. Môžete si naše jak-na články vo vašej schránky každý deň zadarmo. Just enter your name and email below: Stačí zadať svoje meno a e-mail nižšie:


Name: Meno:
Email: E-mail:

Comments (2) Komentáre (2)

  1. FredPT FredPT

    Thanks for this, its an awesome utility! Vďaka za to, jeho awesome utility!

    If you don't mind I'll write some of my scripts: Ak vám nevadí, že budem písať niektoré moje skripty:

    #IfWinActive ahk_class CabinetWClass # IfWinActive ahk_class CabinetWClass
    MButton::Send {backspace} MButton:: Napíšte 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. Ten kontroluje, či je okno aktívne bádateľ okno a priraďuje stredné kliknite majú rovnakú funkciu ako krok späť, ísť do nadradeného priečinka, docela užitočná pre všetky myš-browsing.

    I also have some programing functions (for PHP and Flash), for example: Mám aj nejaké funkcie, programovanie (PHP a Flash), napríklad:

    ::_if:: :: _if::
    Send if () {{}{}}{Left 4} Send if () {{}{}}{ Left 4)
    return späť

    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" program, ktorý bude nahradený výrazom "if () ()" a umiestni kurzor medzi zadaním "()" (pohybom kurzora 4 krát vľavo), ktorý umožňuje mi pokračovať kódovanie hneď. I also use this for my mail (using Ja tiež používam na môj mail (pomocou _@). _ @).

    Again, thank you for showing me this little beauty Opäť, ďakujem vám za ukazoval mi to trochu krásy :)

  2. Lee Lee

    The first sample in the screenshot ( ! j ) …. Prvá vzorka v snímke (! J) .... that should be Alt + J ktoré by mali byť Alt + J


Leave a Comment Zanechať komentár




Leave your Zanechajte svoj friendly priateľský comment here. komentár tu.

If you have a computer help question, Ak máte počítač pomôže otázku, click here to leave it on the forums kliknite tu nechať to na fórach instead. miesto.

Note: Your comment may not show up immediately on the site. Poznámka: Váš komentár sa nezobrazia okamžite na mieste.

Our Friends Naši priatelia
Getting Started Začíname


About How-To Geek O tom, ako-To Geek
What Is That Process? Čo je to za proces?
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.