36 lines
		
	
	
	
		
			857 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			36 lines
		
	
	
	
		
			857 B
		
	
	
	
		
			C
		
	
	
	
	
	
| // Copyright 2023 Danny Nguyen (danny@keeb.io)
 | |
| // SPDX-License-Identifier: GPL-2.0-or-later
 | |
| 
 | |
| #include "quantum.h"
 | |
| 
 | |
| #ifdef ENCODER_ENABLE
 | |
| bool encoder_update_kb(uint8_t index, bool clockwise) {
 | |
|     if (!encoder_update_user(index, clockwise)) { return false; }
 | |
|     if (index == 0) {
 | |
|         if (clockwise) {
 | |
|             tap_code(KC_VOLU);
 | |
|         } else {
 | |
|             tap_code(KC_VOLD);
 | |
|         }
 | |
|     } else if (index == 1) {
 | |
|         if (clockwise) {
 | |
|             tap_code(KC_PGDN);
 | |
|         } else {
 | |
|             tap_code(KC_PGUP);
 | |
|         }
 | |
|     } else if (index == 2) {
 | |
|         if (clockwise) {
 | |
|             tap_code(KC_VOLU);
 | |
|         } else {
 | |
|             tap_code(KC_VOLD);
 | |
|         }
 | |
|     } else if (index == 3) {
 | |
|         if (clockwise) {
 | |
|             tap_code(KC_PGDN);
 | |
|         } else {
 | |
|             tap_code(KC_PGUP);
 | |
|         }
 | |
|     }
 | |
|     return false;
 | |
| }
 | |
| #endif
 | 
