Skip to content

Commit

Permalink
fix typos in rules, seems I spell all "cancel" wrong.
Browse files Browse the repository at this point in the history
  • Loading branch information
yqrashawn committed Sep 10, 2018
1 parent a0df08e commit 09c57ec
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 11 deletions.
17 changes: 13 additions & 4 deletions CHANGELOG.org
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
* Change Log
All notable changes to this project will be documented in this file. This change log follows the conventions of [keepachangelog.com](http://keepachangelog.com/).

** [Unreleased]
** Unreleased

[Unreleased]: https://github.com/yqrashawn/GokuRakuJoudo/compare/v0.1.2...HEAD

** 0.1.2 - 2018-09-10
*** Fixed
- typo in rules, seems I spell all "cancel" wrong.

[0.1.2]: https://github.com/yqrashawn/GokuRakuJoudo/compare/v0.1.1...v0.1.2

** 0.1.1 - 2018-09-07
*** Added
- to key check while parsing key code
*** Changed
Expand All @@ -10,9 +20,8 @@ All notable changes to this project will be documented in this file. This change
- karabiner error while using ~:mission_control~
- multiple devices condition bug

[0.1.1]: https://github.com/yqrashawn/GokuRakuJoudo/compare/v0.1.0...v0.1.1

** 0.1.0 - 2018-09-07
*** Added
- First release

[Unreleased]: https://github.com/yqrashawn/GokuRakuJoudo/compare/v0.1.0...HEAD
# [0.1.1]: https://github.com/yqrashawn/GokuRakuJoudo/compare/0.1.0...0.1.1
6 changes: 3 additions & 3 deletions src/karabiner_configurator/rules.clj
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@
;; to_if_held_down | :held
;; to_after_key_up | :afterup
;; to_delayed_action | :delayed
;; to_if_canceled | :cancled
;; to_if_canceled | :canceled
;; to_if_invoked | :invoked
;; parameters | :params
;; basic.to_if_alone_timeout_milliseconds | :alone
Expand All @@ -183,12 +183,12 @@
[des additional prevresult]
(let [result prevresult
{:keys [alone held afterup delayed params]} additional
{:keys [cancled invoked]} delayed
{:keys [canceled invoked]} delayed
result (if alone (assoc result :to_if_alone (to-key des alone)) result)
result (if held (assoc result :to_if_held_down (to-key des held)) result)
result (if afterup (assoc result :to_after_key_up (to-key des afterup)) result)
result (if invoked (assoc-in result [:to_delayed_action :to_if_invoked] (to-key des invoked)) result)
result (if cancled (assoc-in result [:to_delayed_action :to_if_cancled] (to-key des cancled)) result)
result (if canceled (assoc-in result [:to_delayed_action :to_if_canceled] (to-key des canceled)) result)
{:keys [alone held delay]} params
result (if (number? alone) (assoc-in result [:parameters :basic.to_if_alone_timeout_milliseconds] alone) result)
result (if (number? held) (assoc-in result [:parameters :basic.to_if_held_down_threshold_milliseconds] held) result)
Expand Down
8 changes: 4 additions & 4 deletions test/karabiner_configurator/rules_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
{:des "press h insert 8 then set variable some-mode to 0" :rules [[:h [:8 {:set ["some-mode" 0]}]]]}
{:des "capslock to control as modifier to escape when press alone" :rules [[:##caps_lock :left_control nil {:alone :escape}]]}
{:des "Quit application by pressing command-q twice" :rules [[:!C#Pq :!Cq ["command-q" 1]]
[:!C#Pq ["command-q" 1] nil {:delayed {:invoked ["command-q" 0] :cancled ["commandq" 0]}}]]}
[:!C#Pq ["command-q" 1] nil {:delayed {:invoked ["command-q" 0] :canceled ["commandq" 0]}}]]}
{:des "Quit application by holding command-q" :rules [[:!C#Pq nil nil {:held {:key :q :modi :left_command :repeat false}}]]}
{:des "Quit Safari by pressing command-q twice" :rules [[:!C#Pq :!Cq [:safari ["command-q" 1]]]
[:!C#Pq ["command-q" 1] :safari {:delayed {:invoked ["command-q" 0] :cancled ["command-q" 0]}}]]}
[:!C#Pq ["command-q" 1] :safari {:delayed {:invoked ["command-q" 0] :canceled ["command-q" 0]}}]]}
{:des "Mouse button"
:rules [[{:pkey :button5} :mission_control]
[{:pkey :button4} [{:pkey :button1} {:pkey :button1} :!!grave_accent_and_tilde]]]}])
Expand Down Expand Up @@ -139,7 +139,7 @@
:type "variable_if"}],
:type "basic"}
{:to_delayed_action {:to_if_invoked [{:set_variable {:name "command-q", :value 0}}],
:to_if_cancled [{:set_variable {:name "commandq", :value 0}}]},
:to_if_canceled [{:set_variable {:name "commandq", :value 0}}]},
:from {:key_code "q",
:modifiers {:mandatory ["left_command"],
:optional ["caps_lock"]}},
Expand All @@ -166,7 +166,7 @@
:type "variable_if"}],
:type "basic"}
{:to_delayed_action {:to_if_invoked [{:set_variable {:name "command-q", :value 0}}],
:to_if_cancled [{:set_variable {:name "command-q", :value 0}}]},
:to_if_canceled [{:set_variable {:name "command-q", :value 0}}]},
:from {:key_code "q",
:modifiers {:mandatory ["left_command"],
:optional ["caps_lock"]}},
Expand Down

0 comments on commit 09c57ec

Please sign in to comment.