1. 程式人生 > 實用技巧 >鍵盤忍者:使用單個熱鍵彈出Vista日曆

鍵盤忍者:使用單個熱鍵彈出Vista日曆

We’ve covered how to access the Windows Vista Calendar using the keyboard, but what if you wanted to assign a single keystroke to pop up the calendar? Yeah, sure, you can just click it with the mouse, but where’s the geek fun in that?

我們已經介紹瞭如何使用鍵盤訪問Windows Vista日曆,但是如果您想分配一個按鍵來彈出日曆怎麼辦? 是的,當然,您可以用滑鼠單擊它,但是其中的怪胎樂趣在哪裡?

In case you aren’t sure what we’re talking about, you can use Win+B, then Left, then Enter to pop up this calendar with the keyboard (or you can just click once on the clock). But we can get that down to a single keystroke with an AutoHotkey script.

如果您不確定我們在說什麼,可以使用Win + B,然後按Left,然後按Enter來使用鍵盤彈出該日曆(或者您可以單擊時鐘一次)。 但是我們可以使用AutoHotkey指令碼將其簡化為單個擊鍵。

image

Note: I came up with this idea after reading an article from Digital Inspiration about launching timedate.cpl with a shortcut.

注意:在閱讀Digital Inspiration中有關使用快捷方式啟動timedate.cpl的文章後,我想到了這個想法

Using the AutoHotkey Script

使用AutoHotkey指令碼

In order to use this script, you’ll need to have AutoHotkey installed. If you’d rather not do that, there’s a compiled version further down.

為了使用此指令碼,您需要安裝AutoHotkey 。 如果您不願意這樣做,則還有一個編譯後的版本。

What we’ll do is assign the F12 key to send the keystrokes instead of having to do them manually. Create a new file named something.ahk and then paste in the following:

我們要做的是分配F12鍵來發送擊鍵,而不必手動進行。 建立一個名為something.ahk的新檔案,然後貼上以下內容:

#InstallKeybdHook#Persistent#HotkeyInterval,100SetKeyDelay, -1

#InstallKeybdHook#Persistent#HotkeyInterval,100SetKeyDelay,-1

f12::{send, {lwin down}b{lwin up}sleep 10send, {left}sleep 10send, {enter}Return}

f12 :: {傳送,{lwin向下} b {lwin向上}Hibernate10傳送,{left}Hibernate10傳送,{enter}返回}

Save the file, and now you can double-click on it to launch it.

儲存檔案,現在您可以雙擊它來啟動它。

image

At this point you can use the F12 key to pop open the calendar. If you want to close the script out, there’s an icon in the system tray.

此時,您可以使用F12鍵彈出日曆。 如果要關閉指令碼,則系統托盤中會有一個圖示。

Note: You can substitute another key instead of F12 if you want. You could also add #NoTrayIcon to keep it from putting an icon into the system tray.

注意:如果需要,可以用其他鍵代替F12。 您還可以新增#NoTrayIcon,以防止其將圖示放入系統托盤中。

Using the Compiled Application

使用編譯的應用程式

I’ve included a compiled .exe version of the script in the download that you can run if you don’t have AutoHotkey installed. Just double-click on VistaCalendarHotkey.exe to run it.

如果未安裝AutoHotkey,則在下載檔案中包含指令碼的已編譯.exe版本。 只需雙擊VistaCalendarHotkey.exe即可執行它。

Download VistaCalendarHotkey AutoHotkey Script/Application

下載VistaCalendarHotkey AutoHotkey指令碼/應用程式

翻譯自: https://www.howtogeek.com/howto/windows-vista/keyboard-ninja-pop-up-the-vista-calendar-with-a-single-hotkey/