1
0

Modify default keymap

This commit is contained in:
Kai Ryu 2014-07-05 21:43:21 +09:00
parent 19130e5f0b
commit a0a5d52531
3 changed files with 9 additions and 16 deletions

View File

@ -19,7 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* translates key to keycode */ /* translates key to keycode */
uint8_t keymap_key_to_keycode(uint8_t layer, key_t key) uint8_t keymap_key_to_keycode(uint8_t layer, key_t key)
{ {
#ifndef KEYMAP_EX_ENABLE #ifndef KEYMAP_IN_EEPROM_ENABLE
return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]); return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]);
#else #else
return eeconfig_read_keymap_key(layer, key.row, key.col); return eeconfig_read_keymap_key(layer, key.row, key.col);
@ -30,7 +30,7 @@ uint8_t keymap_key_to_keycode(uint8_t layer, key_t key)
action_t keymap_fn_to_action(uint8_t keycode) action_t keymap_fn_to_action(uint8_t keycode)
{ {
return (action_t) { return (action_t) {
#ifndef KEYMAP_EX_ENABLE #ifndef KEYMAP_IN_EEPROM_ENABLE
.code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]) .code = pgm_read_word(&fn_actions[FN_INDEX(keycode)])
#else #else
.code = eeconfig_read_keymap_fn_action(FN_INDEX(keycode)) .code = eeconfig_read_keymap_fn_action(FN_INDEX(keycode))
@ -38,7 +38,7 @@ action_t keymap_fn_to_action(uint8_t keycode)
}; };
} }
#ifdef KEYMAP_EX_ENABLE #ifdef KEYMAP_IN_EEPROM_ENABLE
const uint8_t* keymaps_pointer(void) { const uint8_t* keymaps_pointer(void) {
return (const uint8_t*)keymaps; return (const uint8_t*)keymaps;
} }

View File

@ -28,18 +28,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "print.h" #include "print.h"
#include "debug.h" #include "debug.h"
#include "keymap.h" #include "keymap.h"
#include "keymap_ex.h" #include "keymap_in_eeprom.h"
/*
#ifdef KEYMAP_EX_ENABLE
extern const uint8_t keymaps[KEYMAPS_COUNT][MATRIX_ROWS][MATRIX_COLS];
extern const uint16_t fn_actions[FN_ACTIONS_COUNT];
#else
*/
extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS]; extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS];
extern const uint16_t fn_actions[]; extern const uint16_t fn_actions[];
//#endif
/* SMART68 keymap definition macro */ /* SMART68 keymap definition macro */

View File

@ -32,9 +32,9 @@ const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = {
* ,---------------------------------------------------------------. * ,---------------------------------------------------------------.
* |Mut| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| | | * |Mut| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| | |
* |---------------------------------------------------------------| * |---------------------------------------------------------------|
* | | | | | | | | | | |Psc|Slk|Pau| Ins| | * | | |Up | | | | | | | |Psc|Slk|Pau| Ins| |
* |---------------------------------------------------------------| * |---------------------------------------------------------------|
* | | | | | | | | | | | | |Fn1 |Hom| * | |Lef|Dow|Rig| | | | | | | | |Fn1 |Hom|
* |---------------------------------------------------------------| * |---------------------------------------------------------------|
* | | | | | | | | | | | | |VoU|End| * | | | | | | | | | | | | |VoU|End|
* |---------------------------------------------------------------| * |---------------------------------------------------------------|
@ -45,8 +45,8 @@ const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = {
*/ */
KEYMAP( KEYMAP(
MUTE,F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS,TRNS, \ MUTE,F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS,TRNS, \
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PSCR,SLCK,PAUS,INS, TRNS, \ TRNS,TRNS,UP, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PSCR,SLCK,PAUS,INS, TRNS, \
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, FN1, HOME, \ TRNS,LEFT,DOWN,RGHT,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, FN1, HOME, \
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,VOLU,END, \ TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,VOLU,END, \
TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,FN3, VOLD,FN3, \ TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,FN3, VOLD,FN3, \
TRNS ), TRNS ),
@ -67,7 +67,7 @@ const uint16_t fn_actions[] PROGMEM = {
[3] = ACTION_BACKLIGHT_INCREASE() [3] = ACTION_BACKLIGHT_INCREASE()
}; };
#ifdef KEYMAP_EX_ENABLE #ifdef KEYMAP_IN_EEPROM_ENABLE
uint16_t keys_count(void) { uint16_t keys_count(void) {
return sizeof(keymaps) / sizeof(keymaps[0]) * MATRIX_ROWS * MATRIX_COLS; return sizeof(keymaps) / sizeof(keymaps[0]) * MATRIX_ROWS * MATRIX_COLS;
} }