core: Fix keymap.h header for C++
This commit is contained in:
parent
0b19a95ff4
commit
d14a00c44e
2 changed files with 20 additions and 8 deletions
|
|
@ -171,10 +171,6 @@ static action_t keycode_to_action(uint8_t keycode)
|
||||||
* Legacy keymap support
|
* Legacy keymap support
|
||||||
* Consider using new keymap API instead.
|
* Consider using new keymap API instead.
|
||||||
*/
|
*/
|
||||||
extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS];
|
|
||||||
extern const uint8_t fn_layer[];
|
|
||||||
extern const uint8_t fn_keycode[];
|
|
||||||
|
|
||||||
__attribute__ ((weak))
|
__attribute__ ((weak))
|
||||||
uint8_t keymap_get_keycode(uint8_t layer, uint8_t row, uint8_t col)
|
uint8_t keymap_get_keycode(uint8_t layer, uint8_t row, uint8_t col)
|
||||||
{
|
{
|
||||||
|
|
@ -223,10 +219,6 @@ action_t keymap_fn_to_action(uint8_t keycode)
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
/* user keymaps should be defined somewhere */
|
|
||||||
extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS];
|
|
||||||
extern const action_t fn_actions[];
|
|
||||||
|
|
||||||
__attribute__ ((weak))
|
__attribute__ ((weak))
|
||||||
uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key)
|
uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#include "action.h"
|
#include "action.h"
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef BOOTMAGIC_ENABLE
|
#ifdef BOOTMAGIC_ENABLE
|
||||||
/* NOTE: Not portable. Bit field order depends on implementation */
|
/* NOTE: Not portable. Bit field order depends on implementation */
|
||||||
typedef union {
|
typedef union {
|
||||||
|
|
@ -40,6 +44,8 @@ typedef union {
|
||||||
} keymap_config_t;
|
} keymap_config_t;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS];
|
||||||
|
extern const action_t fn_actions[];
|
||||||
|
|
||||||
/* translates key to keycode */
|
/* translates key to keycode */
|
||||||
uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key);
|
uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key);
|
||||||
|
|
@ -54,6 +60,10 @@ action_t keymap_fn_to_action(uint8_t keycode);
|
||||||
* Legacy keymap
|
* Legacy keymap
|
||||||
* Consider using new keymap API above instead.
|
* Consider using new keymap API above instead.
|
||||||
*/
|
*/
|
||||||
|
extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS];
|
||||||
|
extern const uint8_t fn_layer[];
|
||||||
|
extern const uint8_t fn_keycode[];
|
||||||
|
|
||||||
/* keycode of key */
|
/* keycode of key */
|
||||||
__attribute__ ((deprecated))
|
__attribute__ ((deprecated))
|
||||||
uint8_t keymap_get_keycode(uint8_t layer, uint8_t row, uint8_t col);
|
uint8_t keymap_get_keycode(uint8_t layer, uint8_t row, uint8_t col);
|
||||||
|
|
@ -65,6 +75,16 @@ uint8_t keymap_fn_layer(uint8_t fn_bits);
|
||||||
/* keycode to send when release Fn key without using */
|
/* keycode to send when release Fn key without using */
|
||||||
__attribute__ ((deprecated))
|
__attribute__ ((deprecated))
|
||||||
uint8_t keymap_fn_keycode(uint8_t fn_bits);
|
uint8_t keymap_fn_keycode(uint8_t fn_bits);
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
/* user keymaps should be defined somewhere */
|
||||||
|
extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS];
|
||||||
|
extern const action_t fn_actions[];
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue