Skip to content

Instantly share code, notes, and snippets.

@ipetepete
Created December 16, 2025 15:57
Show Gist options
  • Select an option

  • Save ipetepete/8e16349bd1d4187b4aac95de1814e4dd to your computer and use it in GitHub Desktop.

Select an option

Save ipetepete/8e16349bd1d4187b4aac95de1814e4dd to your computer and use it in GitHub Desktop.
Snipe mode for QMK pointer devices
bool process_record_user(uint16_t keycode, keyrecord_t* record) {
switch (keycode) {
/*
Next steps allow any key i.e. KC_NO to be assigned with Via or
Remap-keys etc and return tap for the original assigned key
*/
case LT(0,KC_G): {
// intercept hold
// Snipe Mode - slow down pointer while held
if (!record->tap.count && record->event.pressed){
pointing_device_driver_set_cpi(2);
return false; // don't continue processing key
}else{ // release
pointing_device_driver_set_cpi(10);
return true; // continue to process
}
// default - allow processing of key press/tap
return true;
}
}
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment