diff options
author | tmk <nobody@nowhere> | 2012-10-18 01:11:06 +0900 |
---|---|---|
committer | tmk <nobody@nowhere> | 2012-10-18 01:11:06 +0900 |
commit | 3c822b511e7af60332a7e5a938c08bafb2516ba3 (patch) | |
tree | 0a78cce225b04930de14935dffd36ce8f3bf2d76 /keyboard | |
parent | 93e33fb8f694c9685accd72ed0458a2cf3d3f04a (diff) | |
parent | fffc375b45ad795c4a8d3cde94783dac195a2613 (diff) | |
download | firmware-3c822b511e7af60332a7e5a938c08bafb2516ba3.tar.gz firmware-3c822b511e7af60332a7e5a938c08bafb2516ba3.tar.bz2 firmware-3c822b511e7af60332a7e5a938c08bafb2516ba3.zip |
Merge branch 'layerfix'
Diffstat (limited to 'keyboard')
-rw-r--r-- | keyboard/IIgs_Standard/README | 2 | ||||
-rw-r--r-- | keyboard/IIgs_Standard/config.h | 4 | ||||
-rw-r--r-- | keyboard/IIgs_Standard/keymap.c | 46 | ||||
-rw-r--r-- | keyboard/hbkb/config.h | 4 | ||||
-rw-r--r-- | keyboard/hbkb/keymap.c | 42 | ||||
-rw-r--r-- | keyboard/hhkb/Makefile.iwrap | 11 | ||||
-rw-r--r-- | keyboard/hhkb/config.h | 6 | ||||
-rw-r--r-- | keyboard/hhkb/config_iwrap.h | 2 | ||||
-rw-r--r-- | keyboard/hhkb/config_vusb.h | 4 | ||||
-rw-r--r-- | keyboard/hhkb/keymap.c | 73 | ||||
-rw-r--r-- | keyboard/hhkb/matrix.c | 52 | ||||
-rw-r--r-- | keyboard/macway/config.h | 4 | ||||
-rw-r--r-- | keyboard/macway/keymap.c | 36 |
13 files changed, 123 insertions, 163 deletions
diff --git a/keyboard/IIgs_Standard/README b/keyboard/IIgs_Standard/README index 48d9470f6..4f9cad1ca 100644 --- a/keyboard/IIgs_Standard/README +++ b/keyboard/IIgs_Standard/README @@ -39,7 +39,7 @@ To Do 0. When DEBOUNCE defined, there is a errors.
1. Layer Change by toggling Clear Key
2. Eject Key add. (following files should be modified.)
- common/usb_keycodes.h
+ common/keycode.h
common/keyboard.c
3. Use bluetooth
EOF
diff --git a/keyboard/IIgs_Standard/config.h b/keyboard/IIgs_Standard/config.h index 38ac21df6..11acf87c0 100644 --- a/keyboard/IIgs_Standard/config.h +++ b/keyboard/IIgs_Standard/config.h @@ -49,8 +49,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. /* key combination for command */
#define IS_COMMAND() ( \
- keyboard_report->mods == (MOD_BIT(KB_LSHIFT) | MOD_BIT(KB_LCTRL) | MOD_BIT(KB_LALT) | MOD_BIT(KB_LGUI)) || \
- keyboard_report->mods == (MOD_BIT(KB_LSHIFT) | MOD_BIT(KB_RSHIFT)) \
+ keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_LCTRL) | MOD_BIT(KC_LALT) | MOD_BIT(KC_LGUI)) || \
+ keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
)
diff --git a/keyboard/IIgs_Standard/keymap.c b/keyboard/IIgs_Standard/keymap.c index 77f3cd4d3..722c44af4 100644 --- a/keyboard/IIgs_Standard/keymap.c +++ b/keyboard/IIgs_Standard/keymap.c @@ -21,7 +21,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include <stdint.h>
#include <stdbool.h>
#include <avr/pgmspace.h>
-#include "usb_keycodes.h"
+#include "keycode.h"
#include "print.h"
#include "debug.h"
#include "util.h"
@@ -45,9 +45,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. { R5C0, R5C1, R5C2, R5C3, R5C4, R5C5, R5C6, R5C7 }, \
{ R6C0, R6C1, R6C2, R6C3, R6C4, R6C5, R6C6, R6C7 }, \
{ R7C0, R7C1, R7C2, R7C3, R7C4, R7C5, R7C6, R7C7 }, \
- { R8C0, R8C1, KB_NO, KB_NO, KB_NO,KB_NO, KB_NO, KB_NO }, \
+ { R8C0, R8C1, KC_NO, KC_NO, KC_NO,KC_NO, KC_NO, KC_NO }, \
{ R9C0, R9C1, R9C2, R9C3, R9C4, R9C5, R9C6, R9C7 }, \
- { R10C0,R10C1, R10C2, R10C3, R10C4,R10C5, KB_NO, KB_NO} \
+ { R10C0,R10C1, R10C2, R10C3, R10C4,R10C5, KC_NO, KC_NO} \
}
#define KEYCODE(layer, row, col) (pgm_read_byte(&keymaps[(layer)][(row)][(col)]))
@@ -68,14 +68,14 @@ static const uint8_t PROGMEM fn_layer[] = { // Assign Fn key(0-7) to a keycode sent when release Fn key without use of the layer.
// See layer.c for details.
static const uint8_t PROGMEM fn_keycode[] = {
- KB_NO, // Fn0
- KB_NO, // Fn1
- KB_SLSH, // Fn2
- KB_SCLN, // Fn3
- KB_SPC, // Fn4
- KB_NO, // Fn5
- KB_NO, // Fn6
- KB_NO // Fn7
+ KC_NO, // Fn0
+ KC_NO, // Fn1
+ KC_SLSH, // Fn2
+ KC_SCLN, // Fn3
+ KC_SPC, // Fn4
+ KC_NO, // Fn5
+ KC_NO, // Fn6
+ KC_NO // Fn7
};
static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
@@ -94,12 +94,12 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |CAPS|Alt |Gui |` |SPC |BSLS |LFT|RGT|DN|UP| | 0 | . | T |
* `-----------------------------------------------------------' |---------------'
*/
- KEYMAP( KB_PWR,
- KB_ESC, KB_1, KB_2, KB_3, KB_4, KB_5, KB_6, KB_7, KB_8, KB_9, KB_0, KB_MINS,KB_EQL, KB_BSPC, KB_FN1, KB_PEQL, KB_PSLS, KB_PAST, \
- KB_TAB, KB_Q, KB_W, KB_E, KB_R, KB_T, KB_Y, KB_U, KB_I, KB_O, KB_P, KB_LBRC,KB_RBRC, KB_P7, KB_P8, KB_P9, KB_PPLS, \
- KB_LCTL,KB_A, KB_S, KB_D, KB_F, KB_G, KB_H, KB_J, KB_K, KB_L, KB_SCLN, KB_QUOT,KB_ENT, KB_P4, KB_P5, KB_P6, KB_PMNS, \
- KB_LSFT,KB_Z, KB_X, KB_C, KB_V, KB_B, KB_N, KB_M, KB_COMM,KB_DOT, KB_SLSH, KB_P1, KB_P2, KB_P3, \
- KB_CAPS,KB_LALT,KB_LGUI,KB_GRV, KB_SPC, KB_BSLS,KB_LEFT,KB_RGHT,KB_DOWN,KB_UP, KB_P0, KB_PDOT, KB_PENT),
+ KEYMAP( KC_PWR,
+ KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,KC_EQL, KC_BSPC, KC_FN1, KC_PEQL, KC_PSLS, KC_PAST, \
+ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,KC_RBRC, KC_P7, KC_P8, KC_P9, KC_PPLS, \
+ KC_LCTL,KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,KC_ENT, KC_P4, KC_P5, KC_P6, KC_PMNS, \
+ KC_LSFT,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_P1, KC_P2, KC_P3, \
+ KC_CAPS,KC_LALT,KC_LGUI,KC_GRV, KC_SPC, KC_BSLS,KC_LEFT,KC_RGHT,KC_DOWN,KC_UP, KC_P0, KC_PDOT, KC_PENT),
/* Layer 1: Tenkey use Layer
@@ -117,12 +117,12 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |CAPS|Alt |Gui |` |SPC |BSLS |LFT|RGT|DN|UP| | 0 | . | T |
* `-----------------------------------------------------------' `---------------'
*/
- KEYMAP( KB_PWR, \
- KB_ESC, KB_1, KB_2, KB_3, KB_4, KB_5, KB_6, KB_7, KB_8, KB_9, KB_0, KB_MINS,KB_EQL, KB_BSPC, KB_FN1, KB_PEQL, KB_PSLS, KB_MUTE, \
- KB_TAB, KB_Q, KB_W, KB_E, KB_R, KB_T, KB_Y, KB_U, KB_I, KB_O, KB_P, KB_LBRC,KB_RBRC, KB_INS, KB_P8, KB_PGUP, KB_VOLU, \
- KB_LCTL,KB_A, KB_S, KB_D, KB_F, KB_G, KB_H, KB_J, KB_K, KB_L, KB_SCLN, KB_QUOT,KB_ENT, KB_DEL, KB_UP, KB_PGDN, KB_VOLD, \
- KB_LSFT,KB_Z, KB_X, KB_C, KB_V, KB_B, KB_N, KB_M, KB_COMM,KB_DOT, KB_SLSH, KB_LEFT, KB_DOWN, KB_RIGHT, \
- KB_CAPS,KB_LALT,KB_LGUI,KB_GRV, KB_SPC, KB_BSLS,KB_LEFT,KB_RGHT,KB_DOWN,KB_UP, KB_P0, KB_PDOT, KB_PENT),
+ KEYMAP( KC_PWR, \
+ KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,KC_EQL, KC_BSPC, KC_FN1, KC_PEQL, KC_PSLS, KC_MUTE, \
+ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,KC_RBRC, KC_INS, KC_P8, KC_PGUP, KC_VOLU, \
+ KC_LCTL,KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,KC_ENT, KC_DEL, KC_UP, KC_PGDN, KC_VOLD, \
+ KC_LSFT,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_LEFT, KC_DOWN, KC_RIGHT, \
+ KC_CAPS,KC_LALT,KC_LGUI,KC_GRV, KC_SPC, KC_BSLS,KC_LEFT,KC_RGHT,KC_DOWN,KC_UP, KC_P0, KC_PDOT, KC_PENT),
};
diff --git a/keyboard/hbkb/config.h b/keyboard/hbkb/config.h index deaabb249..57adecfa5 100644 --- a/keyboard/hbkb/config.h +++ b/keyboard/hbkb/config.h @@ -42,8 +42,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. /* key combination for command */ #define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KB_LSHIFT) | MOD_BIT(KB_LCTRL) | MOD_BIT(KB_LALT) | MOD_BIT(KB_LGUI)) || \ - keyboard_report->mods == (MOD_BIT(KB_LALT) | MOD_BIT(KB_RALT)) \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_LCTRL) | MOD_BIT(KC_LALT) | MOD_BIT(KC_LGUI)) || \ + keyboard_report->mods == (MOD_BIT(KC_LALT) | MOD_BIT(KC_RALT)) \ ) diff --git a/keyboard/hbkb/keymap.c b/keyboard/hbkb/keymap.c index 1de317c9a..435cf1e95 100644 --- a/keyboard/hbkb/keymap.c +++ b/keyboard/hbkb/keymap.c @@ -21,7 +21,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include <stdint.h> #include <stdbool.h> #include <avr/pgmspace.h> -#include "usb_keycodes.h" +#include "keycode.h" #include "print.h" #include "debug.h" #include "util.h" @@ -68,18 +68,18 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. K11, K26, K36, K46, K56, K57, K77, K76, K86, K96, KA7, K16, \ K02, KB0, K67, KB7, K06 \ ) { \ - { KB_NO, KB_NO, KB_##K02, KB_NO, KB_NO, KB_NO, KB_##K06, KB_NO }, \ - { KB_NO, KB_##K11, KB_NO, KB_NO, KB_NO, KB_NO, KB_##K16, KB_NO }, \ - { KB_NO, KB_##K21, KB_##K22, KB_##K23, KB_##K24, KB_##K25, KB_##K26, KB_NO }, \ - { KB_NO, KB_##K31, KB_NO, KB_##K33, KB_##K34, KB_##K35, KB_##K36, KB_NO }, \ - { KB_NO, KB_NO, KB_NO, KB_##K43, KB_##K44, KB_##K45, KB_##K46, KB_NO }, \ - { KB_##K50, KB_##K51, KB_##K52, KB_##K53, KB_##K54, KB_##K55, KB_##K56, KB_##K57 }, \ - { KB_NO, KB_##K61, KB_NO, KB_NO, KB_##K64, KB_##K65, KB_##K66, KB_##K67 }, \ - { KB_##K70, KB_##K71, KB_##K72, KB_##K73, KB_##K74, KB_##K75, KB_##K76, KB_##K77 }, \ - { KB_NO, KB_##K81, KB_##K82, KB_##K83, KB_##K84, KB_##K85, KB_##K86, KB_NO }, \ - { KB_NO, KB_NO, KB_NO, KB_##K93, KB_##K94, KB_##K95, KB_##K96, KB_NO }, \ - { KB_##KA0, KB_##KA1, KB_##KA2, KB_##KA3, KB_##KA4, KB_##KA5, KB_NO, KB_##KA7 }, \ - { KB_##KB0, KB_NO, KB_NO, KB_NO, KB_NO, KB_NO, KB_NO, KB_##KB7 }, \ + { KC_NO, KC_NO, KC_##K02, KC_NO, KC_NO, KC_NO, KC_##K06, KC_NO }, \ + { KC_NO, KC_##K11, KC_NO, KC_NO, KC_NO, KC_NO, KC_##K16, KC_NO }, \ + { KC_NO, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_NO }, \ + { KC_NO, KC_##K31, KC_NO, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_NO }, \ + { KC_NO, KC_NO, KC_NO, KC_##K43, KC_##K44, KC_##K45, KC_##K46, KC_NO }, \ + { KC_##K50, KC_##K51, KC_##K52, KC_##K53, KC_##K54, KC_##K55, KC_##K56, KC_##K57 }, \ + { KC_NO, KC_##K61, KC_NO, KC_NO, KC_##K64, KC_##K65, KC_##K66, KC_##K67 }, \ + { KC_##K70, KC_##K71, KC_##K72, KC_##K73, KC_##K74, KC_##K75, KC_##K76, KC_##K77 }, \ + { KC_NO, KC_##K81, KC_##K82, KC_##K83, KC_##K84, KC_##K85, KC_##K86, KC_NO }, \ + { KC_NO, KC_NO, KC_NO, KC_##K93, KC_##K94, KC_##K95, KC_##K96, KC_NO }, \ + { KC_##KA0, KC_##KA1, KC_##KA2, KC_##KA3, KC_##KA4, KC_##KA5, KC_NO, KC_##KA7 }, \ + { KC_##KB0, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_##KB7 }, \ } #define KEYCODE(layer, row, col) (pgm_read_byte(&keymaps[(layer)][(row)][(col)])) @@ -100,14 +100,14 @@ static const uint8_t PROGMEM fn_layer[] = { // Assign Fn key(0-7) to a keycode sent when release Fn key without use of the layer. // See layer.c for details. static const uint8_t PROGMEM fn_keycode[] = { - KB_NO, // Fn0 - KB_NO, // Fn1 - KB_SLSH, // Fn2 - KB_SCLN, // Fn3 - KB_SPC, // Fn4 - KB_NO, // Fn5 - KB_NO, // Fn6 - KB_NO // Fn7 + KC_NO, // Fn0 + KC_NO, // Fn1 + KC_SLSH, // Fn2 + KC_SCLN, // Fn3 + KC_SPC, // Fn4 + KC_NO, // Fn5 + KC_NO, // Fn6 + KC_NO // Fn7 }; static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/keyboard/hhkb/Makefile.iwrap b/keyboard/hhkb/Makefile.iwrap index ef7ad2eac..f87df0d2b 100644 --- a/keyboard/hhkb/Makefile.iwrap +++ b/keyboard/hhkb/Makefile.iwrap @@ -13,7 +13,7 @@ TOP_DIR = ../.. TARGET_DIR = . # keyboard dependent files -SRC = main.c \ +SRC = \ keymap.c \ matrix.c \ led.c @@ -28,9 +28,9 @@ OPT_DEFS = -DDEBUG_LEVEL=0 # MCU name, you MUST set this to match the board you are using # type "make clean" after changing this, so all files will be rebuilt -MCU = atmega168p +MCU = atmega328p # avrdude doesn't know atmega168p -AVRDUDE_MCU = atmega168 +AVRDUDE_MCU = $(MCU) # Processor frequency. @@ -84,10 +84,11 @@ PROGRAM_CMD = $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE # Search Path VPATH = $(TARGET_DIR) +VPATH += $(TOP_DIR) -include $(TOP_DIR)/protocol/iwrap.mk +#include $(TOP_DIR)/protocol/iwrap.mk # To be swatchable btween Bluetooth and USB. Comment out if you don't need USB. include $(TOP_DIR)/protocol/vusb.mk -include $(TOP_DIR)/protocol.mk +#include $(TOP_DIR)/protocol.mk include $(TOP_DIR)/common.mk include $(TOP_DIR)/rules.mk diff --git a/keyboard/hhkb/config.h b/keyboard/hhkb/config.h index bf946ac01..cca75f243 100644 --- a/keyboard/hhkb/config.h +++ b/keyboard/hhkb/config.h @@ -35,16 +35,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. /* matrix size */ #define MATRIX_ROWS 8 #define MATRIX_COLS 8 -/* define if matrix has ghost */ -//#define MATRIX_HAS_GHOST /* key combination for command */ -#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KB_LSHIFT) | MOD_BIT(KB_RSHIFT))) +#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) /* mouse keys */ #ifdef MOUSEKEY_ENABLE -# define MOUSEKEY_DELAY_TIME 192 +# define MOUSEKEY_DELAY_TIME 100 #endif diff --git a/keyboard/hhkb/config_iwrap.h b/keyboard/hhkb/config_iwrap.h index 80ab64398..734d66977 100644 --- a/keyboard/hhkb/config_iwrap.h +++ b/keyboard/hhkb/config_iwrap.h @@ -33,7 +33,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. /* key combination for command */ -#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KB_LSHIFT) | MOD_BIT(KB_RSHIFT))) +#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) /* mouse keys */ #ifdef MOUSEKEY_ENABLE diff --git a/keyboard/hhkb/config_vusb.h b/keyboard/hhkb/config_vusb.h index 268644849..44d5e4557 100644 --- a/keyboard/hhkb/config_vusb.h +++ b/keyboard/hhkb/config_vusb.h @@ -33,11 +33,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. /* key combination for command */ -#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KB_LSHIFT) | MOD_BIT(KB_RSHIFT))) +#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) /* mouse keys */ #ifdef MOUSEKEY_ENABLE -# define MOUSEKEY_DELAY_TIME 255 +# define MOUSEKEY_DELAY_TIME 100 #endif diff --git a/keyboard/hhkb/keymap.c b/keyboard/hhkb/keymap.c index f05962aed..5dc5582ec 100644 --- a/keyboard/hhkb/keymap.c +++ b/keyboard/hhkb/keymap.c @@ -22,7 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include <stdbool.h> #include <avr/pgmspace.h> #include "host.h" -#include "usb_keycodes.h" +#include "keycode.h" #include "print.h" #include "debug.h" #include "util.h" @@ -39,14 +39,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. K35, K36, K37, K57, K56 \ ) \ { \ - { KB_##K00, KB_##K01, KB_##K02, KB_##K03, KB_##K04, KB_##K05, KB_##K06, KB_##K07 }, \ - { KB_##K10, KB_##K11, KB_##K12, KB_##K13, KB_##K14, KB_##K15, KB_##K16, KB_##K17 }, \ - { KB_##K20, KB_##K21, KB_##K22, KB_##K23, KB_##K24, KB_##K25, KB_##K26, KB_NO }, \ - { KB_##K30, KB_##K31, KB_##K32, KB_##K33, KB_##K34, KB_##K35, KB_##K36, KB_##K37 }, \ - { KB_##K40, KB_##K41, KB_##K42, KB_##K43, KB_##K44, KB_##K45, KB_##K46, KB_NO }, \ - { KB_##K50, KB_##K51, KB_##K52, KB_##K53, KB_##K54, KB_##K55, KB_##K56, KB_##K57 }, \ - { KB_##K60, KB_##K61, KB_##K62, KB_##K63, KB_##K64, KB_##K65, KB_##K66, KB_NO }, \ - { KB_##K70, KB_##K71, KB_##K72, KB_##K73, KB_##K74, KB_##K75, KB_##K76, KB_NO } \ + { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07 }, \ + { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17 }, \ + { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_NO }, \ + { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37 }, \ + { KC_##K40, KC_##K41, KC_##K42, KC_##K43, KC_##K44, KC_##K45, KC_##K46, KC_NO }, \ + { KC_##K50, KC_##K51, KC_##K52, KC_##K53, KC_##K54, KC_##K55, KC_##K56, KC_##K57 }, \ + { KC_##K60, KC_##K61, KC_##K62, KC_##K63, KC_##K64, KC_##K65, KC_##K66, KC_NO }, \ + { KC_##K70, KC_##K71, KC_##K72, KC_##K73, KC_##K74, KC_##K75, KC_##K76, KC_NO } \ } #define KEYCODE(layer, row, col) (pgm_read_byte(&keymaps[(layer)][(row)][(col)])) @@ -59,7 +59,7 @@ static const uint8_t PROGMEM fn_layer[] = { 2, // Fn2 3, // Fn3 3, // Fn4 - 4, // Fn5 + 5, // Fn5 0, // Fn6 0 // Fn7 }; @@ -67,14 +67,14 @@ static const uint8_t PROGMEM fn_layer[] = { // Assign Fn key(0-7) to a keycode sent when release Fn key without use of the layer. // See layer.c for details. static const uint8_t PROGMEM fn_keycode[] = { - KB_NO, // Fn0 - KB_NO, // Fn1 - KB_SLSH, // Fn2 - KB_SCLN, // Fn3 - KB_NO, // Fn4 - KB_SPC, // Fn5 - KB_NO, // Fn6 - KB_NO // Fn7 + KC_NO, // Fn0 + KC_NO, // Fn1 + KC_SLSH, // Fn2 + KC_SCLN, // Fn3 + KC_NO, // Fn4 + KC_SPC, // Fn5 + KC_NO, // Fn6 + KC_NO // Fn7 }; static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -95,7 +95,7 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSPC, \ LCTL,A, S, D, F, G, H, J, K, L, FN3, QUOT,ENT, \ LSFT,Z, X, C, V, B, N, M, COMM,DOT, FN2, RSFT,FN1, \ - LGUI,LALT, SPC, RALT,FN4), + LGUI,LALT, FN5, RALT,FN4), /* Layer 1: HHKB mode (HHKB Fn) * ,-----------------------------------------------------------. @@ -151,10 +151,10 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ #ifdef HOST_IWRAP // iWRAP does not support mouse wheel, use these keycodes to remap as wheel -#define KB_KPPL KB_KP_PLUS -#define KB_KPMI KB_KP_MINUS -#define KB_KPAS KB_KP_ASTERISK -#define KB_KPSL KB_KP_SLASH +#define KC_KPPL KC_KP_PLUS +#define KC_KPMI KC_KP_MINUS +#define KC_KPAS KC_KP_ASTERISK +#define KC_KPSL KC_KP_SLASH KEYMAP(ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL, \ TAB, KPAS,KPPL,MS_U,KPMI,KPSL,KPAS,KPPL,KPMI,KPSL,NO, NO, NO, BSPC, \ LCTL,NO, MS_L,MS_D,MS_R,NO, MS_L,MS_D,MS_U,MS_R,FN3, NO, ENT, \ @@ -162,9 +162,9 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { LGUI,LALT, BTN1, RALT,FN4), #else KEYMAP(ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL, \ - TAB, WH_L,WH_U,MS_U,WH_D,WH_R,WH_L,WH_D,WH_U,WH_R,NO, NO, NO, BSPC, \ - LCTL,NO, MS_L,MS_D,MS_R,NO, MS_L,MS_D,MS_U,MS_R,FN3, NO, ENT, \ - LSFT,BTN4,BTN5,BTN1,BTN2,BTN3,BTN2,BTN1,BTN4,BTN5,NO, RSFT,NO, \ + TAB, NO, NO, NO, NO, NO, WH_L,WH_D,WH_U,WH_R,NO, NO, NO, BSPC, \ + LCTL,NO, ACL0,ACL1,ACL2,NO, MS_L,MS_D,MS_U,MS_R,FN3, NO, ENT, \ + LSFT,NO, NO, NO, NO, BTN3,BTN2,BTN1,BTN4,BTN5,NO, RSFT,NO, \ LGUI,LALT, BTN1, RALT,FN4), #endif @@ -181,14 +181,13 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |Gui |Alt |xxxxxxxxxxxxxxxxxxxxxxx|Alt |Gui| * `--------------------------------------------' */ -/* KEYMAP(MINS,0, 9, 8, 7, 6, 5, 4, 3, 2, 1, NO, NO, NO, ESC, \ BSPC,P, O, I, U, Y, T, R, E, W, Q, NO, NO, TAB, \ LCTL,SCLN,L, K, J, H, G, F, D, S, A, RCTL,RCTL, \ LSFT,SLSH,DOT, COMM,M, N, B, V, C, X, Z, RSFT,NO, \ - LGUI,LALT, FN5, RALT,RGUI) -*/ - /* Mouse mode (Space) */ + LGUI,LALT, FN5, RALT,RGUI), + + /* Layer5: another Mouse mode (Space) */ #ifdef HOST_IWRAP KEYMAP(ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL, \ TAB, KPAS,KPPL,MS_U,KPMI,KPSL,KPAS,KPPL,KPMI,KPSL,NO, NO, NO, BSPC, \ @@ -197,9 +196,9 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { LGUI,LALT, FN5, RALT,RGUI), #else KEYMAP(ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL, \ - TAB, WH_L,WH_U,MS_U,WH_D,WH_R,WH_L,WH_D,WH_U,WH_R,NO, NO, NO, BSPC, \ - LCTL,NO, MS_L,MS_D,MS_R,NO, MS_L,MS_D,MS_U,MS_R,FN3, NO, ENT, \ - LSFT,BTN4,BTN5,BTN1,BTN2,BTN3,BTN2,BTN1,BTN4,BTN5,NO, RSFT,NO, \ + TAB, NO, NO, NO, NO, NO, WH_L,WH_D,WH_U,WH_R,NO, NO, NO, BSPC, \ + LCTL,NO, ACL0,ACL1,ACL2,NO, MS_L,MS_D,MS_U,MS_R,FN3, NO, ENT, \ + LSFT,NO, NO, NO, NO, BTN3,BTN2,BTN1,BTN4,BTN5,NO, RSFT,NO, \ LGUI,LALT, FN5, RALT,RGUI), #endif }; @@ -210,12 +209,12 @@ uint8_t keymap_get_keycode(uint8_t layer, uint8_t row, uint8_t col) return KEYCODE(layer, row, col); } -uint8_t keymap_fn_layer(uint8_t fn_bits) +uint8_t keymap_fn_layer(uint8_t index) { - return pgm_read_byte(&fn_layer[biton(fn_bits)]); + return pgm_read_byte(&fn_layer[index]); } -uint8_t keymap_fn_keycode(uint8_t fn_bits) +uint8_t keymap_fn_keycode(uint8_t index) { - return pgm_read_byte(&fn_keycode[(biton(fn_bits))]); + return pgm_read_byte(&fn_keycode[index]); } diff --git a/keyboard/hhkb/matrix.c b/keyboard/hhkb/matrix.c index 79d2d9873..fd0d6f97f 100644 --- a/keyboard/hhkb/matrix.c +++ b/keyboard/hhkb/matrix.c @@ -43,22 +43,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. // matrix state buffer(1:on, 0:off) -#if (MATRIX_COLS <= 8) -static uint8_t *matrix; -static uint8_t *matrix_prev; -static uint8_t _matrix0[MATRIX_ROWS]; -static uint8_t _matrix1[MATRIX_ROWS]; -#else -static uint16_t *matrix; -static uint16_t *matrix_prev; -static uint16_t _matrix0[MATRIX_ROWS]; -static uint16_t _matrix1[MATRIX_ROWS]; -#endif - -// HHKB has no ghost and no bounce. -#ifdef MATRIX_HAS_GHOST -static bool matrix_has_ghost_in_row(uint8_t row); -#endif +static matrix_row_t *matrix; +static matrix_row_t *matrix_prev; +static matrix_row_t _matrix0[MATRIX_ROWS]; +static matrix_row_t _matrix1[MATRIX_ROWS]; // Matrix I/O ports @@ -119,7 +107,7 @@ static bool matrix_has_ghost_in_row(uint8_t row); #define KEY_POWER_ON() do { \ KEY_INIT(); \ PORTB &= ~(1<<5); \ - _delay_us(200); \ + _delay_ms(1); \ } while (0) #define KEY_POWER_OFF() do { \ DDRB &= ~0x3F; \ @@ -192,6 +180,8 @@ uint8_t matrix_scan(void) } // Ignore if this code region execution time elapses more than 20us. + // MEMO: 20[us] * (TIMER_RAW_FREQ / 1000000)[count per us] + // MEMO: then change above using this rule: a/(b/c) = a*1/(b/c) = a*(c/b) if (TIMER_DIFF_RAW(TIMER_RAW, last) > 20/(1000000/TIMER_RAW_FREQ)) { matrix[row] = matrix_prev[row]; } @@ -219,12 +209,6 @@ bool matrix_is_modified(void) inline bool matrix_has_ghost(void) { -#ifdef MATRIX_HAS_GHOST - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - if (matrix_has_ghost_in_row(i)) - return true; - } -#endif return false; } @@ -258,11 +242,6 @@ void matrix_print(void) #else pbin_reverse16(matrix_get_row(row)); #endif -#ifdef MATRIX_HAS_GHOST - if (matrix_has_ghost_in_row(row)) { - print(" <ghost"); - } -#endif print("\n"); } } @@ -279,20 +258,3 @@ uint8_t matrix_key_count(void) } return count; } - -#ifdef MATRIX_HAS_GHOST -inline -static bool matrix_has_ghost_in_row(uint8_t row) -{ - // no ghost exists in case less than 2 keys on - if (((matrix[row] - 1) & matrix[row]) == 0) - return false; - - // ghost exists in case same state as other row - for (uint8_t i=0; i < MATRIX_ROWS; i++) { - if (i != row && (matrix[i] & matrix[row]) == matrix[row]) - return true; - } - return false; -} -#endif diff --git a/keyboard/macway/config.h b/keyboard/macway/config.h index 5503c77e3..6ab0dec92 100644 --- a/keyboard/macway/config.h +++ b/keyboard/macway/config.h @@ -45,8 +45,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. /* key combination for command */ #define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KB_LSHIFT) | MOD_BIT(KB_LCTRL) | MOD_BIT(KB_LALT) | MOD_BIT(KB_LGUI)) || \ - keyboard_report->mods == (MOD_BIT(KB_LSHIFT) | MOD_BIT(KB_RSHIFT)) \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_LCTRL) | MOD_BIT(KC_LALT) | MOD_BIT(KC_LGUI)) || \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ ) diff --git a/keyboard/macway/keymap.c b/keyboard/macway/keymap.c index 6d5ad62e9..aa50ba5c8 100644 --- a/keyboard/macway/keymap.c +++ b/keyboard/macway/keymap.c @@ -21,7 +21,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include <stdint.h> #include <stdbool.h> #include <avr/pgmspace.h> -#include "usb_keycodes.h" +#include "keycode.h" #include "print.h" #include "debug.h" #include "util.h" @@ -37,15 +37,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. K67, K16, K26, K36, K46, K47, K57, K56, K66, K76, K87, K32, K35, \ K75, K22, K00, K07, K21, K04, K37, K27, K17 \ ) { \ - { KB_##K00, KB_##K01, KB_##K02, KB_NO, KB_##K04, KB_NO, KB_##K06, KB_##K07 }, \ - { KB_##K10, KB_##K11, KB_##K12, KB_##K13, KB_##K14, KB_##K15, KB_##K16, KB_##K17 }, \ - { KB_##K20, KB_##K21, KB_##K22, KB_##K23, KB_##K24, KB_NO, KB_##K26, KB_##K27 }, \ - { KB_##K30, KB_NO, KB_##K32, KB_##K33, KB_##K34, KB_##K35, KB_##K36, KB_##K37 }, \ - { KB_##K40, KB_##K41, KB_##K42, KB_##K43, KB_##K44, KB_##K45, KB_##K46, KB_##K47 }, \ - { KB_##K50, KB_##K51, KB_##K52, KB_##K53, KB_##K54, KB_##K55, KB_##K56, KB_##K57 }, \ - { KB_##K60, KB_##K61, KB_##K62, KB_##K63, KB_##K64, KB_NO, KB_##K66, KB_##K67 }, \ - { KB_##K70, KB_NO, KB_NO, KB_##K73, KB_##K74, KB_##K75, KB_##K76, KB_NO }, \ - { KB_##K80, KB_##K81, KB_##K82, KB_##K83, KB_##K84, KB_##K85, KB_NO, KB_##K87 } \ + { KC_##K00, KC_##K01, KC_##K02, KC_NO, KC_##K04, KC_NO, KC_##K06, KC_##K07 }, \ + { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17 }, \ + { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_NO, KC_##K26, KC_##K27 }, \ + { KC_##K30, KC_NO, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37 }, \ + { KC_##K40, KC_##K41, KC_##K42, KC_##K43, KC_##K44, KC_##K45, KC_##K46, KC_##K47 }, \ + { KC_##K50, KC_##K51, KC_##K52, KC_##K53, KC_##K54, KC_##K55, KC_##K56, KC_##K57 }, \ + { KC_##K60, KC_##K61, KC_##K62, KC_##K63, KC_##K64, KC_NO, KC_##K66, KC_##K67 }, \ + { KC_##K70, KC_NO, KC_NO, KC_##K73, KC_##K74, KC_##K75, KC_##K76, KC_NO }, \ + { KC_##K80, KC_##K81, KC_##K82, KC_##K83, KC_##K84, KC_##K85, KC_NO, KC_##K87 } \ } #define KEYCODE(layer, row, col) (pgm_read_byte(&keymaps[(layer)][(row)][(col)])) @@ -66,14 +66,14 @@ static const uint8_t PROGMEM fn_layer[] = { // Assign Fn key(0-7) to a keycode sent when release Fn key without use of the layer. // See layer.c for details. static const uint8_t PROGMEM fn_keycode[] = { - KB_NO, // Fn0 - KB_NO, // Fn1 - KB_SLSH, // Fn2 - KB_SCLN, // Fn3 - KB_SPC, // Fn4 - KB_NO, // Fn5 - KB_NO, // Fn6 - KB_NO // Fn7 + KC_NO, // Fn0 + KC_NO, // Fn1 + KC_SLSH, // Fn2 + KC_SCLN, // Fn3 + KC_SPC, // Fn4 + KC_NO, // Fn5 + KC_NO, // Fn6 + KC_NO // Fn7 }; static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { |