yqrashawn / GokuRakuJoudo

config karabiner with ease
GNU General Public License v3.0
1.2k stars 123 forks source link

Using `pointer_button` as a `from` causes `NullPointerException` #239

Open ayyjohn opened 11 months ago

ayyjohn commented 11 months ago

I was trying to write a config that would let me use my simlayer home row mods to do command + click and based on the documentation I came up with the following

{:des "Left Command to D"
         :rules [[:condi :!a-mode :!s-mode :d-mode :!f-mode :!j-mode :!k-mode :!l-mode :!semicolon-mode]
...
[{:pkey :button1} {:pkey :button1 :modi :left_command}]
...

however that was causing a crash when I tried to regenerate my karabiner.json

after changing some stuff around and trying to figure out the source of the crash, it looks like it happens as long as I have

[{:pkey :button1} ...]

because it works when I do any other input, such as

[:##semicolon {:pkey :button1 :modi :left_command}]

stacktrace

Exception in thread "main" java.lang.NullPointerException
    at karabiner_configurator.data$from_k_QMARK_.invokeStatic(data.clj:111)
    at karabiner_configurator.data$from_k_QMARK_.invoke(data.clj:108)
    at karabiner_configurator.froms$parse_keycode_or_pkey_vec$fn__1663.invoke(froms.clj:95)
    at clojure.core$mapv$fn__8535.invoke(core.clj:6979)
    at clojure.lang.PersistentVector.reduce(PersistentVector.java:343)
    at clojure.core$reduce.invokeStatic(core.clj:6885)
    at clojure.core$mapv.invokeStatic(core.clj:6970)
    at clojure.core$mapv.invoke(core.clj:6970)
    at karabiner_configurator.froms$parse_keycode_or_pkey_vec.invokeStatic(froms.clj:95)
    at karabiner_configurator.froms$parse_keycode_or_pkey_vec.invoke(froms.clj:92)
    at karabiner_configurator.froms$parse_sim.invokeStatic(froms.clj:122)
    at karabiner_configurator.froms$parse_sim.invoke(froms.clj:118)
    at karabiner_configurator.froms$parse_from.invokeStatic(froms.clj:141)
    at karabiner_configurator.froms$parse_from.invoke(froms.clj:136)
    at karabiner_configurator.rules$parse_rule.invokeStatic(rules.clj:244)
    at karabiner_configurator.rules$parse_rule.invoke(rules.clj:226)
    at karabiner_configurator.rules$generate_one_rules$iter__2051__2055$fn__2056$fn__2057.invoke(rules.clj:428)
    at karabiner_configurator.rules$generate_one_rules$iter__2051__2055$fn__2056.invoke(rules.clj:411)
    at clojure.lang.LazySeq.sval(LazySeq.java:42)
    at clojure.lang.LazySeq.seq(LazySeq.java:51)
    at clojure.lang.RT.seq(RT.java:535)
    at clojure.core$seq__5467.invokeStatic(core.clj:139)
    at clojure.core$map$fn__5935.invoke(core.clj:2763)
    at clojure.lang.LazySeq.sval(LazySeq.java:42)
    at clojure.lang.LazySeq.seq(LazySeq.java:51)
    at clojure.lang.ChunkedCons.chunkedNext(ChunkedCons.java:59)
    at clojure.lang.ChunkedCons.next(ChunkedCons.java:43)
    at clojure.lang.RT.next(RT.java:713)
    at clojure.core$next__5451.invokeStatic(core.clj:64)
    at clojure.core$concat$cat__5560$fn__5561.invoke(core.clj:744)
    at clojure.lang.LazySeq.sval(LazySeq.java:42)
    at clojure.lang.LazySeq.seq(LazySeq.java:51)
    at clojure.lang.RT.seq(RT.java:535)
    at clojure.core$seq__5467.invokeStatic(core.clj:139)
    at clojure.core$filter$fn__5962.invoke(core.clj:2826)
    at clojure.lang.LazySeq.sval(LazySeq.java:42)
    at clojure.lang.LazySeq.seq(LazySeq.java:51)
    at clojure.lang.Cons.next(Cons.java:39)
    at clojure.lang.PersistentVector.create(PersistentVector.java:79)
    at clojure.lang.LazilyPersistentVector.create(LazilyPersistentVector.java:44)
    at clojure.core$vec.invokeStatic(core.clj:379)
    at clojure.core$vec.invoke(core.clj:369)
    at karabiner_configurator.rules$generate_one_rules.invokeStatic(rules.clj:377)
    at karabiner_configurator.rules$generate_one_rules.invoke(rules.clj:372)
    at karabiner_configurator.rules$generate$fn__2088.invoke(rules.clj:441)
    at karabiner_configurator.rules$generate.invokeStatic(rules.clj:439)
    at karabiner_configurator.rules$generate.invoke(rules.clj:431)
    at karabiner_configurator.rules$parse_mains.invokeStatic(rules.clj:467)
    at karabiner_configurator.rules$parse_mains.invoke(rules.clj:461)
    at karabiner_configurator.core$parse_edn.invokeStatic(core.clj:81)
    at karabiner_configurator.core$parse_edn.invoke(core.clj:60)
    at karabiner_configurator.core$parse.invokeStatic(core.clj:138)
    at karabiner_configurator.core$parse.doInvoke(core.clj:130)
    at clojure.lang.RestFn.invoke(RestFn.java:439)
    at karabiner_configurator.core$_main.invokeStatic(core.clj:229)
    at karabiner_configurator.core$_main.doInvoke(core.clj:224)
    at clojure.lang.RestFn.invoke(RestFn.java:397)
    at clojure.lang.AFn.applyToHelper(AFn.java:152)
    at clojure.lang.RestFn.applyTo(RestFn.java:132)
    at karabiner_configurator.core.main(Unknown Source)

happy to include any other info, i'm on Macos Ventura 13.0.1

goku --version
0.5.7