core: Actionmap support
This commit is contained in:
parent
75ca495c01
commit
5e9b21d77d
9 changed files with 586 additions and 73 deletions
39
tmk_core/common/actionmap.c
Normal file
39
tmk_core/common/actionmap.c
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
/*
|
||||
Copyright 2015 Jun Wako <wakojun@gmail.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include <stdint.h>
|
||||
#include "action_code.h"
|
||||
#include "actionmap.h"
|
||||
|
||||
/* Converts key to action */
|
||||
__attribute__ ((weak))
|
||||
action_t action_for_key(uint8_t layer, keypos_t key)
|
||||
{
|
||||
return (action_t)pgm_read_word(&actionmaps[(layer)][(key.row)][(key.col)]);
|
||||
}
|
||||
|
||||
/* Macro */
|
||||
__attribute__ ((weak))
|
||||
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
||||
{
|
||||
return MACRO_NONE;
|
||||
}
|
||||
|
||||
/* Function */
|
||||
__attribute__ ((weak))
|
||||
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt)
|
||||
{
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue