Browse Source

Remove keymap read code from project directories

master
tmk 7 years ago
parent
commit
7b31d1b9d9
62 changed files with 36 additions and 620 deletions
  1. 1
    2
      converter/adb_usb/Makefile
  2. 1
    2
      converter/adb_usb/Makefile.rev1
  3. 1
    2
      converter/adb_usb/Makefile.teensy
  4. 0
    4
      converter/adb_usb/config.h
  5. 0
    30
      converter/adb_usb/keymap_common.c
  6. 0
    5
      converter/adb_usb/keymap_common.h
  7. 1
    1
      converter/adb_usb/keymap_plain.c
  8. 1
    2
      converter/ibm4704_usb/Makefile
  9. 0
    30
      converter/ibm4704_usb/keymap_common.c
  10. 0
    6
      converter/ibm4704_usb/keymap_common.h
  11. 0
    1
      converter/m0110_usb/Makefile
  12. 0
    1
      converter/m0110_usb/Makefile.teensy
  13. 0
    1
      converter/m0110_usb/Makefile.tmk_rev1
  14. 0
    1
      converter/m0110_usb/Makefile.tmk_rev2
  15. 0
    37
      converter/m0110_usb/keymap_common.c
  16. 0
    5
      converter/m0110_usb/keymap_common.h
  17. 3
    20
      converter/news_usb/keymap.c
  18. 2
    15
      converter/next_usb/keymap.c
  19. 2
    38
      converter/pc98_usb/keymap.c
  20. 1
    2
      converter/ps2_usb/Makefile
  21. 0
    1
      converter/ps2_usb/Makefile.mbed
  22. 1
    2
      converter/ps2_usb/Makefile.pjrc
  23. 1
    2
      converter/ps2_usb/Makefile.tmk_rev1
  24. 1
    2
      converter/ps2_usb/Makefile.tmk_rev2
  25. 1
    2
      converter/ps2_usb/Makefile.vusb
  26. 0
    31
      converter/ps2_usb/keymap_common.c
  27. 0
    5
      converter/ps2_usb/keymap_common.h
  28. 3
    20
      converter/sun_usb/keymap.c
  29. 0
    17
      converter/sun_usb/keymap_sun3.c
  30. 3
    20
      converter/terminal_usb/keymap.c
  31. 1
    3
      converter/usb_usb/Makefile
  32. 0
    31
      converter/usb_usb/keymap_common.c
  33. 0
    4
      converter/usb_usb/keymap_common.h
  34. 2
    16
      converter/x68k_usb/keymap.c
  35. 1
    2
      converter/xt_usb/Makefile
  36. 0
    31
      converter/xt_usb/keymap_common.c
  37. 0
    4
      converter/xt_usb/keymap_common.h
  38. 1
    1
      converter/xt_usb/keymap_jis.c
  39. 1
    1
      converter/xt_usb/keymap_plain.c
  40. 1
    1
      converter/xt_usb/keymap_spacefn.c
  41. 0
    1
      keyboard/alps64/Makefile
  42. 0
    1
      keyboard/alps64/actionmap_hasu.c
  43. 0
    1
      keyboard/alps64/actionmap_plain.c
  44. 0
    30
      keyboard/alps64/keymap_common.c
  45. 0
    5
      keyboard/alps64/keymap_common.h
  46. 1
    2
      keyboard/gh60/Makefile
  47. 0
    30
      keyboard/gh60/keymap_common.c
  48. 0
    5
      keyboard/gh60/keymap_common.h
  49. 1
    2
      keyboard/hhkb/Makefile
  50. 1
    2
      keyboard/hhkb/Makefile.pjrc
  51. 1
    2
      keyboard/hhkb/Makefile.rn42
  52. 0
    33
      keyboard/hhkb/keymap_common.c
  53. 0
    4
      keyboard/hhkb/keymap_common.h
  54. 0
    1
      keyboard/infinity/Makefile
  55. 0
    30
      keyboard/infinity/keymap_common.c
  56. 0
    4
      keyboard/infinity/keymap_common.h
  57. 0
    1
      keyboard/infinity_chibios/Makefile
  58. 0
    30
      keyboard/infinity_chibios/keymap_common.c
  59. 0
    4
      keyboard/infinity_chibios/keymap_common.h
  60. 0
    29
      keyboard/onekey/keymap.c
  61. 1
    1
      keyboard/stm32_f103_onekey/keymap_plain.c
  62. 1
    1
      keyboard/teensy_lc_onekey/keymap_plain.c

+ 1
- 2
converter/adb_usb/Makefile View File

TARGET_DIR = . TARGET_DIR = .


# project specific files # project specific files
SRC = keymap_common.c \
matrix.c \
SRC = matrix.c \
led.c \ led.c \
adb.c adb.c



+ 1
- 2
converter/adb_usb/Makefile.rev1 View File

TARGET_DIR = . TARGET_DIR = .


# project specific files # project specific files
SRC = keymap_common.c \
matrix.c \
SRC = matrix.c \
led.c \ led.c \
adb.c adb.c



+ 1
- 2
converter/adb_usb/Makefile.teensy View File

TARGET_DIR = . TARGET_DIR = .


# project specific files # project specific files
SRC = keymap_common.c \
matrix.c \
SRC = matrix.c \
led.c \ led.c \
adb.c adb.c



+ 0
- 4
converter/adb_usb/config.h View File

#define LOCKING_RESYNC_ENABLE #define LOCKING_RESYNC_ENABLE




/* legacy keymap support */
#define USE_LEGACY_KEYMAP


/* ADB port setting */ /* ADB port setting */
#define ADB_PORT PORTD #define ADB_PORT PORTD
#define ADB_PIN PIND #define ADB_PIN PIND

+ 0
- 30
converter/adb_usb/keymap_common.c View File

/*
Copyright 2011,2012,2013 Jun Wako <[email protected]>

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 "keymap_common.h"


/* translates key to keycode */
uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key)
{
return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]);
}

/* translates Fn keycode to action */
action_t keymap_fn_to_action(uint8_t keycode)
{
return (action_t){ .code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]) };
}

+ 0
- 5
converter/adb_usb/keymap_common.h View File



#include <stdint.h> #include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
#include <avr/pgmspace.h>
#include "keycode.h" #include "keycode.h"
#include "action.h" #include "action.h"
#include "action_macro.h" #include "action_macro.h"
#include "keymap.h" #include "keymap.h"




extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS];
extern const action_t fn_actions[];


/* Common layout: ANSI+ISO /* Common layout: ANSI+ISO
* ,---. .---------------. ,---------------. ,---------------. ,-----------. ,---------------. * ,---. .---------------. ,---------------. ,---------------. ,-----------. ,---------------.
* |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| |VDn|VUp|Mut|Pwr| * |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| |VDn|VUp|Mut|Pwr|

+ 1
- 1
converter/adb_usb/keymap_plain.c View File

), ),
}; };


const uint16_t PROGMEM fn_actions[] = {
const action_t PROGMEM fn_actions[] = {
[0] = ACTION_LAYER_TAP_KEY(1, KC_GRV), [0] = ACTION_LAYER_TAP_KEY(1, KC_GRV),
[1] = ACTION_LAYER_TAP_KEY(1, KC_BSLS), [1] = ACTION_LAYER_TAP_KEY(1, KC_BSLS),
}; };

+ 1
- 2
converter/ibm4704_usb/Makefile View File

TARGET_DIR = . TARGET_DIR = .


# project specific files # project specific files
SRC = keymap_common.c \
matrix.c \
SRC = matrix.c \
led.c \ led.c \
protocol/ibm4704.c protocol/ibm4704.c



+ 0
- 30
converter/ibm4704_usb/keymap_common.c View File

/*
Copyright 2011,2012,2013 Jun Wako <[email protected]>

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 "keymap_common.h"


/* translates key to keycode */
uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key)
{
return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]);
}

/* translates Fn keycode to action */
action_t keymap_fn_to_action(uint8_t keycode)
{
return (action_t){ .code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]) };
}

+ 0
- 6
converter/ibm4704_usb/keymap_common.h View File



#include <stdint.h> #include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
#include <avr/pgmspace.h>
#include "keycode.h" #include "keycode.h"
#include "action.h" #include "action.h"
#include "action_macro.h" #include "action_macro.h"
#include "keymap.h" #include "keymap.h"




// 32*8(256) byte array which converts PS/2 code into USB code
extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS];
extern const action_t fn_actions[];


/* 107-key */ /* 107-key */
#define KEYMAP( \ #define KEYMAP( \
K46,K64, K00,K18,K19,K1A,K10,K11,K12,K08,K09,K0A,K0F,K1F,K0D,K0C,K0E, K6A,K6B,K6C, K47,K48,K49,K4A, \ K46,K64, K00,K18,K19,K1A,K10,K11,K12,K08,K09,K0A,K0F,K1F,K0D,K0C,K0E, K6A,K6B,K6C, K47,K48,K49,K4A, \

+ 0
- 1
converter/m0110_usb/Makefile View File

# keyboard dependent files # keyboard dependent files
SRC = matrix.c \ SRC = matrix.c \
led.c \ led.c \
keymap_common.c \
m0110.c m0110.c


# To use own keymap file run make like: make keymap=hasu # To use own keymap file run make like: make keymap=hasu

+ 0
- 1
converter/m0110_usb/Makefile.teensy View File

# keyboard dependent files # keyboard dependent files
SRC = matrix.c \ SRC = matrix.c \
led.c \ led.c \
keymap_common.c \
m0110.c m0110.c


# To use own keymap file run make like: make keymap=hasu # To use own keymap file run make like: make keymap=hasu

+ 0
- 1
converter/m0110_usb/Makefile.tmk_rev1 View File

# keyboard dependent files # keyboard dependent files
SRC = matrix.c \ SRC = matrix.c \
led.c \ led.c \
keymap_common.c \
m0110.c m0110.c


# To use own keymap file run make like: make keymap=hasu # To use own keymap file run make like: make keymap=hasu

+ 0
- 1
converter/m0110_usb/Makefile.tmk_rev2 View File

# keyboard dependent files # keyboard dependent files
SRC = matrix.c \ SRC = matrix.c \
led.c \ led.c \
keymap_common.c \
m0110.c m0110.c


# To use own keymap file run make like: make keymap=hasu # To use own keymap file run make like: make keymap=hasu

+ 0
- 37
converter/m0110_usb/keymap_common.c View File

/*
Copyright 2011,2012,2014 Jun Wako <[email protected]>

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 <avr/pgmspace.h>
#include "action.h"
#include "keycode.h"
#include "keymap.h"
#include "keymap_common.h"


/* translates key to keycode */
uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key)
{
return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]);
}

/* translates Fn index to action */
action_t keymap_fn_to_action(uint8_t keycode)
{
action_t action;
action.code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]);
return action;
}

+ 0
- 5
converter/m0110_usb/keymap_common.h View File

along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <stdint.h> #include <stdint.h>
#include <avr/pgmspace.h>
#include "keycode.h" #include "keycode.h"
#include "keymap.h" #include "keymap.h"




extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS];
extern const action_t fn_actions[];


/* Common layout for M0110 and M0110A /* Common layout for M0110 and M0110A
* This keymap works with both keyboards. As you can see, the M0110A is * This keymap works with both keyboards. As you can see, the M0110A is
* a superset of M0110 keyboard, only one exception is 'Enter'(34) of M0110 * a superset of M0110 keyboard, only one exception is 'Enter'(34) of M0110

+ 3
- 20
converter/news_usb/keymap.c View File



#include <stdint.h> #include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
#include <avr/pgmspace.h>
#include "keycode.h" #include "keycode.h"
#include "util.h" #include "util.h"
#include "keymap.h" #include "keymap.h"




// Assign Fn key(0-7) to a layer to which switch with the Fn key pressed. // Assign Fn key(0-7) to a layer to which switch with the Fn key pressed.
static const uint8_t PROGMEM fn_layer[] = {
const uint8_t PROGMEM fn_layer[] = {
0, // Fn0 0, // Fn0
0, // Fn1 0, // Fn1
0, // Fn2 0, // Fn2


// Assign Fn key(0-7) to a keycode sent when release Fn key without use of the layer. // Assign Fn key(0-7) to a keycode sent when release Fn key without use of the layer.
// See layer.c for details. // See layer.c for details.
static const uint8_t PROGMEM fn_keycode[] = {
const uint8_t PROGMEM fn_keycode[] = {
KC_NO, // Fn0 KC_NO, // Fn0
KC_NO, // Fn1 KC_NO, // Fn1
KC_NO, // Fn2 KC_NO, // Fn2
}; };




static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* 0: default /* 0: default
* ,---. ,------------------------, ,------------------------. ,---------. * ,---. ,------------------------, ,------------------------. ,---------.
* |Pow| | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10| | F11| F12| ,-----------. * |Pow| | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10| | F11| F12| ,-----------.
LALT,CAPS,LALT, SPC, ERAS, RALT,RGUI,RCTL, PGDN, TAB, LEFT,DOWN,RGHT LALT,CAPS,LALT, SPC, ERAS, RALT,RGUI,RCTL, PGDN, TAB, LEFT,DOWN,RGHT
), ),
}; };


uint8_t keymap_get_keycode(uint8_t layer, uint8_t row, uint8_t col)
{
return pgm_read_byte(&keymaps[(layer)][(row)][(col)]);
}

uint8_t keymap_fn_layer(uint8_t index)
{
return pgm_read_byte(&fn_layer[index]);
}

uint8_t keymap_fn_keycode(uint8_t index)
{
return pgm_read_byte(&fn_keycode[index]);
}

+ 2
- 15
converter/next_usb/keymap.c View File



#include <stdint.h> #include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
#include <avr/pgmspace.h>
#include "keycode.h" #include "keycode.h"
#include "print.h" #include "print.h"
#include "debug.h" #include "debug.h"
#include "keycode.h" #include "keycode.h"


// 32*8(256) byte array which converts PS/2 code into USB code // 32*8(256) byte array which converts PS/2 code into USB code
static const action_t PROGMEM fn_actions[] = {
const action_t PROGMEM fn_actions[] = {
ACTION_LAYER_MOMENTARY(1), // FN0 - left command key ACTION_LAYER_MOMENTARY(1), // FN0 - left command key
ACTION_LAYER_MOMENTARY(1), // FN1 - right command key ACTION_LAYER_MOMENTARY(1), // FN1 - right command key
ACTION_KEY(KC_BSLS), // FN2 - number pad slash & backslash ACTION_KEY(KC_BSLS), // FN2 - number pad slash & backslash
} }




static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Layer 0: default /* Layer 0: default
* ,-----------------------------------------------------------. ,-----------. ,---------------. * ,-----------------------------------------------------------. ,-----------. ,---------------.
) )
}; };

/* translates key to keycode */
uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key)
{
return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]);
}

/* translates Fn keycode to action */
action_t keymap_fn_to_action(uint8_t keycode)
{
return (action_t){ .code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]) };
}

+ 2
- 38
converter/pc98_usb/keymap.c View File



#include <stdint.h> #include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
#include <avr/pgmspace.h>
#include "keycode.h" #include "keycode.h"
#include "action.h" #include "action.h"
#include "action_macro.h" #include "action_macro.h"






static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* /*
,---------------------------------------------------------------. ,---------------------------------------------------------------.
| 60| 61| 62| 63| 64| 65| 66| 67| 68| 69| 6A| 6B| 36| 37| 3F| 3E| | 60| 61| 62| 63| 64| 65| 66| 67| 68| 69| 6A| 6B| 36| 37| 3F| 3E|
LGUI, LALT, LCTL, LSFT, SPC, SPC, RALT LGUI, LALT, LCTL, LSFT, SPC, SPC, RALT
), ),
}; };
static const uint8_t PROGMEM overlays[][MATRIX_ROWS][MATRIX_COLS] = {};


/* /*
* Macro definition * Macro definition
/* /*
* Fn actions * Fn actions
*/ */
static const action_t PROGMEM fn_actions[] = {
const action_t PROGMEM fn_actions[] = {
ACTION_LAYER_TAP_TOGGLE(0), // FN0 ACTION_LAYER_TAP_TOGGLE(0), // FN0
ACTION_LAYER_TAP_KEY(1, KC_SLASH), // FN1 ACTION_LAYER_TAP_KEY(1, KC_SLASH), // FN1
ACTION_LAYER_TAP_KEY(2, KC_SCLN), // FN2 ACTION_LAYER_TAP_KEY(2, KC_SCLN), // FN2
ACTION_MACRO(RBRACKET), // FN5 ACTION_MACRO(RBRACKET), // FN5
ACTION_MACRO(DUMMY), // FN6 ACTION_MACRO(DUMMY), // FN6
}; };






/*
* No need to edit.
*/
#define KEYMAPS_SIZE (sizeof(keymaps) / sizeof(keymaps[0]))
#define FN_ACTIONS_SIZE (sizeof(fn_actions) / sizeof(fn_actions[0]))

/* translates key to keycode */
uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key)
{
if (layer < KEYMAPS_SIZE) {
return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]);
} else {
// fall back to layer 0
return pgm_read_byte(&keymaps[0][(key.row)][(key.col)]);
}
}

/* translates Fn keycode to action */
action_t keymap_fn_to_action(uint8_t keycode)
{
action_t action;
if (FN_INDEX(keycode) < FN_ACTIONS_SIZE) {
action.code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]);
} else {
action.code = ACTION_NO;
}
return action;
}

+ 1
- 2
converter/ps2_usb/Makefile View File

TARGET_DIR = . TARGET_DIR = .


# project specific files # project specific files
SRC = keymap_common.c \
matrix.c \
SRC = matrix.c \
led.c led.c


ifdef KEYMAP ifdef KEYMAP

+ 0
- 1
converter/ps2_usb/Makefile.mbed View File

OBJECTS = \ OBJECTS = \
$(OBJDIR)/protocol/ps2_busywait.o \ $(OBJDIR)/protocol/ps2_busywait.o \
$(OBJDIR)/protocol/ps2_io_mbed.o \ $(OBJDIR)/protocol/ps2_io_mbed.o \
$(OBJDIR)/./keymap_common.o \
$(OBJDIR)/./matrix.o \ $(OBJDIR)/./matrix.o \
$(OBJDIR)/./led.o \ $(OBJDIR)/./led.o \
$(OBJDIR)/./main.o $(OBJDIR)/./main.o

+ 1
- 2
converter/ps2_usb/Makefile.pjrc View File

TARGET_DIR = . TARGET_DIR = .


# keyboard dependent files # keyboard dependent files
SRC = keymap_common.c \
matrix.c \
SRC = matrix.c \
led.c led.c


ifdef KEYMAP ifdef KEYMAP

+ 1
- 2
converter/ps2_usb/Makefile.tmk_rev1 View File

TARGET_DIR = . TARGET_DIR = .


# project specific files # project specific files
SRC = keymap_common.c \
matrix.c \
SRC = matrix.c \
led.c led.c


ifdef KEYMAP ifdef KEYMAP

+ 1
- 2
converter/ps2_usb/Makefile.tmk_rev2 View File

TARGET_DIR = . TARGET_DIR = .


# project specific files # project specific files
SRC = keymap_common.c \
matrix.c \
SRC = matrix.c \
led.c led.c


ifdef KEYMAP ifdef KEYMAP

+ 1
- 2
converter/ps2_usb/Makefile.vusb View File

TARGET_DIR = . TARGET_DIR = .


# keyboard dependent files # keyboard dependent files
SRC = keymap_common.c \
matrix.c \
SRC = matrix.c \
led.c led.c


ifdef KEYMAP ifdef KEYMAP

+ 0
- 31
converter/ps2_usb/keymap_common.c View File

/*
Copyright 2011,2012,2013 Jun Wako <[email protected]>

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 "keymap_common.h"
#include "progmem.h"


/* translates key to keycode */
uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key)
{
return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]);
}

/* translates Fn keycode to action */
action_t keymap_fn_to_action(uint8_t keycode)
{
return (action_t){ .code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]) };
}

