mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-04-08 06:45:41 +00:00
comments
This commit is contained in:
parent
2c736f08dd
commit
3d53b360e1
@ -24,7 +24,7 @@ enum layers {
|
|||||||
_LAYER3
|
_LAYER3
|
||||||
};
|
};
|
||||||
|
|
||||||
enum custom_keycodeas {
|
enum custom_keycodes { // Define keycodes for MIDI usage of the volume knob
|
||||||
A_CW = USER00,
|
A_CW = USER00,
|
||||||
A_CCW
|
A_CCW
|
||||||
};
|
};
|
||||||
@ -84,7 +84,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
|||||||
switch (keycode) {
|
switch (keycode) {
|
||||||
case A_CW:
|
case A_CW:
|
||||||
if (record->event.pressed) {
|
if (record->event.pressed) {
|
||||||
midi_send_cc(&midi_device, midi_config.channel, 89, 1);
|
midi_send_cc(&midi_device, midi_config.channel, 89, 1);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
case A_CCW:
|
case A_CCW:
|
||||||
|
@ -108,7 +108,7 @@ void slider(void) {
|
|||||||
uint8_t current_val = analogReadPin(SLIDER_PINA) >>3;
|
uint8_t current_val = analogReadPin(SLIDER_PINA) >>3;
|
||||||
|
|
||||||
if ( last_val - current_val < -1 || last_val - current_val > 1 ) {
|
if ( last_val - current_val < -1 || last_val - current_val > 1 ) {
|
||||||
rgb_hue = rgblight_get_hue();
|
rgb_hue = rgblight_get_hue(); // Pull current hue and saturation values since we're just adjusting brightness
|
||||||
rgb_sat = rgblight_get_sat();
|
rgb_sat = rgblight_get_sat();
|
||||||
rgblight_sethsv(rgb_hue, rgb_sat, current_val * 2);
|
rgblight_sethsv(rgb_hue, rgb_sat, current_val * 2);
|
||||||
last_val = current_val;
|
last_val = current_val;
|
||||||
|
Loading…
Reference in New Issue
Block a user