logo

qmk_firmware

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

process_sequencer.c (2412B)


  1. /* Copyright 2020 Rodolphe Belouin
  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. #include "process_sequencer.h"
  17. bool process_sequencer(uint16_t keycode, keyrecord_t *record) {
  18. if (record->event.pressed) {
  19. switch (keycode) {
  20. case QK_SEQUENCER_ON:
  21. sequencer_on();
  22. return false;
  23. case QK_SEQUENCER_OFF:
  24. sequencer_off();
  25. return false;
  26. case QK_SEQUENCER_TOGGLE:
  27. sequencer_toggle();
  28. return false;
  29. case QK_SEQUENCER_TEMPO_DOWN:
  30. sequencer_decrease_tempo();
  31. return false;
  32. case QK_SEQUENCER_TEMPO_UP:
  33. sequencer_increase_tempo();
  34. return false;
  35. case QK_SEQUENCER_RESOLUTION_DOWN:
  36. sequencer_decrease_resolution();
  37. return false;
  38. case QK_SEQUENCER_RESOLUTION_UP:
  39. sequencer_increase_resolution();
  40. return false;
  41. case QK_SEQUENCER_STEPS_ALL:
  42. sequencer_set_all_steps_on();
  43. return false;
  44. case QK_SEQUENCER_STEPS_CLEAR:
  45. sequencer_set_all_steps_off();
  46. return false;
  47. case SEQUENCER_STEP_MIN ... SEQUENCER_STEP_MAX:
  48. sequencer_toggle_step(keycode - SEQUENCER_STEP_MIN);
  49. return false;
  50. case SEQUENCER_RESOLUTION_MIN ... SEQUENCER_RESOLUTION_MAX:
  51. sequencer_set_resolution(keycode - SEQUENCER_RESOLUTION_MIN);
  52. return false;
  53. case SEQUENCER_TRACK_MIN ... SEQUENCER_TRACK_MAX:
  54. sequencer_toggle_single_active_track(keycode - SEQUENCER_TRACK_MIN);
  55. return false;
  56. }
  57. }
  58. return true;
  59. }