Skip to content

Instantly share code, notes, and snippets.

@davidwallacejackson
Created July 9, 2024 02:57
Show Gist options
  • Select an option

  • Save davidwallacejackson/7191f8306c0f19a39a32cdde5b7d3fd4 to your computer and use it in GitHub Desktop.

Select an option

Save davidwallacejackson/7191f8306c0f19a39a32cdde5b7d3fd4 to your computer and use it in GitHub Desktop.
// ...and the encoder is turned counter-clockwise, send Shift+Tab
const key_override_t encoder_prev_app = ko_make_basic(MOD_MASK_GUI, KC_VOLD, G(S(KC_TAB)));
// ...and the encoder is turned clockwise, send Tab
const key_override_t encoder_next_app = ko_make_basic(MOD_MASK_GUI, KC_VOLU, G(KC_TAB));
// when the Opt key is held...
// ...and the encoder is turned counter-clockwise, send Shift+Cmd+`
const key_override_t encoder_prev_window = ko_make_basic(MOD_BIT(KC_LOPT), KC_VOLD, G(S(KC_GRV)));
// ...and the encoder is turned clockwise, send Cmd+`
const key_override_t encoder_next_window = ko_make_basic(MOD_BIT(KC_LOPT), KC_VOLU, G(KC_GRV));
// when the Ctrl key is held...
// ...and the encoder is turned counter-clockwise, send Shift+Ctrl+Tab
const key_override_t encoder_prev_tab = ko_make_basic(MOD_MASK_CTRL, KC_VOLD, S(C(KC_TAB)));
// ...and the encoder is turned clockwise, send Ctrl+Tab
const key_override_t encoder_next_tab = ko_make_basic(MOD_MASK_CTRL, KC_VOLU, C(KC_TAB));
// This globally defines all key overrides to be used
const key_override_t **key_overrides = (const key_override_t *[]){
&encoder_prev_tab,
&encoder_next_tab,
&encoder_prev_window,
&encoder_next_window,
&encoder_prev_app,
&encoder_next_app,
NULL // Null terminate the array of overrides!
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment