Skip to content

Commit 41d10f9

Browse files
committed
fix: simlayer forcing key up
resolve #91
1 parent 8c8bbfb commit 41d10f9

File tree

3 files changed

+22
-22
lines changed

3 files changed

+22
-22
lines changed

src/karabiner_configurator/core.clj

+13-13
Original file line numberDiff line numberDiff line change
@@ -223,16 +223,16 @@
223223
"errors" (exit (if ok? 0 1) exit-message)
224224
"default" (exit (if ok? 0 1) exit-message)))))
225225

226-
;; develop
227-
;; (-main)
228-
;; (-main "-h")
229-
;; (-main "--help")
230-
;; (-main "help")
231-
;; (-main "-l")
232-
;; (-main "--log")
233-
;; (-main "log")
234-
;; (-main "--config" "./")
235-
;; (-main "-c" "./")
236-
;; (-main "-dc" "./")
237-
;; (-main "-dc" "~/.config/karabiner.edn")
238-
;; (-main "-d")
226+
(comment
227+
(-main)
228+
(-main "-h")
229+
(-main "--help")
230+
(-main "help")
231+
(-main "-l")
232+
(-main "--log")
233+
(-main "log")
234+
(-main "--config" "./")
235+
(-main "-c" "./")
236+
(-main "-dc" "./")
237+
(-main "-dc" "~/.config/karabiner.edn")
238+
(-main "-d"))

src/karabiner_configurator/rules.clj

+1-1
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@
235235
insert-simlayer (assoc insert-simlayer :from
236236
(froms/parse-from des (:from insert-simlayer)))
237237
insert-simlayer (assoc insert-simlayer :to
238-
(vec (concat (:to result) (tos/parse-to des (:to insert-simlayer)))))
238+
(vec (concat (tos/parse-to des (:to insert-simlayer)) (:to result))))
239239
insert-simlayer (if (:to_if_held_down result)
240240
(assoc insert-simlayer :to_if_held_down (:to_if_held_down result))
241241
insert-simlayer)

test/karabiner_configurator/rules_test.clj

+8-8
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@
216216
:conditions [{:name "vi-mode", :value 1, :type "variable_if"}],
217217
:type "basic"}
218218
{:parameters {:basic.simultaneous_threshold_milliseconds 250},
219-
:to [{:key_code "4"} {:set_variable {:name "vi-mode", :value 1}}],
219+
:to [{:set_variable {:name "vi-mode", :value 1}} {:key_code "4"}],
220220
:from
221221
{:simultaneous [{:key_code "d"} {:key_code "g"}],
222222
:simultaneous_options
@@ -253,7 +253,7 @@
253253
:type "device_if"}],
254254
:type "basic"}
255255
{:parameters {:basic.simultaneous_threshold_milliseconds 250},
256-
:to [{:key_code "7"} {:set_variable {:name "vi-mode", :value 1}}],
256+
:to [{:set_variable {:name "vi-mode", :value 1}} {:key_code "7"}],
257257
:from
258258
{:simultaneous [{:key_code "d"} {:key_code "j"}],
259259
:simultaneous_options
@@ -498,8 +498,8 @@
498498
:type "basic"}
499499
{:parameters {:basic.simultaneous_threshold_milliseconds 432},
500500
:to
501-
[{:key_code "down_arrow"}
502-
{:set_variable {:name "vi-mode", :value 1}}],
501+
[{:set_variable {:name "vi-mode", :value 1}}
502+
{:key_code "down_arrow"}],
503503
:from
504504
{:simultaneous [{:key_code "d"} {:key_code "j"}],
505505
:simultaneous_options
@@ -518,8 +518,8 @@
518518
:type "basic"}
519519
{:parameters {:basic.simultaneous_threshold_milliseconds 250},
520520
:to
521-
[{:key_code "down_arrow"}
522-
{:set_variable {:name "vi-mode", :value 1}}],
521+
[{:set_variable {:name "vi-mode", :value 1}}
522+
{:key_code "down_arrow"}],
523523
:from
524524
{:simultaneous [{:key_code "d"} {:key_code "j"}],
525525
:simultaneous_options
@@ -542,8 +542,8 @@
542542
:type "basic"}
543543
{:parameters {:basic.simultaneous_threshold_milliseconds 432},
544544
:to
545-
[{:key_code "down_arrow"}
546-
{:set_variable {:name "vi-mode", :value 1}}],
545+
[{:set_variable {:name "vi-mode", :value 1}}
546+
{:key_code "down_arrow"}],
547547
:from
548548
{:simultaneous [{:key_code "d"} {:key_code "j"}],
549549
:simultaneous_options

0 commit comments

Comments
 (0)