logo

qmk_firmware

custom branch of QMK firmware git clone https://anongit.hacktivis.me/git/qmk_firmware.git

rubi.h (1622B)


  1. /* Copyright 2021 gregorio
  2. *
  3. * This program is free software: you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License as published by
  5. * the Free Software Foundation, either version 2 of the License, or
  6. * (at your option) any later version.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU General Public License
  14. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. */
  16. #pragma once
  17. #include "quantum.h"
  18. #define CALC_DIGITS 12
  19. enum rubi_keycodes {
  20. ENC_PRESS = QK_KB_0,
  21. CL_PLUS,
  22. CL_STAR,
  23. CL_TYPE
  24. };
  25. enum oled_modes {
  26. OLED_MODE_DEFAULT,
  27. OLED_MODE_CALC,
  28. OLED_MODE_OFF,
  29. _NUM_OLED_MODES
  30. };
  31. enum encoder_modes {
  32. ENC_MODE_VOLUME,
  33. ENC_MODE_MEDIA,
  34. ENC_MODE_BRIGHTNESS,
  35. _NUM_ENCODER_MODES
  36. };
  37. extern uint8_t current_layer;
  38. extern uint8_t oled_mode;
  39. extern uint8_t encoder_mode;
  40. extern char calc_result_display[CALC_DIGITS+1];
  41. extern char calc_operator_display;
  42. extern char calc_status_display[CALC_DIGITS+1];
  43. extern uint8_t calc_display_lines;
  44. bool process_record_user_oled(uint16_t keycode, keyrecord_t *record);
  45. void change_oled_mode(void);
  46. void change_encoder_mode(bool reverse);
  47. uint16_t handle_encoder_cw(void);
  48. uint16_t handle_encoder_ccw(void);
  49. uint16_t handle_encoder_press(void);
  50. void calcUpdate(void);
  51. void calcInput(char input);
  52. void calcOperands(void);