Skip to content

Instantly share code, notes, and snippets.

@devdammit
Last active August 26, 2024 07:01
Show Gist options
  • Save devdammit/bfbd3283cad38503e02cb534e2bad84c to your computer and use it in GitHub Desktop.
Save devdammit/bfbd3283cad38503e02cb534e2bad84c to your computer and use it in GitHub Desktop.
SnapTap + JumpThrow Macro for QMK Keyboards
#include QMK_KEYBOARD_H
#include "timer.h"
#define TAP_THRESHOLD 50
#define MIN_DELAY 5
#define MAX_DELAY 20
#define CAPS_SCROLL_DELAY 3
#define CAPS_CLICK_DELAY 50
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
uint16_t current_time = timer_read();
uint16_t tap_duration = current_time - last_tap_time;
uint16_t random_delay(uint16_t min, uint16_t max) {
return min + (rand() % (max - min + 1));
}
switch (keycode) {
case KC_A:
if (record->event.pressed) {
a_pressed = true;
if (tap_duration < TAP_THRESHOLD) {
wait_ms(random_delay(MIN_DELAY, MAX_DELAY));
}
if (d_pressed) {
unregister_code(KC_D);
}
wait_ms(random_delay(MIN_DELAY, MAX_DELAY));
register_code(KC_A);
} else {
a_pressed = false;
unregister_code(KC_A);
if (d_pressed) {
wait_ms(random_delay(MIN_DELAY, MAX_DELAY));
register_code(KC_D);
}
}
last_tap_time = current_time;
return false;
case KC_D:
if (record->event.pressed) {
d_pressed = true;
if (tap_duration < TAP_THRESHOLD) {
wait_ms(random_delay(MIN_DELAY, MAX_DELAY));
}
if (a_pressed) {
unregister_code(KC_A);
}
wait_ms(random_delay(MIN_DELAY, MAX_DELAY));
register_code(KC_D);
} else {
d_pressed = false;
unregister_code(KC_D);
if (a_pressed) {
wait_ms(random_delay(MIN_DELAY, MAX_DELAY));
register_code(KC_A);
}
}
last_tap_time = current_time;
return false;
case KC_CAPS:
if (record->event.pressed) {
register_code(KC_MS_WH_UP);
wait_ms(CAPS_SCROLL_DELAY);
register_code(KC_MS_BTN1);
wait_ms(CAPS_CLICK_DELAY);
unregister_code(KC_MS_WH_UP);
unregister_code(KC_MS_BTN1);
}
return false;
default:
return true;
}
}

SnapTap + JumpThrow Macro for QMK Keyboards

Enhance your CS2 gameplay with the SnapTap + JumpThrow macro designed for QMK keyboards. This macro enables precise movement control and consistent grenade throws, giving you a competitive edge, all while remaining undetectable by CS2 due to its careful imitation of human behavior.

Features:

  • SnapTap Functionality: Execute rapid direction changes with minimal input delay, allowing for swift and responsive strafing during gameplay.
  • JumpThrow Macro: Perform perfectly timed grenade throws with a single key press, ensuring consistent and accurate throws every time.
  • Customizable Delays: Adjust delay settings to fine-tune the responsiveness and behavior of the SnapTap and JumpThrow actions according to your playstyle.
  • Seamless Integration: Easily incorporate this macro into your existing QMK firmware, with simple configuration options.
  • Undetectable by CS2: The macro is designed to maximize the imitation of human behavior, making it undetectable by CS2’s anti-cheat systems, ensuring safe usage.

How It Works:

  • SnapTap: When you press and hold a directional key, the macro instantly registers the opposite key upon release, facilitating quick directional changes without the need to manually release the initial key.
  • JumpThrow: The macro automates the jump and throw sequence, triggering both actions in perfect synchronization to ensure your grenades land exactly where you intend them to.

Setup Instructions:

  1. Download: Get the latest version of your QMK firmware and add the SnapTap + JumpThrow macro code.
  2. Customize: Adjust the delay settings for both SnapTap and JumpThrow to match your preferences.
  3. Compile & Flash: Compile your customized firmware and flash it to your keyboard.
  4. Play: Enjoy the enhanced control and precision in your CS2 matches.

This description now highlights the reason why the macro remains undetectable, giving users confidence in its safe usage in CS2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment