Skip to content

Commit

Permalink
chore: Minor input behavior clean-up.
Browse files Browse the repository at this point in the history
  • Loading branch information
petejohanson committed Apr 7, 2024
1 parent 36c7827 commit ca28e83
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions app/src/behaviors/behavior_input_two_axis.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ static void update_work_scheduling(const struct device *dev) {
}
}

int zmk_input_synth_pointer_adjust_speed(const struct device *dev, int16_t dx, int16_t dy) {
int behavior_input_two_axis_adjust_speed(const struct device *dev, int16_t dx, int16_t dy) {
struct behavior_input_two_axis_data *data = dev->data;

LOG_DBG("Adjusting: %d %d", dx, dy);
Expand All @@ -208,15 +208,6 @@ int zmk_input_synth_pointer_adjust_speed(const struct device *dev, int16_t dx, i
return 0;
}

// static void process_key_state(const struct device *dev, int32_t val, bool pressed) {
// for (int i = 0; i < ZMK_HID_MOUSE_NUM_BUTTONS; i++) {
// if (val & BIT(i)) {
// WRITE_BIT(val, i, 0);
// input_report_key(dev, INPUT_BTN_0 + i, pressed ? 1 : 0, val == 0, K_FOREVER);
// }
// }
// }

static int behavior_input_two_axis_init(const struct device *dev) {
struct behavior_input_two_axis_data *data = dev->data;

Expand All @@ -236,7 +227,7 @@ static int on_keymap_binding_pressed(struct zmk_behavior_binding *binding,
int16_t x = MOVE_X_DECODE(binding->param1);
int16_t y = MOVE_Y_DECODE(binding->param1);

zmk_input_synth_pointer_adjust_speed(behavior_dev, x, y);
behavior_input_two_axis_adjust_speed(behavior_dev, x, y);
return 0;
}

Expand All @@ -249,7 +240,7 @@ static int on_keymap_binding_released(struct zmk_behavior_binding *binding,
int16_t x = MOVE_X_DECODE(binding->param1);
int16_t y = MOVE_Y_DECODE(binding->param1);

zmk_input_synth_pointer_adjust_speed(behavior_dev, -x, -y);
behavior_input_two_axis_adjust_speed(behavior_dev, -x, -y);
return 0;
}

Expand Down

0 comments on commit ca28e83

Please sign in to comment.