Skip to content

Commit

Permalink
Use strict_fn_arrows_
Browse files Browse the repository at this point in the history
  • Loading branch information
tekezo committed Aug 23, 2024
1 parent 37f56b6 commit 35b6d05
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,16 @@ class fn_function_keys_manipulator_manager final {
for (const auto& d : data) {
auto from_json = d["from"];
from_json["modifiers"]["mandatory"] = nlohmann::json::array({"fn"});
from_json["modifiers"]["optional"] = nlohmann::json::array({"any"});

if (profile.get_virtual_hid_keyboard()->get_strict_fn_arrows() &&
(d["from"]["key_code"] == "right_arrow" ||
d["from"]["key_code"] == "left_arrow" ||
d["from"]["key_code"] == "down_arrow" ||
d["from"]["key_code"] == "up_arrow")) {
// Do not set optional modifiers
} else {
from_json["modifiers"]["optional"] = nlohmann::json::array({"any"});
}

auto to_json = d["to"];
to_json["modifiers"] = nlohmann::json::array({"fn"});
Expand Down

0 comments on commit 35b6d05

Please sign in to comment.