fixup: remove apparently unnecessary MOUSEKEY section and re-indent

This commit is contained in:
Mark Stosberg 2024-06-20 09:52:01 -04:00
parent b0fad57a30
commit a97ebfef8a
No known key found for this signature in database

View File

@ -131,56 +131,47 @@ bool process_record_kb(uint16_t keycode, keyrecord_t* record) {
if (!process_record_user(keycode, record)) return false;
switch (keycode) {
#ifndef MOUSEKEY_ENABLE
// process KC_MS_BTN1~8 by myself
// See process_action() in quantum/action.c for details.
case KC_MS_BTN1 ... KC_MS_BTN8: {
extern void register_button(bool, enum mouse_buttons);
register_button(record->event.pressed, MOUSE_BTN_MASK(keycode - KC_MS_BTN1));
return false;
if (keycode == CPI_SW && record->event.pressed) {
cocot_config.cpi_idx = (cocot_config.cpi_idx + 1) % CPI_OPTION_SIZE;
eeconfig_update_kb(cocot_config.raw);
pointing_device_set_cpi(cpi_array[cocot_config.cpi_idx]);
}
#endif
if (keycode == SCRL_SW && record->event.pressed) {
cocot_config.scrl_div = (cocot_config.scrl_div + 1) % SCRL_DIV_SIZE;
eeconfig_update_kb(cocot_config.raw);
}
if (keycode == ROT_R15 && record->event.pressed) {
cocot_config.rotation_angle = (cocot_config.rotation_angle + 1) % ANGLE_SIZE;
eeconfig_update_kb(cocot_config.raw);
}
if (keycode == ROT_L15 && record->event.pressed) {
cocot_config.rotation_angle = (ANGLE_SIZE + cocot_config.rotation_angle - 1) % ANGLE_SIZE;
eeconfig_update_kb(cocot_config.raw);
}
if (keycode == SCRL_IN && record->event.pressed) {
cocot_config.scrl_inv = -cocot_config.scrl_inv;
eeconfig_update_kb(cocot_config.raw);
}
if (keycode == SCRL_TO && record->event.pressed) {
{
cocot_config.scrl_mode ^= 1;
}
}
if (keycode == SCRL_MO) {
{
cocot_config.scrl_mode ^= 1;
}
}
return true;
}
if (keycode == CPI_SW && record->event.pressed) {
cocot_config.cpi_idx = (cocot_config.cpi_idx + 1) % CPI_OPTION_SIZE;
eeconfig_update_kb(cocot_config.raw);
pointing_device_set_cpi(cpi_array[cocot_config.cpi_idx]);
}
if (keycode == SCRL_SW && record->event.pressed) {
cocot_config.scrl_div = (cocot_config.scrl_div + 1) % SCRL_DIV_SIZE;
eeconfig_update_kb(cocot_config.raw);
}
if (keycode == ROT_R15 && record->event.pressed) {
cocot_config.rotation_angle = (cocot_config.rotation_angle + 1) % ANGLE_SIZE;
eeconfig_update_kb(cocot_config.raw);
}
if (keycode == ROT_L15 && record->event.pressed) {
cocot_config.rotation_angle = (ANGLE_SIZE + cocot_config.rotation_angle - 1) % ANGLE_SIZE;
eeconfig_update_kb(cocot_config.raw);
}
if (keycode == SCRL_IN && record->event.pressed) {
cocot_config.scrl_inv = - cocot_config.scrl_inv;
eeconfig_update_kb(cocot_config.raw);
}
if (keycode == SCRL_TO && record->event.pressed) {
{ cocot_config.scrl_mode ^= 1; }
}
if (keycode == SCRL_MO) {
{ cocot_config.scrl_mode ^= 1; }
}
return true;
}
void eeconfig_init_kb(void) {
cocot_config.cpi_idx = COCOT_CPI_DEFAULT;
cocot_config.scrl_div = COCOT_SCROLL_DIV_DEFAULT;