global if behavior name starts with 'layer'

This commit is contained in:
tokazio 2023-01-17 22:23:02 +01:00
parent ec6a7948a8
commit c2992bf0e5
2 changed files with 6 additions and 3 deletions

View file

@ -9,6 +9,8 @@
#include <kernel.h>
#include <logging/log.h>
#include <drivers/behavior.h>
#include <zmk/split/bluetooth/central.h>
LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL);
@ -35,6 +37,10 @@ static void behavior_queue_process_next(struct k_work *work) {
.timestamp = k_uptime_get()};
if (item.press) {
if(strncmp(item.binding.behavior_dev,"RGB_UG",6)==0){
LOG_DBG("RGB_COLOR_HSB_CMD sending binding to peripheral");
zmk_split_bt_invoke_behavior(0, &binding, event, true);
}
behavior_keymap_binding_pressed(&item.binding, event);
} else {
behavior_keymap_binding_released(&item.binding, event);

View file

@ -8,7 +8,6 @@
#include <device.h>
#include <drivers/behavior.h>
#include <zmk/split/bluetooth/central.h>
#include <logging/log.h>
#include <dt-bindings/zmk/rgb.h>
@ -129,8 +128,6 @@ static int on_keymap_binding_pressed(struct zmk_behavior_binding *binding,
case RGB_EFR_CMD:
return zmk_rgb_underglow_cycle_effect(-1);
case RGB_COLOR_HSB_CMD:
LOG_DBG("RGB_COLOR_HSB_CMD sending binding to peripheral");
zmk_split_bt_invoke_behavior(0, &binding, event, true);
return zmk_rgb_underglow_set_hsb((struct zmk_led_hsb){.h = (binding->param2 >> 16) & 0xFFFF,
.s = (binding->param2 >> 8) & 0xFF,
.b = binding->param2 & 0xFF});