Rewrite layer action with layer_switch

This commit is contained in:
tmk 2013-02-16 04:05:58 +09:00
parent 0142b571c4
commit e324fa2918
7 changed files with 148 additions and 112 deletions

View file

@ -21,16 +21,39 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "keyboard.h"
#include "action.h"
uint16_t layer_switch_stat;
uint16_t layer_switch_stat_get(void);
void layer_switch_stat_set(uint16_t stat);
/* base layer to fall back */
extern uint8_t default_layer;
/* layer status */
extern uint16_t layer_switch_stat;
/* return layer status */
uint16_t layer_switch_get_stat(void);
/* return current active layer */
uint8_t layer_switch_get_layer(void);
/* switch off all layers */
void layer_switch_clear(void);
/* set layer status */
void layer_switch_set(uint16_t stat);
/* move to layer */
void layer_switch_move(uint8_t layer);
/* switch on layer */
void layer_switch_on(uint8_t layer);
/* switch off layer */
void layer_switch_off(uint8_t layer);
/* invert state */
void layer_switch_inv(uint8_t layer);
/* switch state of layer */
void layer_switch_invert(uint8_t layer);
/* bitwise operation against layer status */
void layer_switch_or(uint16_t stat);
void layer_switch_and(uint16_t stat);
void layer_switch_xor(uint16_t stat);
void layer_switch_debug(void);
/* return action depending on current layer status */
action_t layer_switch_get_action(key_t key);
#endif