matrix1001 / capslock-plus-plus

⌨Amazing, extendable, readable autohotkey scripts framework utilized by Capslock.
90 stars 10 forks source link
ahk autohotkey capslock capslock-enhancement capslock-plus

ico

CapsLock++

中文说明

Amazing, extendable, readable autohotkey scripts framework utilized by Capslock.

Original core concept is to make your Capslock key as a new fn. You have to install AutoHotkey first.

Latest Release V0.2.2

New Features

Notice

This project is updating very quickly. If you pulled the latest version, remember to delete the old ini files in order to load new ones to gain new features.

However, I made a menu for you to do this quickly.

tray_reset

Feature

This project is in progress. Other fantastic functions will be joined.

Usage

Basic

Basic usage is according to the default settings. If you are not starter of AHK, just ignore this. These settings are in HyperSettings.ini.

In the following part, I will ignore capslock in keyset.

key function description
` toggle capslock
alt+1 switch to virtual desktop 1 win10 only
alt+2 switch to virtual desktop 2 create desktop before you use it
alt+3 switch to virtual desktop 3
h move left
j move down
k move up
l move right
u page up
p page down
i move to start
o move to end
c copy
v paste
volume up invisible in win7, but visible in win10
volume down
prev virtual desktop
next virtual desktop
space toggle window always on top
1,2,3,4,5 window bind
tab hyper tab
s hyper search
t google translate
alt+r reload script or settings
alt+t enable double click translate
alt+w move the window to the top press this key again will move the window back
alt+s move the window to the bottom
alt+a move the window to the left
alt+d move the window to the right
alt+q maximize/restore the window
alt+e minimize the window

By the way, you may want to suspend | restart the script when you play games. Press Alt + Esc will help. And its icon will change.

Here follows the basic configuration in HyperSettings.ini

[Basic]
Admin=0 ;run as admin
Icon=hyper.ico
ScriptMonitor=1 ;notify you about the changes of the scripts
SettingMonitor=1 ;notify you about the changes of the setting
StartUp=1 ;start on windows start

New Feature

I have redesigned the default tray UI. Take a look.

tray1

tray2

Default action of double click the icon is to open the directory of Capslock++. Now you can easily modify settings by right click the icon. Also, when your mouse is over the icon, there will be a status information.

More menu options will be joined later.

HyperTrans

Default translation is triggered by Capslock + t. You have to select a word or a sentence at first.

Here's some examples for you to test.

hola
Olá
 مرحبا 

Here's some pictures for demo. demo1 demo2 demo3

Also, language support has been added to HyperSettings.ini. Remember to use the language shortcut.

[Trans]
SourceLanguage=auto
TargetLanguage=zh ; for example, change this to es (spanish)
TransDoubleClickBackend=cgdict ; only support english to chinese. change this to google for more translation.
TransSelBackend=google

Surprising New Feature

Double Click To Translate

demo4

HyperSwitch

HyperSwitch is designed for quick switch between multiple windows. Extremely good for those who need to work with multiple window applications.

I have implemented 2 types of window switch functions.

Type 1

These two functions need to be configured before you use it.

Check default HyperWinSettings.ini

[Chrome]
exe=C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
id=ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe
key=a
typ=B

Just put information of your application here, and assign a key to it, then you can use it by press Capslock + key. key can also be alt_a if you want Capslock + alt + a.

About id, you can figure it out by using windowspy, which it installed by autohotkey.

After you finish configuration, it will be auto loaded. The manner of Type 1 functions is:

Type 2

Type 2 function does not require any configuration. But it need to be assigned to keymap.

Check Default HyperSettings.ini

[Keymap]
hyper_1=WindowC(1)
hyper_2=WindowC(2)
hyper_3=WindowC(3)
hyper_4=WindowC(4)
hyper_5=WindowC(5)
hyper_minus=WindowCClear

The manner is similar to Type 1:

To clear a window bind, you got two ways.

I only assign 5 WindowC by default. It supports at most 10 window. But I guess you will never use that much.

HyperTab

HyperTab helps you to auto complete some long strings with simple words, triggered by CapsLock + Tab.

Take a look at default HyperSetting.ini, you will find this

[Tab]
sample=this is a Tab sample
date1=<GetDateTime>
date2=<GetDateTime(yyyy-M-d)>

Move your cursor after the word sample, press CapsLock + Tab, and it will be auto replaced by this is a TabHotString sample

However, I have implemented function support.

In lib/basicfunc.ahk, you will find this function

GetDateTime(fmt := "yyyy/M/d")
{
    FormatTime, CurrentDateTime,, %fmt%
    return CurrentDateTime
}

And just use function between <>, it will be automatically evaluated. What if I need to use < or > instead of a function call? Use <<, >> instead.

Example

[before] date1 -> [after] 2018/10/6
[before] date2 -> [after] 2018-10-6

Also multiple functions call is supported.

If you want to add your HotString into it, just change HyperSettings.ini. If you need other function, check UserScript in Usage.

Surprising New Feature

Autocomplete & suggestion has been added to HyperTab. Currently it will give you suggestions of the last word you input, with the backend of BaiduSuggest. However I have implemented GoogleSuggest, which is blocked from mainland. Check this.

tabsample1

Use tab or enter to autocomplete the word. Use up, down or Capslock + k, Capslock + j to choose item. You can also use your mouse to click.

HyperNotify

HyperNotify is a notification UI. Here follows some example.

noti1

noti2

noti3

Configuration is simple.

[Notify]
Enable=1
MsgLevel=1
Style=slide
Max=5

About MsgLevel, set 0 to show all notifications including DEBUG. However, sometimes it is annoying. Set to 1 to show all necessary notifications including INFO, SUCCESS and WARNING. Set to 2 to show only WARNING. Higher number means no notification will show up (Same as setting Enable to 0).

About Style, I have implemented three styles for you. slide means the notification will slide in ane slide out. fade means fade in and fade out. none means no any effect.

About Max, 5 is enough for you to use. It is useful when you need to use DEBUG mode.

There is a simple tray menu for you to quickly change MsgLevel.

tray_notify

HyperSearch

HyperSearch is designed for intelligent search for the selected text, triggered by Capslock + s. Here's some examples

www.baidu.com
c:\
c:\users
d:\test.txt
word
this is a sentence

For web url, HyperSearch will open it in your default web browser. For file or folder, it will open it by your default program (notepad for .txt file, for example). For word or sentence, it will trigger translation.

Further features are incoming.

UserScript

Now if want to put your script into capslock++.ahk, your have to follow these:

Then:

Misc

Ignore

Ignore Capslock++ on some applications. Edit this in HyperSettings.ini.

[Ignore]
Code.exe=1

Just throw the execute file names into [ignore] and set values to 1. And 0 means nothing.

Documention

TODO

Devlog

2020/2/14 version 0.2.7.1

2019/1/8 version 0.2.7

2018/12/23 version 0.2.6

2018/10/30 version 0.2.5

2018/10/23 version 0.2.4

2018/10/21 version 0.2.3

2018/10/18 version 0.2.2

this is a release version

2018/10/17 version 0.2.1

next version will be a release version

TODO

2018/10/16 version 0.2.0

still not a stable version due to new feature

TODO

2018/10/14 version 0.1.9

TODO

2018/10/12 version 0.1.8

this is not a stable version. i'm trying to make a better ui. next stable version will be 0.2.0

2018/10/11 version 0.1.7

2018/10/10 version 0.1.6

2018/10/9 version 0.1.5

this is a most bug-fix edition

TODO:

2018/10/8 version 0.1.4

2018/10/7 version 0.1.3

2018/10/6 version 0.1.2

2018/10/5 version 0.1.1

2018/10/4 version 0.1.0