diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..6cbe3b1 --- /dev/null +++ b/LICENSE @@ -0,0 +1,204 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [2021] [Ruohang Feng] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + diff --git a/README.md b/README.md index 20f56e2..b392123 100644 --- a/README.md +++ b/README.md @@ -2,11 +2,11 @@ *Make CapsLock Great Again!* -![](images/logo.svg) +[![](images/logo.svg)](http://capslock.vonng.com) *Transform CapsLock into a powerful **modifier** ** Hyper** that miraculously increases your work productivity!* -[**Capslock Official Website**](http://capslock.vonng.com/en/) / [**ZH Site**](http://capslock.vonng.com/zh/) +[**Capslock Website**](http://capslock.vonng.com/en/) / [**ZH Site**](http://capslock.vonng.com/zh/) [**Chinese Documentation 中文文档** ](README_ZH.md) @@ -53,12 +53,15 @@ Capslock serves via [**Karabiner-Elements**](https://karabiner-elements.pqrs.or 1. Download and install [**Karabiner Elements**](https://karabiner-elements.pqrs.org/), following the wizard and grant required permissions. -2. Download [**capslock.json**](mac_v3/capslock.json) to:` ~/.config/karabiner/assets/complex_modifications/` . Or open this link with Safari to launch karabiner and load config from URL: +2. Download [**capslock.json**](mac_v3/capslock.json) to:` ~/.config/karabiner/assets/complex_modifications/` . + Or just open this link with Safari to launch karabiner and load config from URL: ```yaml - karabiner://karabiner/assets/complex_modifications/import?url=https://github.com/Vonng/Capslock/blob/master/mac_v3/capslock.json + karabiner://karabiner/assets/complex_modifications/import?url=https://vonng.com/capslock.json ``` + Or check karabiner official [gallery](https://ke-complex-modifications.pqrs.org/#emulation-modes) and load it there. + 3. Launch **Karabiner-Element** → **Tab: ComplexModification** → **Button: Add Rules**, then enabled rulesets. @@ -104,7 +107,7 @@ Hold ** Hyper** to enable hyper functionalities. We will assume a * Hold additional Command for **selection**. (like holding shift in normal), additional Option for **word/para selection**. * Hold additional Shift for **app/win/tab switching**. Hold additional Control for **desktop management** . * Hold additional Option for 🖱️ **mouse move**. Add shift to **⏫ accelerate**. (U, I, O, P maps to mouse buttons) . -* turns navigator to **🖲️ mouse wheel**, and is the ⏫ **accelerated** version . `HJKL` for wheel, wihle `UIOP` for reversed. +* turns navigator to **🖲️ mouse wheel**, and is the ⏫ **accelerated** version . `HJKL` for wheel, wihle `UIOP` for reversed wheel move. | Feature | **Move** | **Select** | **WordSel** | **Window** | **Desktop** | 🖱️ | **🖱️⏫** | 🖲️ | 🖲️⏫ | | :-----: | :------: | :--------: | :---------: | :--------: | :---------: | :--: | :----: | :--: | :--: | @@ -122,8 +125,6 @@ Hold ** Hyper** to enable hyper functionalities. We will assume a #### Arrow Navigation -
-arrow navigation * Arrows → to 🖱️ **mouse** actions too. Hold Option to ⏬ **slow down**, hold Command to ⏫ **speed up**. * Hold Shift turns to 🖲️ **wheel move**. Extra Option to ⏬ **slow down**, extra Command to ⏫ **speed up**. @@ -135,13 +136,9 @@ Hold ** Hyper** to enable hyper functionalities. We will assume a | | speed = 1600 | speed ÷ 2 | speed × 2 | speed = 32 | speed ÷ 2 | speed × 2 | | | 🖱️L | 🖱️M | 🖱️R | 🖱️L | 🖱️B | 🖱️F | -
### Deletion -
-deletion - N M , . are used as **Deletor keys**. Right below the navigators for fast access (brown area). | Key\Mod | | | | @@ -152,7 +149,6 @@ Hold ** Hyper** to enable hyper functionalities. We will assume a | . | del a word after | del till line end | del the whole line | | | del file | purge file | | -
### Mousekey @@ -315,8 +311,6 @@ Number keys 1, 2, …, 9, 0 are used ### Symbols -
-details | Glyph | Name | Glyph | Name | | :---: | :--------------------------: | :---: | :----------------------: | @@ -333,7 +327,7 @@ Number keys 1, 2, …, 9, 0 are used | 🖱️R | Mouse Right Click (Button2) | 🖱️F | Mouse Forward (Button5) | | 🖱️M | Mouse Middle Click (Button3) | 🖲️ | Mouse Wheel | -
+ ### Control Planes diff --git a/design.md b/design.md deleted file mode 100644 index bdf6c5e..0000000 --- a/design.md +++ /dev/null @@ -1,96 +0,0 @@ -# Capslock Enhancement Design - -⇪CapsLock,即大写锁定键,其起源可追溯至打字机时代。打字机是纯机械的设备,当按下Shift时,整套设备会与墨条纸带发生位移,使小写字母“上档”为大写字母。此等操作对小拇指是不小的负担,以致连续输入两到三个大写字母都比较吃力。于是在今天键盘上⇪Capslock的位置上出现了其原型Shiftlock功能键:可以在大小写状态之间切换与保持。这样的设计解决了一指禅选手的困境,更减轻了打字员的负担。 - -然而随着科技的进步,这样的问题已经不存在了。除了一指禅选手,Shift能够毫不费力的满足人们的需求。而⇪Capslock这个'多余'的按键,则因为历史惯性保留在了绝大多数键盘的黄金位置。 - -历史上有很多人注意到了这一点,不少人都琢磨着让这个占据宝地的按键发挥出更大的作用。一些键盘直接去掉了⇪Capslock键,而另一些则直接把它作为⌃Ctrl使用。在一些Unix Like(e.g )环境中,⇪Capslock还被用作语言切换的按键。有些人将⇪Capslock改为复合功能键:单独键入时是⎋ESC,而按住不放时是⌃Ctrl。 - -不过为什么要浪费这样一个绝佳的机会呢?我们所能做的远比这更多: - -譬如创造一个类似⇧ Shift、⌃ Ctrl、⌥ Option、⊞ Win、⎇ Alt 、 ⌘ Command等修饰键的全新功能键: - -​ ✱ Hyper - -## Design - -1. `CapsLock`单独按下与长按的区分 - - 传统上扩展`Capslock`,要么是将其语言切换,要么是将其作为`Control`。但其实这两个功能并不矛盾,一个是单按触发,一个是按下时触发,所以完全可以合并在一起。 - - 单独按下Capslock时,会触发**语言切换**功能,按住不放时,则激活一个新的功能键`Hyper`,替代传统的`Ctrl`实现更多更丰富的定制功能。当然,另一种做法是将单独按下改造为`ESC`,这就要视需求选择了。 - -2. 导航键 - - 导航键包括:`↑`,`↓`,`←`,`→`,`Home`,`End`,`PgUp`,`PgDn`,提供了一套通用的光标移动操作。不过这些键都远离核心键区,导致移动光标需要把右手移开,这一点煞是恼人。最好是将这些导航键映射到右手的核心键区,通过按下`Capslock`键启用,同时需要在移动光标的同时,对文本选取的功能(`Shift`)提供良好支持。 - - 按下Capslock时,传统的VIM导航键`h,j,k,l`映射为方向键,而将这四个键上方的`u,i,o,p`分别映射为`PageUp`,`Home`, `End`,`PageDown `,提供全局的导航操作。另一方面,因为按下左手需要按下`Capslock`,右手需要控制导航键,都不适合按下两侧的`Shift`键进入文本选择模式,这时候比较好的选择是由左手大拇指同时按下⌘(Mac)或Alt(Win),将组合键映射为导航键+`Shift`提供文本选取支持。 - - 这样,vim的导航不仅可以在vim的所有模式中使用,也可以在系统中全局使用了。 - -3. 删除键 - - 删除是极其频繁的功能,包括前删(BackSpace)与后删(Delete)。不过Mac和Windows的操作不太一致有些恼人,而且这两个键也都是远离核心键区操作不便。 - - 将`Capslock`+`nm,.`映射到不同的删除功能上,首先这四个键在`h`,`j`,`k`,`l`正下方,操作非常方便。`Hyper + m`映射为前删`Delete`(Mac)或退格`BackSpace`(Win),`Hyper+ ,`设计为后删`ForwardDelete`(Mac)或`Delete`(Windows)。同时`n`和`.`则映射为相应的按下`Option`(Mac)或`Ctrl`(Win)的版本,即前删后删一个单词,类似vim的`dw`与`db`,提高长句删除效率。 - - 这样一来,Mac与Windows的删除行为终于保持一致了,而且删除功能由右手最为灵活的食指和中指负责操作,能大大提高编辑效率。 - -4. 上档键 - - 上档是CapsLock的传统功能。但通常Capslock对第二排数字键不起作用,这里不妨反其道行之,将Capslock+数字键映射为对应的上档符号,当然也可以考虑映射为其他的一些命令,例如IDE调试命令,配置切换命令等。同时,一些编程中的高频符号,比如括号,下划线,等于号,也可以从右上角拉下来,放到核心键区。 - - 比如`CapsLock+; : _` ,`Capslock + ' : =`,`Capslock + [ : (`,`Capslock + ] : )`。这样一来,高频符号下划线和等号就可以方便的录入了,而圆括号映射到方括号这里,让小中大括号一家终于团聚在一起,也减少了输入圆括号的手指位移。 - -5. 窗口控制 - - 除了切换应用程序窗口`⌘Tab`(Mac), `Alt+Tab`(Win)外,还有许多经常用到的窗口操作:譬如关闭窗口(关闭应用程序),关闭标签页,切换标签页等。 - - CapsLock+Q是Quit,关闭窗口的意思,映射到`⌘Q`(Mac)或`Alt+F4`(Win)。 - - CapsLock+W是关闭当前标签,映射到`⌘W`(Mac)或`Ctr+W`(Win) - - CapsLock+S是Switch的意思,切换当前标签页,映射到`^Tab`(Mac & Win)。 - - CapsLock+A是两个挨着的键,一起按就是另一个窗口管理软件的Moom的meta-key。可以方便的缩放摆弄窗口,很好用。 - - 这几个快捷方式非常常用,在IDE或者浏览器里都很方便。 - -6. Bash控制 - - 在Bash中,我们习惯Capslock作为Ctrl使用。但是最常用的,必不可少的其实只有几个: - - CapsLock+Z映射到`^Z`,用于发送SIGTSTP挂起作业。 - - CapsLock+X映射到`^B`,是终端复用软件Tmux的metakey。 - - CapsLock+C映射到`^C`,用于发送SIGINT中断作业。 - - CapsLock+V映射到`,`,是Vim的` key`,不过也可以作为应用按键 - - CapsLock+D映射到`^D`,用于发送`EOF` - - 当然,在Windows下面,这些键可以作为传统的编辑键:撤销,剪切,拷贝,粘贴…… - -7. 媒体控制: - - 在没有`Fn`的外接键盘上如何使用Mac的传统功能键?用`Hyper+FX`解忧愁。Capslock+F1就是调低亮度,依此类推。 - -8. 应用快捷键: - - 应用快捷键应当可以用一只手就轻松按出,这也限制了应用快捷键所能使用的键区。基本上适合作为应用快捷键的按键就是左手食指覆盖的键区了。 - - 这里`ERTYFGB`作为应用快捷键,加上⌘总共可以设置14个高频应用程序的快捷方式。这里是我的设置: - - `Hyper-E: Google Chrome.app`,`Hyper-⌘E: Finder`,E取自Explore的涵义。 - - `Hyper-R: iTerm`,`Hyper-⌘R: Ctrl+R (Run)`,R取自Run。 - - `Hyper-T: Sublime Text.app`,`Hyper-⌘T: Typora`,T取自Text,放置了常用的文本编辑器。 - - `Hyper-F: Dash.app`,`Dictionary`,F取自Find的涵义。最常用的查询软件。 - - `Hyper-G: IntelliJ IDEA.app`,`Hyper-⌘G: Clion`,G就是`Great`的意思,所以放了IDE - - `Hyper-B`可以放一些别的东西,目前当做了呼叫Emoji窗口的快捷键(`^⇧Space`)。 -