Просмотр исходного кода

Modify default keymap

old_master
Kai Ryu 10 лет назад
Родитель
Сommit
a0a5d52531
3 измененных файлов: 9 добавлений и 16 удалений
  1. 3
    3
      keyboard/smart68/keymap_common.c
  2. 1
    8
      keyboard/smart68/keymap_common.h
  3. 5
    5
      keyboard/smart68/keymap_default.c

+ 3
- 3
keyboard/smart68/keymap_common.c Просмотреть файл

/* 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);
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))
}; };
} }


#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;
} }

+ 1
- 8
keyboard/smart68/keymap_common.h Просмотреть файл

#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 */

+ 5
- 5
keyboard/smart68/keymap_default.c Просмотреть файл

* ,---------------------------------------------------------------. * ,---------------------------------------------------------------.
* |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|
* |---------------------------------------------------------------| * |---------------------------------------------------------------|
*/ */
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,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, FN1, HOME, \
TRNS,TRNS,UP, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PSCR,SLCK,PAUS,INS, TRNS, \
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 ),
[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;
} }