+ 0
- 5
converter/ps2_usb/keymap_common.h View File

#include "keymap.h" #include "keymap.h"




// 32*8(256) byte array which converts PS/2 code into USB code
extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS];
extern const action_t fn_actions[];


/* All keys */ /* All keys */
#define KEYMAP_ALL( \ #define KEYMAP_ALL( \
K76,K05,K06,K04,K0C,K03,K0B,K83,K0A,K01,K09,K78,K07, KFC,K7E,KFE, \ K76,K05,K06,K04,K0C,K03,K0B,K83,K0A,K01,K09,K78,K07, KFC,K7E,KFE, \

+ 3
- 20
converter/sun_usb/keymap.c View File



#include <stdint.h> #include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
#include <avr/pgmspace.h>
#include "keycode.h" #include "keycode.h"
#include "util.h" #include "util.h"
#include "keymap.h" #include "keymap.h"




// Assign Fn key(0-7) to a layer to which switch with the Fn key pressed. // Assign Fn key(0-7) to a layer to which switch with the Fn key pressed.
static const uint8_t PROGMEM fn_layer[] = {
const uint8_t PROGMEM fn_layer[] = {
2, // Fn0 2, // Fn0
3, // Fn1 3, // Fn1
4, // Fn2 4, // Fn2


// Assign Fn key(0-7) to a keycode sent when release Fn key without use of the layer. // Assign Fn key(0-7) to a keycode sent when release Fn key without use of the layer.
// See layer.c for details. // See layer.c for details.
static const uint8_t PROGMEM fn_keycode[] = {
const uint8_t PROGMEM fn_keycode[] = {
KC_NO, // Fn0 KC_NO, // Fn0
KC_SCLN, // Fn1 KC_SCLN, // Fn1
KC_SLSH, // Fn2 KC_SLSH, // Fn2
}; };




static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* /*
KEYMAP( KEYMAP(
HELP, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10,F11,F12, PSCR,SLCK,PAUS, MUTE,VOLD,VOLU,PWR, HELP, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10,F11,F12, PSCR,SLCK,PAUS, MUTE,VOLD,VOLU,PWR,
CAPS,LALT,LGUI, BTN1, RGUI,RALT,NO, LEFT,DOWN,RGHT CAPS,LALT,LGUI, BTN1, RGUI,RALT,NO, LEFT,DOWN,RGHT
), ),
}; };


uint8_t keymap_get_keycode(uint8_t layer, uint8_t row, uint8_t col)
{
return pgm_read_byte(&keymaps[(layer)][(row)][(col)]);
}

uint8_t keymap_fn_layer(uint8_t index)
{
return pgm_read_byte(&fn_layer[index]);
}

uint8_t keymap_fn_keycode(uint8_t index)
{
return pgm_read_byte(&fn_keycode[index]);
}

+ 0
- 17
converter/sun_usb/keymap_sun3.c View File



#include <stdint.h> #include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
#include <avr/pgmspace.h>
#include "keycode.h" #include "keycode.h"
#include "util.h" #include "util.h"
#include "keymap.h" #include "keymap.h"
), ),
*/ */
}; };


uint8_t keymap_get_keycode(uint8_t layer, uint8_t row, uint8_t col)
{
return pgm_read_byte(&keymaps[(layer)][(row)][(col)]);
}

uint8_t keymap_fn_layer(uint8_t index)
{
return pgm_read_byte(&fn_layer[index]);
}

uint8_t keymap_fn_keycode(uint8_t index)
{
return pgm_read_byte(&fn_keycode[index]);
}

+ 3
- 20
converter/terminal_usb/keymap.c View File



#include <stdint.h> #include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
#include <avr/pgmspace.h>
#include "keycode.h" #include "keycode.h"
#include "print.h" #include "print.h"
#include "debug.h" #include "debug.h"
} }


// Assign Fn key(0-7) to a layer to which switch with the Fn key pressed. // Assign Fn key(0-7) to a layer to which switch with the Fn key pressed.
static const uint8_t PROGMEM fn_layer[] = {
const uint8_t PROGMEM fn_layer[] = {
0, // Fn0 0, // Fn0
0, // Fn1 0, // Fn1
0, // Fn2 0, // Fn2


// Assign Fn key(0-7) to a keycode sent when release Fn key without use of the layer. // Assign Fn key(0-7) to a keycode sent when release Fn key without use of the layer.
// See layer.c for details. // See layer.c for details.
static const uint8_t PROGMEM fn_keycode[] = {
const uint8_t PROGMEM fn_keycode[] = {
KC_NO, // Fn0 KC_NO, // Fn0
KC_NO, // Fn1 KC_NO, // Fn1
KC_NO, // Fn2 KC_NO, // Fn2
}; };




static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* 0: default /* 0: default
* ,---. ,---------------. ,---------------. ,---------------. ,-----------. * ,---. ,---------------. ,---------------. ,---------------. ,-----------.
* |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| * |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau|
), ),
*/ */
}; };


uint8_t keymap_get_keycode(uint8_t layer, uint8_t row, uint8_t col)
{
return pgm_read_byte(&keymaps[(layer)][(row)][(col)]);
}

uint8_t keymap_fn_layer(uint8_t index)
{
return pgm_read_byte(&fn_layer[index]);
}

uint8_t keymap_fn_keycode(uint8_t index)
{
return pgm_read_byte(&fn_keycode[index]);
}

+ 1
- 3
converter/usb_usb/Makefile View File

#OPT_DEFS += -DNO_ACTION_LAYER #OPT_DEFS += -DNO_ACTION_LAYER
#OPT_DEFS += -DNO_ACTION_MACRO #OPT_DEFS += -DNO_ACTION_MACRO


SRC = \
keymap_common.c \
usb_usb.cpp \
SRC = usb_usb.cpp \
main.cpp main.cpp


ifdef KEYMAP ifdef KEYMAP

+ 0
- 31
converter/usb_usb/keymap_common.c View File

/*
Copyright 2014 Jun Wako <[email protected]>

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 "keymap_common.h"
#include "progmem.h"


/* translates key to keycode */
uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key)
{
return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]);
}

/* translates Fn keycode to action */
action_t keymap_fn_to_action(uint8_t keycode)
{
return (action_t){ .code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]) };
}

+ 0
- 4
converter/usb_usb/keymap_common.h View File

#include "keymap.h" #include "keymap.h"




extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS];
extern const action_t fn_actions[];


/* ,---------------. ,---------------. ,---------------. /* ,---------------. ,---------------. ,---------------.
* |F13|F14|F15|F16| |F17|F18|F19|F20| |F21|F22|F23|F24| * |F13|F14|F15|F16| |F17|F18|F19|F20| |F21|F22|F23|F24|
* ,---. |---------------| |---------------| |---------------| ,-----------. ,---------------. ,-------. * ,---. |---------------| |---------------| |---------------| ,-----------. ,---------------. ,-------.

+ 2
- 16
converter/x68k_usb/keymap.c View File



#include <stdint.h> #include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
#include <avr/pgmspace.h>
#include "keycode.h" #include "keycode.h"
#include "action.h" #include "action.h"
#include "util.h" #include "util.h"
} }




static const uint16_t fn_actions[] PROGMEM = {
const action_t fn_actions[] PROGMEM = {
[0] = ACTION_FUNCTION(0), // toggle all LEDs [0] = ACTION_FUNCTION(0), // toggle all LEDs
}; };


} }




static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* X68000 Keyboard Scan codes /* X68000 Keyboard Scan codes
,---. ,---. ,-------------------, ,-------------------. ,-----------. ,---------------. ,---. ,---. ,-------------------, ,-------------------. ,-----------. ,---------------.
| 61| | 62| | 63| 64| 65| 66| 67| | 68| 69| 6A| 6B| 6C| | 5A| 5B| 5C| | 5D| 52| 53| 54| | 61| | 62| | 63| 64| 65| 66| 67| | 68| 69| 6A| 6B| 6C| | 5A| 5B| 5C| | 5D| 52| 53| 54|
LGUI,LALT,MHEN, SPC, HENK,KANA,APP, ZKHK, F14, F15, P0, PCMM,PDOT LGUI,LALT,MHEN, SPC, HENK,KANA,APP, ZKHK, F14, F15, P0, PCMM,PDOT
), ),
}; };


/* translates key to keycode */
uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key)
{
return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]);
}

/* translates Fn keycode to action */
action_t keymap_fn_to_action(uint8_t keycode)
{
return (action_t){ .code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]) };
}

+ 1
- 2
converter/xt_usb/Makefile View File

TARGET_DIR = . TARGET_DIR = .


# project specific files # project specific files
SRC = keymap_common.c \
matrix.c \
SRC = matrix.c \
led.c led.c


ifdef KEYMAP ifdef KEYMAP

+ 0
- 31
converter/xt_usb/keymap_common.c View File

/*
Copyright 2011,2012,2013 Jun Wako <[email protected]>

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 "keymap_common.h"
#include "progmem.h"


/* translates key to keycode */
uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key)
{
return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]);
}

/* translates Fn keycode to action */
action_t keymap_fn_to_action(uint8_t keycode)
{
return (action_t){ .code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]) };
}

+ 0
- 4
converter/xt_usb/keymap_common.h View File

#include "keymap.h" #include "keymap.h"




// 32*8(256) byte array which converts PS/2 code into USB code
extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS];
extern const uint16_t fn_actions[];

/* All keys */ /* All keys */
#define KEYMAP_ALL( \ #define KEYMAP_ALL( \
K00, K02,K03,K04,K05,K06,K07,K08,K09,K0A,K0B,K0C,K0D, K0E,K0F,K0G, \ K00, K02,K03,K04,K05,K06,K07,K08,K09,K0A,K0B,K0C,K0D, K0E,K0F,K0G, \

+ 1
- 1
converter/xt_usb/keymap_jis.c View File

), ),
}; };


const uint16_t PROGMEM fn_actions[] = {
const action_t PROGMEM fn_actions[] = {
}; };

+ 1
- 1
converter/xt_usb/keymap_plain.c View File

), ),
}; };


const uint16_t PROGMEM fn_actions[] = {
const action_t PROGMEM fn_actions[] = {
}; };

+ 1
- 1
converter/xt_usb/keymap_spacefn.c View File

), ),
}; };


const uint16_t PROGMEM fn_actions[] = {
const action_t PROGMEM fn_actions[] = {
[0] = ACTION_LAYER_TAP_KEY(1, KC_SPACE), [0] = ACTION_LAYER_TAP_KEY(1, KC_SPACE),
[1] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV), // tilde [1] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV), // tilde
}; };

+ 0
- 1
keyboard/alps64/Makefile View File

KEYMAP_FILE = actionmap KEYMAP_FILE = actionmap
else else
KEYMAP_FILE = keymap KEYMAP_FILE = keymap
SRC := keymap_common.c $(SRC)
endif endif
ifdef KEYMAP ifdef KEYMAP
SRC := $(KEYMAP_FILE)_$(KEYMAP).c $(SRC) SRC := $(KEYMAP_FILE)_$(KEYMAP).c $(SRC)

+ 0
- 1
keyboard/alps64/actionmap_hasu.c View File

#include <avr/pgmspace.h>
#include "actionmap.h" #include "actionmap.h"
#include "action_code.h" #include "action_code.h"
#include "actionmap_common.h" #include "actionmap_common.h"

+ 0
- 1
keyboard/alps64/actionmap_plain.c View File

#include <avr/pgmspace.h>
#include "actionmap.h" #include "actionmap.h"
#include "action_code.h" #include "action_code.h"
#include "actionmap_common.h" #include "actionmap_common.h"

+ 0
- 30
keyboard/alps64/keymap_common.c View File

/*
Copyright 2012,2013 Jun Wako <[email protected]>

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 "keymap_common.h"


/* translates key to keycode */
uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key)
{
return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]);
}

/* translates Fn keycode to action */
action_t keymap_fn_to_action(uint8_t keycode)
{
return (action_t){ .code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]) };
}

+ 0
- 5
keyboard/alps64/keymap_common.h View File



#include <stdint.h> #include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
#include <avr/pgmspace.h>
#include "keycode.h" #include "keycode.h"
#include "action.h" #include "action.h"
#include "action_macro.h" #include "action_macro.h"
#include "keymap.h" #include "keymap.h"




extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS];
extern const action_t fn_actions[];


/* Alps64 keymap definition macro */ /* Alps64 keymap definition macro */
#define KEYMAP( \ #define KEYMAP( \
K36, K37, K46, K47, K56, K57, K66, K67, K76, K77, K06, K07, K17, K26, K27, \ K36, K37, K46, K47, K56, K57, K66, K67, K76, K77, K06, K07, K17, K26, K27, \

+ 1
- 2
keyboard/gh60/Makefile View File

TARGET_DIR = . TARGET_DIR = .


# project specific files # project specific files
SRC = keymap_common.c \
matrix.c \
SRC = matrix.c \
led.c led.c


ifdef KEYMAP ifdef KEYMAP

+ 0
- 30
keyboard/gh60/keymap_common.c View File

/*
Copyright 2012,2013 Jun Wako <[email protected]>

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 "keymap_common.h"


/* translates key to keycode */
uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key)
{
return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]);
}

/* translates Fn keycode to action */
action_t keymap_fn_to_action(uint8_t keycode)
{
return (action_t){ .code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]) };
}

+ 0
- 5
keyboard/gh60/keymap_common.h View File



#include <stdint.h> #include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
#include <avr/pgmspace.h>
#include "keycode.h" #include "keycode.h"
#include "action.h" #include "action.h"
#include "action_macro.h" #include "action_macro.h"
#include "keymap.h" #include "keymap.h"




extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS];
extern const action_t fn_actions[];


/* GH60 keymap definition macro /* GH60 keymap definition macro
* K2C, K31 and K3C are extra keys for ISO * K2C, K31 and K3C are extra keys for ISO
*/ */

+ 1
- 2
keyboard/hhkb/Makefile View File





# List C source files here. (C dependencies are automatically generated.) # List C source files here. (C dependencies are automatically generated.)
SRC += keymap_common.c \
matrix.c \
SRC += matrix.c \
led.c led.c


CONFIG_H = config.h CONFIG_H = config.h

+ 1
- 2
keyboard/hhkb/Makefile.pjrc View File

TARGET_DIR = . TARGET_DIR = .


# keyboard dependent files # keyboard dependent files
SRC = keymap_common.c \
matrix.c \
SRC = matrix.c \
led.c led.c


ifdef KEYMAP ifdef KEYMAP

+ 1
- 2
keyboard/hhkb/Makefile.rn42 View File





# List C source files here. (C dependencies are automatically generated.) # List C source files here. (C dependencies are automatically generated.)
SRC += keymap_common.c \
matrix.c \
SRC += matrix.c \
led.c led.c


CONFIG_H = config_rn42.h CONFIG_H = config_rn42.h

+ 0
- 33
keyboard/hhkb/keymap_common.c View File

