Fix keymap for new framework

This commit is contained in:
tmk 2013-03-05 15:41:21 +09:00
parent 633d9aa53e
commit 5808317b69
18 changed files with 117 additions and 23 deletions

View file

@ -39,7 +39,7 @@ You can find some keyboard specific projects under `converter` and `keyboard` di
* [hhkb](keyboard/hhkb/) - [Happy Hacking Keyboard professional][GH_hhkb]
* [macway](keyboard/macway/) - [Compact keyboard mod][GH_macway]
* [hbkb](keyboard/hbkb/) - [Happy Buckling sprint keyboard(IBM Model M mod)][GH_hbkb]
* [IIgs_Standard](keyboard/IIgs_Standard/) - Apple [IIGS] keyboard mod(by JeffreySung)
* [IIgs_Standard](keyboard/IIgs/) - Apple [IIGS] keyboard mod(by JeffreySung)
* [hid_liber](keyboard/hid_liber/) - [HID liberation controller][HID_liber](by alaricljs)
* [phantom](keyboard/phantom/) - [Phantom keyboard][PHANTOM] (by Tranquilite)
* [gh60](keyboard/gh60/) - [GH60 keyboard][GH60]

View file

@ -38,12 +38,6 @@ action_t action_for_key(uint8_t layer, key_t key)
return keycode_to_action(keycode);
}
}
__attribute__ ((weak))
const prog_macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { return MACRO_NONE; }
__attribute__ ((weak))
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {}
#else
/*
* legacy keymap support
@ -71,13 +65,17 @@ action_t action_for_key(uint8_t layer, key_t key)
return keycode_to_action(keycode);
}
}
/* not used for legacy keymap */
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt)
{
}
#endif
__attribute__ ((weak))
const prog_macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { return MACRO_NONE; }
__attribute__ ((weak))
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {}
/* translates keycode to action */
static action_t keycode_to_action(uint8_t keycode)

View file

@ -0,0 +1,91 @@
# Target file name (without extension).
TARGET = m0110_lufa
# Directory common source filess exist
TOP_DIR = ../..
# Directory keyboard dependent files exist
TARGET_DIR = .
# keyboard dependent files
SRC = keymap.c \
matrix.c \
led.c \
m0110.c
CONFIG_H = config.h
# 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 = at90usb162 # Teensy 1.0
MCU = atmega32u4 # Teensy 2.0
#MCU = at90usb646 # Teensy++ 1.0
#MCU = at90usb1286 # Teensy++ 2.0
# Processor frequency.
# Normally the first thing your program should do is set the clock prescaler,
# so your program will run at the correct speed. You should also set this
# variable to same clock speed. The _delay_ms() macro uses this, and many
# examples use this variable to calculate timings. Do not add a "UL" here.
F_CPU = 16000000
#
# LUFA specific
#
# Target architecture (see library "Board Types" documentation).
ARCH = AVR8
# Input clock frequency.
# This will define a symbol, F_USB, in all source code files equal to the
# input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
# at the end, this will be done automatically to create a 32-bit value in your
# source code.
#
# If no clock division is performed on the input clock inside the AVR (via the
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
F_USB = $(F_CPU)
# Interrupt driven control endpoint task
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
# Build Options
# *Comment out* to disable the options.
#
MOUSEKEY_ENABLE = yes # Mouse keys
#PS2_MOUSE_ENABLE = yes # PS/2 mouse(TrackPoint) support
EXTRAKEY_ENABLE = yes # Audio control and System control
CONSOLE_ENABLE = yes # Console for debug
#NKRO_ENABLE = yes # USB Nkey Rollover
# Boot Section Size in bytes
# Teensy halfKay 512
# Atmel DFU loader 4096
# LUFA bootloader 4096
OPT_DEFS += -DBOOT_SIZE=4096
#---------------- Programming Options --------------------------
PROGRAM_CMD = teensy_loader_cli -mmcu=$(MCU) -w -v $(TARGET).hex
# Search Path
VPATH += $(TARGET_DIR)
VPATH += $(TOP_DIR)
include $(TOP_DIR)/protocol/lufa.mk
include $(TOP_DIR)/protocol.mk
include $(TOP_DIR)/common.mk
include $(TOP_DIR)/rules.mk
hasu: EXTRAFLAGS += -DHASU
hasu: all

View file

