1
0
Fork 0

Rename file layer_switch to action_layer

This commit is contained in:
tmk 2013-04-02 17:44:24 +09:00
parent cc8e66754b
commit c6d88d2795
10 changed files with 20 additions and 60 deletions

View file

@ -24,7 +24,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "keycode.h"
#include "action.h"
#include "action_macro.h"
#include "layer_switch.h"
#include "report.h"
#include "host.h"
#include "print.h"
@ -160,8 +159,6 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
};
static const uint8_t PROGMEM overlays[][MATRIX_ROWS][MATRIX_COLS] = {};
/*
* Fn action definition
*/
@ -179,33 +176,15 @@ static const uint16_t PROGMEM fn_actions[] = {
#endif
#define KEYMAPS_SIZE (sizeof(keymaps) / sizeof(keymaps[0]))
#define OVERLAYS_SIZE (sizeof(overlays) / sizeof(overlays[0]))
#define FN_ACTIONS_SIZE (sizeof(fn_actions) / sizeof(fn_actions[0]))
/* translates key to keycode */
uint8_t keymap_key_to_keycode(uint8_t layer, key_t key)
{
/* Overlay: 16-31(OVERLAY_BIT(0x10) | overlay_layer) */
if (layer & OVERLAY_BIT) {
layer &= OVERLAY_MASK;
if (layer < OVERLAYS_SIZE) {
return pgm_read_byte(&overlays[(layer)][(key.row)][(key.col)]);
} else {
// XXX: this may cuaes bootlaoder_jump incositent fail.
//debug("key_to_keycode: overlay "); debug_dec(layer); debug(" is invalid.\n");
return KC_TRANSPARENT;
}
}
/* Keymap: 0-15 */
else {
if (layer < KEYMAPS_SIZE) {
return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]);
} else {
// XXX: this may cuaes bootlaoder_jump incositent fail.
//debug("key_to_keycode: base "); debug_dec(layer); debug(" is invalid.\n");
// fall back to layer 0
return pgm_read_byte(&keymaps[0][(key.row)][(key.col)]);
}
if (layer < KEYMAPS_SIZE) {
return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]);
} else {
return pgm_read_byte(&keymaps[0][(key.row)][(key.col)]);
}
}