@@ -76,7 +76,9 @@ struct behavior_hold_tap_data {
76
76
// this data is specific for each hold-tap
77
77
struct active_hold_tap {
78
78
int32_t position ;
79
+ #if IS_ENABLED (CONFIG_ZMK_SPLIT )
79
80
uint8_t source ;
81
+ #endif
80
82
uint32_t param_hold ;
81
83
uint32_t param_tap ;
82
84
int64_t timestamp ;
@@ -250,21 +252,22 @@ static struct active_hold_tap *find_hold_tap(uint32_t position) {
250
252
return NULL ;
251
253
}
252
254
253
- static struct active_hold_tap * store_hold_tap (uint32_t position , uint8_t source ,
255
+ static struct active_hold_tap * store_hold_tap (struct zmk_behavior_binding_event * event ,
254
256
uint32_t param_hold , uint32_t param_tap ,
255
- int64_t timestamp ,
256
257
const struct behavior_hold_tap_config * config ) {
257
258
for (int i = 0 ; i < ZMK_BHV_HOLD_TAP_MAX_HELD ; i ++ ) {
258
259
if (active_hold_taps [i ].position != ZMK_BHV_HOLD_TAP_POSITION_NOT_USED ) {
259
260
continue ;
260
261
}
261
- active_hold_taps [i ].position = position ;
262
- active_hold_taps [i ].source = source ;
262
+ active_hold_taps [i ].position = event -> position ;
263
+ #if IS_ENABLED (CONFIG_ZMK_SPLIT )
264
+ active_hold_taps [i ].source = event -> source ;
265
+ #endif
263
266
active_hold_taps [i ].status = STATUS_UNDECIDED ;
264
267
active_hold_taps [i ].config = config ;
265
268
active_hold_taps [i ].param_hold = param_hold ;
266
269
active_hold_taps [i ].param_tap = param_tap ;
267
- active_hold_taps [i ].timestamp = timestamp ;
270
+ active_hold_taps [i ].timestamp = event -> timestamp ;
268
271
active_hold_taps [i ].position_of_first_other_key_pressed = -1 ;
269
272
return & active_hold_taps [i ];
270
273
}
@@ -402,7 +405,9 @@ static int press_hold_binding(struct active_hold_tap *hold_tap) {
402
405
struct zmk_behavior_binding_event event = {
403
406
.position = hold_tap -> position ,
404
407
.timestamp = hold_tap -> timestamp ,
408
+ #if IS_ENABLED (CONFIG_ZMK_SPLIT )
405
409
.source = hold_tap -> source ,
410
+ #endif
406
411
};
407
412
408
413
struct zmk_behavior_binding binding = {.behavior_dev = hold_tap -> config -> hold_behavior_dev ,
@@ -414,7 +419,9 @@ static int press_tap_binding(struct active_hold_tap *hold_tap) {
414
419
struct zmk_behavior_binding_event event = {
415
420
.position = hold_tap -> position ,
416
421
.timestamp = hold_tap -> timestamp ,
422
+ #if IS_ENABLED (CONFIG_ZMK_SPLIT )
417
423
.source = hold_tap -> source ,
424
+ #endif
418
425
};
419
426
420
427
struct zmk_behavior_binding binding = {.behavior_dev = hold_tap -> config -> tap_behavior_dev ,
@@ -427,7 +434,9 @@ static int release_hold_binding(struct active_hold_tap *hold_tap) {
427
434
struct zmk_behavior_binding_event event = {
428
435
.position = hold_tap -> position ,
429
436
.timestamp = hold_tap -> timestamp ,
437
+ #if IS_ENABLED (CONFIG_ZMK_SPLIT )
430
438
.source = hold_tap -> source ,
439
+ #endif
431
440
};
432
441
433
442
struct zmk_behavior_binding binding = {.behavior_dev = hold_tap -> config -> hold_behavior_dev ,
@@ -439,7 +448,9 @@ static int release_tap_binding(struct active_hold_tap *hold_tap) {
439
448
struct zmk_behavior_binding_event event = {
440
449
.position = hold_tap -> position ,
441
450
.timestamp = hold_tap -> timestamp ,
451
+ #if IS_ENABLED (CONFIG_ZMK_SPLIT )
442
452
.source = hold_tap -> source ,
453
+ #endif
443
454
};
444
455
445
456
struct zmk_behavior_binding binding = {.behavior_dev = hold_tap -> config -> tap_behavior_dev ,
@@ -603,8 +614,9 @@ static int on_hold_tap_binding_pressed(struct zmk_behavior_binding *binding,
603
614
return ZMK_BEHAVIOR_OPAQUE ;
604
615
}
605
616
606
- struct active_hold_tap * hold_tap = store_hold_tap (event .position , event .source , binding -> param1 ,
607
- binding -> param2 , event .timestamp , cfg );
617
+ struct active_hold_tap * hold_tap =
618
+ store_hold_tap (& event , binding -> param1 , binding -> param2 , cfg );
619
+
608
620
if (hold_tap == NULL ) {
609
621
LOG_ERR ("unable to store hold-tap info, did you press more than %d hold-taps?" ,
610
622
ZMK_BHV_HOLD_TAP_MAX_HELD );
0 commit comments