擴充彈性十足的滑鼠手勢軟體:StrokesPlus

和我先前介紹過的StrokeItgMote一樣,StrokesPlus也是一款滑鼠手勢的Windows軟體,免費、耗用資源小、有32位元與64位元程式,而且還是持續在更新的活躍軟體。因為過年期間在家裡用的是24吋的寬螢幕, 視窗放到最大時右上角的關閉會在很「遠」的位置,滑鼠的移動距離相對變得較大,有時又懶得按鍵盤,此時使是使用滑鼠手勢軟體的好場合,因此就把StrokesPlus安裝起來試試。

StrokesPlus是使用Lua腳本來當做動作的控制語法,因此能讓我們依需求撰寫要執行的動作,擴充彈性頗強,除了要去查查Lua語法之外,它的腳本還算非常好寫,我依自己的需要寫了下面幾個,除了最後一個之外,都加在【Global Actions】裡面:

StrokesPlus

S手勢:開啟StrokesPlus設定視窗

原來的S手勢是中止媒體播放器,我修改成將縮小到系統匣的StrokesPlus重新顯示到螢幕上。

 
  -- 你沒看錯,就一行而已
  acShowActions()

L手勢:關閉分頁或視窗

在Firefox或Google Chrome裡經常用L手勢來關閉分頁,此處的Lua是判斷當前的視窗再分別送出〔Ctrl+W〕、〔Alt+F4〕、〔Win+Alt+Delete〕(ConEmu使用)或〔Ctrl+F4〕(Java編輯器IntelliJ IDEA使用)。StrokesPlus用的按鍵寫法和Autohotkey差異很大,可參考Help最後面的說明。

 
-- this code sends the CTRL+W key combination, which 
-- will usually close a window or tab within an application
-- 取得有焦點的視窗
local handle = acGetForegroundWindow()
--acMessageBox(handle,"ActiveWindow",1)
local handleTaskman = acFindWindowByTitleRegex("工作管理員")
local handleEvernote = acFindWindow("ENMainFrame")
local handleConEmu = acFindWindow("VirtualConsoleClass")
local handleIDEA = acFindWindow("SunAwtFrame")  -- IntelliJ IDEA

--acMessageBox(handleEvernote,"handle",1)
if (handle == handleTaskman) or (handle == handleEvernote) then
  acSendKeys("%{F_4}")
elseif (handle == handleConEmu) then
  acSendKeys("@%{DELETE}")
elseif (handle == handleIDEA) then
  acSendKeys("^{F_4}")
else
  acSendKeys("^w")
end

→手勢:開啟瀏覽器連結

點擊設定視窗的【Configure Actions】→【Internet Browser】後我們可在右側的「File Name Pattern」欄位看到「firefox.exe|chrome.exe|iexplore.exe」表示此處設定是針對此三個瀏覽器而設定的。我將向右手勢修改成開啟連結處網址的功能。 原來的寫法將網址開啟在當頁,我加上按下〔Ctrl〕鍵再點擊,讓網頁開啟在新分頁。

 
-- this code does one of two things, if the mouse cursor
-- is a HAND, the  link below the cursor is opened in a new 
-- tab. If the mouse cursor is not a HAND, a new browser 
-- tab is opened this action is executed by holding the 
-- stroke button and clicking the left mouse button, either 
-- over a link or anywhere over the browser for a new tab
if acGetMouseCursorType() == "HAND" then
    acSendControlDown()
    acMouseClick(gsx, gsy, 2, 1, 1)     
    acSendControlUp()
else
    acSendKeys("^t")
end

2013/02/20新增:T手勢:開啟TortoiseSVN瀏覽檔案庫

acShellExecute("open", "C:\\Program files\\Tortoisesvn\\bin\\TortoiseProc.exe", "/command:repobrowser", "", 1) 


##

您可能也會有興趣的類似文章

簡睿

服務於軟體業的資訊老兵。興趣廣泛,學習力佳,樂於分享所知所學。

您可能也會喜歡…

2 個回應

  1. NoAnyLove表示:

    要是有一个直达官网的连接就好了。。。。。。。

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *