phillco / talon-axkit

Talon macOS accessibility magic!
MIT License
47 stars 12 forks source link

Cannot set bool in .talon files #37

Closed wenkokke closed 2 years ago

wenkokke commented 2 years ago

Various settings use type bool, but .talon files cannot contain booleans.

These should switch over to type int.

phillco commented 2 years ago

Hm, normally I just set them to 0 or 1 in the .talon files then they seem to work fine. Since those are the only two possible values, is there an advantage of changing it to int?

wenkokke commented 2 years ago

Honesty, I guess? Using 0 and 1 works because of implicit conversion to booleans, but at the point where you have a setting of type bool, and it’s actually storing 1, that’s technically a type error?

pokey commented 2 years ago

I'm not sure I'm in love with either solution. Saying it is an int discards the semantics that we're after with the setting. Although it is technically more "honest", it sacrifices precision

AndreasArvidsson commented 2 years ago

I actually believe that passing zero or one into a Talon action with an argument of type boolean will pass the type checking. The same is true with settings. Passing any other number will probably be an error, but zero and one is how you do booleans in Talonscript as far as I know. I would keep using booleans when possible.