Keyboard firmwares for Atmel AVR and Cortex-M
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

layer_switch.h 1.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. Copyright 2013 Jun Wako <[email protected]>
  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. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. */
  14. #ifndef LAYER_SWITCH_H
  15. #define LAYER_SWITCH_H
  16. #include <stdint.h>
  17. #include "keyboard.h"
  18. #include "action.h"
  19. /* base layer to fall back */
  20. extern uint8_t default_layer;
  21. /* layer status */
  22. extern uint16_t layer_switch_stat;
  23. /* return layer status */
  24. uint16_t layer_switch_get_stat(void);
  25. /* return current active layer */
  26. uint8_t layer_switch_get_layer(void);
  27. /* switch off all layers */
  28. void layer_switch_clear(void);
  29. /* set layer status */
  30. void layer_switch_set(uint16_t stat);
  31. /* move to layer */
  32. void layer_switch_move(uint8_t layer);
  33. /* switch on layer */
  34. void layer_switch_on(uint8_t layer);
  35. /* switch off layer */
  36. void layer_switch_off(uint8_t layer);
  37. /* switch state of layer */
  38. void layer_switch_invert(uint8_t layer);
  39. /* bitwise operation against layer status */
  40. void layer_switch_or(uint16_t stat);
  41. void layer_switch_and(uint16_t stat);
  42. void layer_switch_xor(uint16_t stat);
  43. void layer_switch_debug(void);
  44. /* return action depending on current layer status */
  45. action_t layer_switch_get_action(key_t key);
  46. #endif