/*
Copyright 2012,2013 Jun Wako <[email protected]>

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.h"
#include <avr/pgmspace.h>
#include "keymap_common.h"


/* translates key to keycode */
uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key)
{
return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]);
}

/* translates Fn keycode to action */
action_t keymap_fn_to_action(uint8_t keycode)
{
return (action_t){ .code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]) };
}

+ 0
- 4
keyboard/hhkb/keymap_common.h View File

#include "keymap.h" #include "keymap.h"




extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS];
extern const action_t fn_actions[];


#define KEYMAP( \ #define KEYMAP( \
K31, K30, K00, K10, K11, K20, K21, K40, K41, K60, K61, K70, K71, K50, K51, \ K31, K30, K00, K10, K11, K20, K21, K40, K41, K60, K61, K70, K71, K50, K51, \
K32, K01, K02, K13, K12, K23, K22, K42, K43, K62, K63, K73, K72, K52, \ K32, K01, K02, K13, K12, K23, K22, K42, K43, K62, K63, K73, K72, K52, \

+ 0
- 1
keyboard/infinity/Makefile View File



OBJECTS = \ OBJECTS = \
$(OBJDIR)/matrix.o \ $(OBJDIR)/matrix.o \
$(OBJDIR)/keymap_common.o \
$(OBJDIR)/led.o \ $(OBJDIR)/led.o \
$(OBJDIR)/main.o $(OBJDIR)/main.o



+ 0
- 30
keyboard/infinity/keymap_common.c View File

/*
Copyright 2012,2013 Jun Wako <[email protected]>

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 "keymap_common.h"


/* translates key to keycode */
uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key)
{
return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]);
}

/* translates Fn keycode to action */
action_t keymap_fn_to_action(uint8_t keycode)
{
return (action_t){ .code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]) };
}

+ 0
- 4
keyboard/infinity/keymap_common.h View File

#include "keymap.h" #include "keymap.h"




extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS];
extern const action_t fn_actions[];


#ifdef INFINITY_PROTOTYPE #ifdef INFINITY_PROTOTYPE


/* Infinity prototype */ /* Infinity prototype */

+ 0
- 1
keyboard/infinity_chibios/Makefile View File



# project specific files # project specific files
SRC = matrix.c \ SRC = matrix.c \
keymap_common.c \
led.c led.c


ifdef KEYMAP ifdef KEYMAP

+ 0
- 30
keyboard/infinity_chibios/keymap_common.c View File

/*
Copyright 2012,2013 Jun Wako <[email protected]>

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 "keymap_common.h"


/* translates key to keycode */
uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key)
{
return keymaps[(layer)][(key.row)][(key.col)];
}

/* translates Fn keycode to action */
action_t keymap_fn_to_action(uint8_t keycode)
{
return (action_t){ .code = fn_actions[FN_INDEX(keycode)] };
}

+ 0
- 4
keyboard/infinity_chibios/keymap_common.h View File

#include "keymap.h" #include "keymap.h"




extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS];
extern const action_t fn_actions[];


#ifdef INFINITY_PROTOTYPE #ifdef INFINITY_PROTOTYPE


/* Infinity prototype */ /* Infinity prototype */

+ 0
- 29
keyboard/onekey/keymap.c View File

*/ */
#include <stdint.h> #include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
#include <avr/pgmspace.h>
#include "keycode.h" #include "keycode.h"
#include "action.h" #include "action.h"
#include "action_macro.h" #include "action_macro.h"
*/ */
static const action_t PROGMEM fn_actions[] = { static const action_t PROGMEM fn_actions[] = {
}; };



#define KEYMAPS_SIZE (sizeof(keymaps) / sizeof(keymaps[0]))
#define FN_ACTIONS_SIZE (sizeof(fn_actions) / sizeof(fn_actions[0]))

/* translates key to keycode */
uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key)
{
if (layer < KEYMAPS_SIZE) {
return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]);
} else {
// fall back to layer 0
return pgm_read_byte(&keymaps[0][(key.row)][(key.col)]);
}
}

/* translates Fn keycode to action */
action_t keymap_fn_to_action(uint8_t keycode)
{
action_t action;
if (FN_INDEX(keycode) < FN_ACTIONS_SIZE) {
action.code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]);
} else {
action = (action_t)ACTION_NO;
}
return action;
}

+ 1
- 1
keyboard/stm32_f103_onekey/keymap_plain.c View File

/* translates Fn keycode to action */ /* translates Fn keycode to action */
action_t keymap_fn_to_action(uint8_t keycode) action_t keymap_fn_to_action(uint8_t keycode)
{ {
return (action_t){ .code = fn_actions[FN_INDEX(keycode)] };
return fn_actions[FN_INDEX(keycode)];
} }

+ 1
- 1
keyboard/teensy_lc_onekey/keymap_plain.c View File

/* translates Fn keycode to action */ /* translates Fn keycode to action */
action_t keymap_fn_to_action(uint8_t keycode) action_t keymap_fn_to_action(uint8_t keycode)
{ {
return (action_t){ .code = fn_actions[FN_INDEX(keycode)] };
return fn_actions[FN_INDEX(keycode)];
} }

Loading…
Cancel
Save