@ -53,7 +53,8 @@ You can edit *Makefile* and *config.h* to change compile options and pin configu
$ git clone git://github.com/tmk/tmk_keyboard.git (or download source)
$ cd m0110_usb
$ make
$ make -f Makefile.lufa clean
$ make -f Makefile.lufa
and program your Teensy with [PJRC Teensy loader](http://www.pjrc.com/teensy/loader.html).
@ -74,7 +75,7 @@ You can change keymaps by editing *keymap.c*.
|---------------------------------------------------------| |---------------|
|Shift | Z| X| C| V| B| N| M| ,| ,| /|Shift | | 1| 2| 3| |
`---------------------------------------------------------' |-----------|Ent|
|Alt|Gui | Space |Ctl |Alt| | 0| .| |
|Ctl|Alt | Space |Gui |Ctl| | 0| .| |
`-----------------------------------------------' `---------------'
#### *HHKB/WASD Layer(WASD/IJKL)*
,---------------------------------------------------------. ,---------------.
@ -86,7 +87,7 @@ You can change keymaps by editing *keymap.c*.
|---------------------------------------------------------| |---------------|
|Shift |End| |PgD| | | |PgD| |End| |Shift | | 1| 2| 3| |
`---------------------------------------------------------' |-----------|Ent|
|Alt|Gui | Space |Ctl |Alt| | 0| .| |
|Ctl|Alt | Space |Gui |Ctl| | 0| .| |
`-----------------------------------------------' `---------------'
### M0110A

View file

@ -24,6 +24,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define VENDOR_ID 0xFEED
#define PRODUCT_ID 0x0110
#define DEVICE_VER 0x0100
#define MANUFACTURER t.m.k.
#define PRODUCT M0110 keyboard converter
#define DESCRIPTION convert M0110 keyboard to USB

View file

@ -19,7 +19,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <stdint.h>
#include <stdbool.h>
#include <avr/pgmspace.h>
#include "usb_keyboard.h"
#include "keycode.h"
#include "print.h"
#include "debug.h"
@ -148,7 +147,7 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* |---------------------------------------------------------| |---------------|
* |Shift | Z| X| C| V| B| N| M| ,| ,| /|Shft|Up | | 1| 2| 3| |
* |---------------------------------------------------------| |-----------|Ent|
* |Alt |Gui | Space |Ctl| \|Lft|Rgt|Dn | | 0| .| |
* |Ctl |Alt | Space |Gui| \|Lft|Rgt|Dn | | 0| .| |
* `---------------------------------------------------------' `---------------'
*/
KEYMAP(
@ -156,7 +155,7 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, P7, P8, P9, PMNS,
FN0, A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT, P4, P5, P6, PPLS,
LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH, UP, P1, P2, P3, PENT,
LALT,LGUI, SPC, LCTL,BSLS,LEFT,RGHT,DOWN, P0, PDOT
LCTL,LALT, SPC, LGUI,BSLS,LEFT,RGHT,DOWN, P0, PDOT
),
/* Cursor Layer(WASD, IJKL)
* ,---------------------------------------------------------. ,---------------.
@ -168,7 +167,7 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* |---------------------------------------------------------| |---------------|
* |Shift |End| |PgD| | | |PgD| |End| |Shif|PgU| | 1| 2| 3| |
* |---------------------------------------------------------| |-----------|Ent|
* |Alt |Gui | Space |Gui |Ins|Hom|End|PgD| | 0| .| |
* |Ctl |Alt | Space |Gui |Ins|Hom|End|PgD| | 0| .| |
* `---------------------------------------------------------' `---------------'
*/
KEYMAP(
@ -176,7 +175,7 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
CAPS,HOME,UP, PGUP,NO, NO, NO, PGUP,UP, HOME,PSCR,SLCK,PAUS, P7, P8, P9, PMNS,
FN0, LEFT,DOWN,RGHT,NO, NO, NO, LEFT,DOWN,RGHT,NO, NO, ENT, P4, P5, P6, PPLS,
LSFT,END, NO, PGDN,NO, NO, NO, PGDN,NO, END, NO, PGUP, P1, P2, P3, PENT,
LALT,LGUI, SPC, LCTL,INS, HOME,END, PGDN, P0, PDOT
LCTL,LALT, SPC, LGUI,INS, HOME,END, PGDN, P0, PDOT
),
};

View file

@ -168,7 +168,7 @@ static const uint16_t PROGMEM fn_actions[] = {
ACTION_KEYMAP_TAP_TOGGLE(0), // FN0
ACTION_KEYMAP_TAP_KEY(1, KC_SLASH), // FN1
ACTION_KEYMAP_TAP_KEY(2, KC_SCLN), // FN2
ACTION_KEYMAP(2), // FN3
ACTION_KEYMAP_MOMENTARY(2), // FN3
ACTION_MACRO(LBRACKET), // FN4
ACTION_MACRO(RBRACKET), // FN5
ACTION_MACRO(DUMMY), // FN6

View file

Before

Width:  |  Height:  |  Size: 322 KiB

After

Width:  |  Height:  |  Size: 322 KiB

View file

Before

Width:  |  Height:  |  Size: 72 KiB

After

Width:  |  Height:  |  Size: 72 KiB

View file

@ -82,7 +82,7 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* |Gui|Alt | Space |Alt |Gui|
* `-------------------------------------------'
*/
KEYMAP(PWR, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL, \
KEYMAP(GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL, \
CAPS,NO, NO, NO, NO, NO, NO, NO, PSCR,SLCK,PAUS, UP, NO, BSPC, \
LCTL,VOLD,VOLU,MUTE,NO, NO, PAST,PSLS,HOME,PGUP,LEFT,RGHT,ENT, \
LSFT,NO, NO, NO, NO, NO, PPLS,PMNS,END, PGDN,DOWN,RSFT,TRNS, \
@ -101,7 +101,7 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* |Gui|Alt | Space |Alt |Gui|
* `-------------------------------------------'
*/
KEYMAP(ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL, \
KEYMAP(GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL, \
TAB, HOME,PGDN,UP, PGUP,END, HOME,PGDN,PGUP,END, NO, NO, NO, BSPC, \
LCTL,NO, LEFT,DOWN,RGHT,NO, LEFT,DOWN,UP, RGHT,NO, NO, ENT, \
LSFT,NO, NO, NO, NO, NO, HOME,PGDN,PGUP,END, TRNS,RSFT,NO, \
@ -121,7 +121,7 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* `--------------------------------------------'
* Mc: Mouse Cursor / Mb: Mouse Button / Mw: Mouse Wheel
*/
KEYMAP(ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL, \
KEYMAP(GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL, \
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,TRNS,QUOT,ENT, \
LSFT,NO, NO, NO, NO, BTN3,BTN2,BTN1,BTN4,BTN5,SLSH,RSFT,NO, \

View file

@ -88,6 +88,10 @@ static void send_keyboard(report_keyboard_t *report)
} else {
debug("kbuf: full\n");
}
// NOTE: send key strokes of Macro
usbPoll();
vusb_transfer_keyboard();
}