Procházet zdrojové kódy

Make action_for_key a weak symbol

tags/v2.9
Dan McGregor před 9 roky
rodič
revize
c17b8a599e
2 změnil soubory, kde provedl 6 přidání a 0 odebrání
  1. 1
    0
      tmk_core/common/action.h
  2. 5
    0
      tmk_core/common/keymap.c

+ 1
- 0
tmk_core/common/action.h Zobrazit soubor



/* action for key */ /* action for key */
action_t action_for_key(uint8_t layer, keypos_t key); action_t action_for_key(uint8_t layer, keypos_t key);
action_t action_for_key_default(uint8_t layer, keypos_t key);


/* macro */ /* macro */
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt); const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt);

+ 5
- 0
tmk_core/common/keymap.c Zobrazit soubor





/* converts key to action */ /* converts key to action */
__attribute__((__weak__))
action_t action_for_key(uint8_t layer, keypos_t key) action_t action_for_key(uint8_t layer, keypos_t key)
{ {
return action_for_key_default(layer, key);
}

action_t action_for_key_default(uint8_t layer, keypos_t key)
uint8_t keycode = keymap_key_to_keycode(layer, key); uint8_t keycode = keymap_key_to_keycode(layer, key);
switch (keycode) { switch (keycode) {
case KC_FN0 ... KC_FN31: case KC_FN0 ... KC_FN31:

Načítá se…
Zrušit
Uložit