1
0

m0110_usb: Add unimap

This commit is contained in:
tmk 2016-09-13 04:22:26 +09:00
parent c7fd5fcfb4
commit 9b17e27605
16 changed files with 2799 additions and 412 deletions

View File

@ -1,31 +1,41 @@
# Target file name (without extension).
TARGET = m0110_lufa
TARGET ?= m0110_lufa
# Directory common source filess exist
TMK_DIR = ../../tmk_core
TMK_DIR ?= ../../tmk_core
# Directory keyboard dependent files exist
TARGET_DIR = .
TARGET_DIR ?= .
# keyboard dependent files
SRC = matrix.c \
SRC ?= matrix.c \
led.c \
m0110.c
# To use own keymap file run make like: make keymap=hasu
ifdef KEYMAP
SRC += keymap_$(KEYMAP).c
#
# Keymap file
#
ifdef UNIMAP_ENABLE
KEYMAP_FILE = unimap
else
SRC += keymap_default.c
ifdef ACTIONMAP_ENABLE
KEYMAP_FILE = actionmap
else
KEYMAP_FILE = keymap
endif
endif
ifdef KEYMAP
SRC := $(KEYMAP_FILE)_$(KEYMAP).c $(SRC)
else
SRC := $(KEYMAP_FILE).c $(SRC)
endif
CONFIG_H = config.h
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 = atmega32u2 # TMK converter rev2
#MCU = atmega32u4 # TMK converter rev1
MCU ?= atmega32u2
# Processor frequency.
@ -33,14 +43,14 @@ MCU = atmega32u2 # TMK converter rev2
# 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
F_CPU ?= 16000000
#
# LUFA specific
#
# Target architecture (see library "Board Types" documentation).
ARCH = AVR8
ARCH ?= AVR8
# Input clock frequency.
# This will define a symbol, F_USB, in all source code files equal to the
@ -53,7 +63,7 @@ ARCH = AVR8
#
# 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)
F_USB ?= $(F_CPU)
# Interrupt driven control endpoint task
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
@ -69,19 +79,19 @@ OPT_DEFS += -DBOOTLOADER_SIZE=4096
# Build Options
# *Comment out* to disable the options.
#
#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
CONSOLE_ENABLE = yes # Console for debug(+400)
COMMAND_ENABLE = yes # Commands for debug and configuration
#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend
#NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA
#KEYMAP_SECTION_ENABLE = yes # fixed address keymap for keymap editor
#BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
CONSOLE_ENABLE ?= yes # Console for debug(+400)
COMMAND_ENABLE ?= yes # Commands for debug and configuration
#SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend
#NKRO_ENABLE ?= yes # USB Nkey Rollover - not yet supported in LUFA
#KEYMAP_SECTION_ENABLE ?= yes # fixed address keymap for keymap editor
#---------------- Programming Options --------------------------
PROGRAM_CMD = teensy_loader_cli -mmcu=$(MCU) -w -v $(TARGET).hex
PROGRAM_CMD ?= teensy_loader_cli -mmcu=$(MCU) -w -v $(TARGET).hex
# Search Path

View File

@ -0,0 +1,3 @@
TARGET = m0110_rev1
MCU = atmega32u4
include Makefile

View File

@ -0,0 +1,3 @@
TARGET = m0110_rev2
MCU = atmega32u2
include Makefile

View File

@ -1,97 +0,0 @@
# Target file name (without extension).
TARGET = m0110_lufa
# Directory common source filess exist
TMK_DIR = ../../tmk_core
# Directory keyboard dependent files exist
TARGET_DIR = .
# keyboard dependent files
SRC = matrix.c \
led.c \
m0110.c
# To use own keymap file run make like: make keymap=hasu
ifdef KEYMAP
SRC += keymap_$(KEYMAP).c
else
SRC += keymap_default.c
endif
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
# Boot Section Size in bytes
# Teensy halfKay 512
# Atmel DFU loader 4096
# LUFA bootloader 4096
OPT_DEFS += -DBOOTLOADER_SIZE=512
# Build Options
# *Comment out* to disable the options.
#
#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
CONSOLE_ENABLE = yes # Console for debug(+400)
COMMAND_ENABLE = yes # Commands for debug and configuration
#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend
#NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA
#KEYMAP_SECTION_ENABLE = yes # fixed address keymap for keymap editor
#---------------- Programming Options --------------------------
PROGRAM_CMD = teensy_loader_cli -mmcu=$(MCU) -w -v $(TARGET).hex
# Search Path
VPATH += $(TARGET_DIR)
VPATH += $(TMK_DIR)
include $(TMK_DIR)/protocol/lufa.mk
include $(TMK_DIR)/protocol.mk
include $(TMK_DIR)/common.mk
include $(TMK_DIR)/rules.mk

View File

@ -1,95 +0,0 @@
# Target file name (without extension).
TARGET = m0110_lufa
# Directory common source filess exist
TMK_DIR = ../../tmk_core
# Directory keyboard dependent files exist
TARGET_DIR = .
# keyboard dependent files
SRC = matrix.c \
led.c \
m0110.c
# To use own keymap file run make like: make keymap=hasu
ifdef KEYMAP
SRC += keymap_$(KEYMAP).c
else
SRC += keymap_default.c
endif
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 = atmega32u2 # TMK converter rev2
MCU = atmega32u4 # TMK converter rev1
# 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
# Boot Section Size in bytes
# Teensy halfKay 512
# Atmel DFU loader 4096
# LUFA bootloader 4096
OPT_DEFS += -DBOOTLOADER_SIZE=4096
# Build Options
# *Comment out* to disable the options.
#
#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
CONSOLE_ENABLE = yes # Console for debug(+400)
COMMAND_ENABLE = yes # Commands for debug and configuration
#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend
#NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA
#KEYMAP_SECTION_ENABLE = yes # fixed address keymap for keymap editor
#---------------- Programming Options --------------------------
PROGRAM_CMD = teensy_loader_cli -mmcu=$(MCU) -w -v $(TARGET).hex
# Search Path
VPATH += $(TARGET_DIR)
VPATH += $(TMK_DIR)
include $(TMK_DIR)/protocol/lufa.mk
include $(TMK_DIR)/protocol.mk
include $(TMK_DIR)/common.mk
include $(TMK_DIR)/rules.mk

View File

@ -1,95 +0,0 @@
# Target file name (without extension).
TARGET = m0110_lufa
# Directory common source filess exist
TMK_DIR = ../../tmk_core
# Directory keyboard dependent files exist
TARGET_DIR = .
# keyboard dependent files
SRC = matrix.c \
led.c \
m0110.c
# To use own keymap file run make like: make keymap=hasu
ifdef KEYMAP
SRC += keymap_$(KEYMAP).c
else
SRC += keymap_default.c
endif
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 = atmega32u2 # TMK converter rev2
#MCU = atmega32u4 # TMK converter rev1
# 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
# Boot Section Size in bytes
# Teensy halfKay 512
# Atmel DFU loader 4096
# LUFA bootloader 4096
OPT_DEFS += -DBOOTLOADER_SIZE=4096
# Build Options
# *Comment out* to disable the options.
#
#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
CONSOLE_ENABLE = yes # Console for debug(+400)
COMMAND_ENABLE = yes # Commands for debug and configuration
#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend
#NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA
#KEYMAP_SECTION_ENABLE = yes # fixed address keymap for keymap editor
#---------------- Programming Options --------------------------
PROGRAM_CMD = teensy_loader_cli -mmcu=$(MCU) -w -v $(TARGET).hex
# Search Path
VPATH += $(TARGET_DIR)
VPATH += $(TMK_DIR)
include $(TMK_DIR)/protocol/lufa.mk
include $(TMK_DIR)/protocol.mk
include $(TMK_DIR)/common.mk
include $(TMK_DIR)/rules.mk

View File

@ -0,0 +1,6 @@
TARGET = m0110_rev1_unimap
UNIMAP_ENABLE = yes
KEYMAP_SECTION_ENABLE = yes
MCU = atmega32u4
#OPT_DEFS = -DM0110_INTL
include Makefile

View File

@ -0,0 +1,6 @@
TARGET = m0110_rev2_unimap
UNIMAP_ENABLE = yes
KEYMAP_SECTION_ENABLE = yes
MCU = atmega32u2
#OPT_DEFS = -DM0110_INTL
include Makefile

View File

@ -4,7 +4,7 @@ This firmware converts the protocol of Apple Macintosh keyboard **M0110**, **M01
Read README of top directory too.
Pictures of **M0110 + M0120** and **M0110A**.
Pictures of **M0110 + M0120** and **M0110A** with [TMK converter].
![M0110+M0120](http://i.imgur.com/dyvXb2Tm.jpg)
![M0110A](http://i.imgur.com/HuHOEoHm.jpg)
@ -21,25 +21,25 @@ Update
- 2013/09: Change port again, it uses inversely `PD0` for data and `PD1` for clock line now.
- 2014/06: Change keymaps
- 2015/03: Add support for "International"(ISO) keyboard(keymap_intl.c)
- 2016/09: Unimap support - keymap editor on web browser
Building Hardware
-----------------
You need [TMK converter] or AVR dev board like PJRC [Teensy]. Port of the MCU `PD1` is assigned to `CLOCK` line and `PD0` to `DATA` by default, you can change pin configuration with editing `config.h`.
Hardware
--------
You can buy preassembled [TMK converter] or make yourown with AVR dev board like PJRC [Teensy].
[![M0110 Converter](http://i.imgur.com/4G2ZOegm.jpg)](http://i.imgur.com/4G2ZOeg.jpg)
Port of the MCU `PD1` is assigned to `CLOCK` line and `PD0` to `DATA` by default, you can change pin configuration with editing `config.h`.
[![M0110 Converter](http://i.imgur.com/yEp2eRim.jpg)](http://i.imgur.com/yEp2eRi.jpg)
### 4P4C phone handset cable
Note that original cable used with Mac is **straight** while phone handset cable is **crossover**.
<http://en.wikipedia.org/wiki/Modular_connector#4P4C>
Close-up picture of handset cable. You can see one end of plug has reverse color codes against the other. Click to enlarge.
[![4P4C cable](http://i.imgur.com/3S9P1mYm.jpg?1)](http://i.imgur.com/3S9P1mY.jpg?1)
[Teensy]: http://www.pjrc.com/teensy/
[TMK converter]: https://github.com/tmk/keyboard_converter
[TMK converter]: https://geekhack.org/index.php?topic=72052.0
### Socket Pinout
@ -60,16 +60,19 @@ To compile firmware you need AVR GCC. You can edit *Makefile* and *config.h* to
$ git clone git://github.com/tmk/tmk_keyboard.git (or download source)
$ cd m0110_usb
$ make -f Makefile.rev2 clean
$ make -f Makefile.rev2 [KEYMAP={default|intl|spacefn|hasu}]
$ make -f Makefile.rev2 [KEYMAP={intl|spacefn}]
Use `Maefile.tmk_rev1` for TMK converter Rev.1, `Makefile.teensy` for Teensy instead.
Use `Maefile.rev1` for TMK converter rev.1 and Teensy(ATMega32u4), instead.
Keymap
------
To create your own keymap copy existent keymap file to `keymap_name.c` and edit it.
To create your own keymap copy existent keymap file to `keymap_<name>.c` and edit it. You can build with `make -f Makfile.rev2 KEYMAP=<name>`.
Or you can edit keymap on web browser and download firmware.
http://www.tmk-kbd.com/tmk_keyboard/editor/
Debug

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -40,7 +40,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
* ,---------------------------------------------------------. ,---------------.
* | 32| 12| 13| 14| 15| 17| 16| 1A| 1C| 19| 1D| 1B| 18| 33| | 47| 68| 6D| 62|
* |---------------------------------------------------------| |---------------|
* | 30| 0C| 0D| 0E| 0F| 10| 11| 20| 22| 1F| 23| 21| 1E| | | 59| 5B| 5C| 4E|
* | 30| 0C| 0D| 0E| 0F| 11| 10| 20| 22| 1F| 23| 21| 1E| | | 59| 5B| 5C| 4E|
* |-----------------------------------------------------' | |---------------|
* | 39| 00| 01| 02| 03| 05| 04| 26| 28| 25| 29| 27| 24| | 56| 57| 58| 66|
* |---------------------------------------------------------| |---------------|
@ -53,7 +53,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
* ,---------------------------------------------------------. ,---------------.
* | 32| 12| 13| 14| 15| 17| 16| 1A| 1C| 19| 1D| 1B| 18| 33| | 47| 68| 6D| 62|
* |---------------------------------------------------------| |---------------|
* | 30| 0C| 0D| 0E| 0F| 10| 11| 20| 22| 1F| 23| 21| 1E| 2A| | 59| 5B| 5C| 4E|
* | 30| 0C| 0D| 0E| 0F| 11| 10| 20| 22| 1F| 23| 21| 1E| 2A| | 59| 5B| 5C| 4E|
* |---------------------------------------------------------| |---------------|
* | 39| 00| 01| 02| 03| 05| 04| 26| 28| 25| 29| 27| 24| | 56| 57| 58| 66|
* |---------------------------------------------------------| |---------------|
@ -94,7 +94,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
* ,---------------------------------------------------------. ,---------------.
* | 32| 12| 13| 14| 15| 17| 16| 1A| 1C| 19| 1D| 1B| 18| 33| | 47| 68| 6D| 62|
* |---------------------------------------------------------| |---------------|
* | 30| 0C| 0D| 0E| 0F| 10| 11| 20| 22| 1F| 23| 21| 1E| 2A| | 59| 5B| 5C| 4E|
* | 30| 0C| 0D| 0E| 0F| 11| 10| 20| 22| 1F| 23| 21| 1E| 2A| | 59| 5B| 5C| 4E|
* |------------------------------------------------------, | |---------------|
* | 39| 00| 01| 02| 03| 05| 04| 26| 28| 25| 29| 27| 24| | | 56| 57| 58| 66|
* |---------------------------------------------------------| |---------------|

View File

@ -1,87 +0,0 @@
/*
Copyright 2014 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 "keycode.h"
#include "keymap_common.h"
const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Default:
* M0110
* ,---------------------------------------------------------.
* | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backs|
* |---------------------------------------------------------|
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \|
* |---------------------------------------------------------|
* |Ctrl | A| S| D| F| G| H| J| K| L| Fn| '|Return|
* |---------------------------------------------------------|
* |Shift | Z| X| C| V| B| N| M| ,| ,| Fn|Shift |
* `---------------------------------------------------------'
* |Fn |alt | Fn |Gui |Fn |
* `-----------------------------------------------'
*/
[0] = KEYMAP(
ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, NLCK,EQL, PSLS,PAST,
TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, P7, P8, P9, PMNS,
LCTL,A, S, D, F, G, H, J, K, L, FN3, QUOT, ENT, P4, P5, P6, PPLS,
LSFT,Z, X, C, V, B, N, M, COMM,DOT, FN1, UP, P1, P2, P3, PENT,
FN0, LALT, FN2, LGUI,BSLS,LEFT,RGHT,DOWN, P0, PDOT
),
// IJKL cursor
[1] = KEYMAP(
GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, DEL, NLCK,EQL, PSLS,PAST,
CAPS,NO, NO, NO, NO, NO, HOME,PGDN,UP, PGUP,END, NO, NO, P7, P8, P9, PMNS,
LCTL,VOLD,VOLU,MUTE,NO, NO, HOME,LEFT,DOWN,RGHT,END, NO, ENT, P4, P5, P6, PPLS,
LSFT,NO, NO, NO, NO, NO, HOME,PGDN,PGUP,END, NO, PGUP, P1, P2, P3, PENT,
TRNS,LALT, SPC, LGUI,BSLS,HOME,END, PGDN, P0, PDOT
),
// HJKL cursor
[2] = KEYMAP(
GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, DEL, NLCK,EQL, PSLS,PAST,
CAPS,NO, NO, NO, NO, NO, HOME,PGDN,UP, PGUP,END, NO, NO, P7, P8, P9, PMNS,
LCTL,VOLD,VOLU,MUTE,NO, NO, LEFT,DOWN,UP, RGHT,NO, NO, ENT, P4, P5, P6, PPLS,
LSFT,NO, NO, NO, NO, NO, HOME,PGDN,PGUP,END, TRNS, PGUP, P1, P2, P3, PENT,
TRNS,LALT, SPC, LGUI,BSLS,HOME,END, PGDN, P0, PDOT
),
// Mousekey
[3] = KEYMAP(
GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, DEL, NLCK,EQL, PSLS,PAST,
CAPS,Q, W, E, R, T, WH_L,WH_D,MS_U,WH_U,WH_R,WBAK,WFWD, P7, P8, P9, PMNS,
LCTL,VOLD,VOLU,MUTE,NO, NO, BTN2,MS_L,MS_D,MS_R,BTN1,NO, ENT, P4, P5, P6, PPLS,
LSFT,Z, X, C, V, B, BTN2,BTN1,BTN4,BTN5,NO, PGUP, P1, P2, P3, PENT,
NO, LALT, TRNS, LGUI,BSLS,HOME,END, PGDN, P0, PDOT
),
// Mousekey
[4] = KEYMAP(
GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, DEL, NLCK,EQL, PSLS,PAST,
CAPS,Q, W, E, R, T, WH_L,WH_D,MS_U,WH_U,WH_R,WBAK,WFWD, P7, P8, P9, PMNS,
LCTL,VOLD,VOLU,MUTE,NO, NO, BTN2,MS_L,MS_D,MS_R,TRNS,NO, ENT, P4, P5, P6, PPLS,
LSFT,Z, X, C, V, B, BTN2,BTN1,BTN4,BTN5,NO, PGUP, P1, P2, P3, PENT,
NO, LALT, BTN1, LGUI,BSLS,HOME,END, PGDN, P0, PDOT
),
};
/*
* Fn action definition
*/
const action_t fn_actions[] PROGMEM = {
[0] = ACTION_LAYER_MOMENTARY(1),
[1] = ACTION_LAYER_TAP_KEY(2, KC_SLASH),
[2] = ACTION_LAYER_TAP_KEY(3, KC_SPACE),
[3] = ACTION_LAYER_TAP_KEY(4, KC_SCOLON),
};

View File

@ -0,0 +1,48 @@
/*
Copyright 2016 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 "unimap_trans.h"
#define AC_FN0 ACTION_LAYER_MOMENTARY(1)
#define AC_FN1 ACTION_LAYER_TAP_KEY(1, KC_BSLS)
#ifdef KEYMAP_SECTION_ENABLE
const action_t actionmaps[][UNIMAP_ROWS][UNIMAP_COLS] __attribute__ ((section (".keymap.keymaps"))) = {
#else
const action_t actionmaps[][UNIMAP_ROWS][UNIMAP_COLS] PROGMEM = {
#endif
UNIMAP(
NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO,
NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO,
GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, NO, BSPC, NO, NO, NO, NLCK,PEQL,PSLS,PAST,
TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, FN1, NO, NO, NO, P7, P8, P9, PMNS,
LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT, NUHS,ENT, P4, P5, P6, PPLS,
LSFT,NUBS,Z, X, C, V, B, N, M, COMM,DOT, SLSH, NO, NO, UP, P1, P2, P3, NO,
NO, LGUI,LALT,NO, SPC, NO, NO, NO, FN0, NO, NO, LEFT,DOWN,RGHT, P0, PDOT,PENT
),
UNIMAP(
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
NO, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,
ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS,DEL, TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS,
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PSCR,SLCK,PAUS,UP, INS, TRNS, TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS,
TRNS,VOLD,VOLU,MUTE,TRNS,TRNS,TRNS,TRNS,HOME,PGUP,LEFT,RGHT, TRNS,TRNS, TRNS,TRNS,TRNS,TRNS,
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,END, PGDN,DOWN, TRNS,TRNS, PGUP, TRNS,TRNS,TRNS,TRNS,
TRNS,TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, HOME,PGDN,END, TRNS, TRNS,TRNS
),
};

View File

@ -0,0 +1,244 @@
/*
Copyright 2016 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/>.
*/
#ifndef UNIMAP_COMMON_H
#define UNIMAP_COMMON_H
#include <stdint.h>
#include <avr/pgmspace.h>
#include "unimap.h"
/* M0110A scan codes
* ,---------------------------------------------------------. ,---------------.
* | 32| 12| 13| 14| 15| 17| 16| 1A| 1C| 19| 1D| 1B| 18| 33| | 47| 68| 6D| 62|
* |---------------------------------------------------------| |---------------|
* | 30| 0C| 0D| 0E| 0F| 11| 10| 20| 22| 1F| 23| 21| 1E| | | 59| 5B| 5C| 4E|
* |-----------------------------------------------------' | |---------------|
* | 39| 00| 01| 02| 03| 05| 04| 26| 28| 25| 29| 27| 24| | 56| 57| 58| 66|
* |---------------------------------------------------------| |---------------|
* | 38| 06| 07| 08| 09| 0B| 2D| 2E| 2B| 2F| 2C| 38| 4D| | 53| 54| 55| |
* `---------------------------------------------------------' |-----------| 4C|
* | 3A| 37| 31 | 2A| 46| 42| 48| | 52| 41| |
* `---------------------------------------------------------' `---------------'
*
* M0110 + M0120 scan codes
* ,---------------------------------------------------------. ,---------------.
* | 32| 12| 13| 14| 15| 17| 16| 1A| 1C| 19| 1D| 1B| 18| 33| | 47| 68| 6D| 62|
* |---------------------------------------------------------| |---------------|
* | 30| 0C| 0D| 0E| 0F| 11| 10| 20| 22| 1F| 23| 21| 1E| 2A| | 59| 5B| 5C| 4E|
* |---------------------------------------------------------| |---------------|
* | 39| 00| 01| 02| 03| 05| 04| 26| 28| 25| 29| 27| 24| | 56| 57| 58| 66|
* |---------------------------------------------------------| |---------------|
* | 38| 06| 07| 08| 09| 0B| 2D| 2E| 2B| 2F| 2C| 38| | 53| 54| 55| |
* `---------------------------------------------------------' |-----------| 4C|
* | 3A| 37| 31 | 34| 3A| | 52| 41| |
* `------------------------------------------------' `---------------'
*
* International M0110
* https://en.wikipedia.org/wiki/File:Apple_Macintosh_Plus_Keyboard.jpg
* Probably International keyboard layout of M0110A doesn't exist.
* ,---------------------------------------------------------.
* | 32| 12| 13| 14| 15| 17| 16| 1A| 1C| 19| 1D| 1B| 18| 33|
* |---------------------------------------------------------|
* | 30| 0C| 0D| 0E| 0F| 11| 10| 20| 22| 1F| 23| 21| 1E| 2A|
* |------------------------------------------------------, |
* | 39| 00| 01| 02| 03| 05| 04| 26| 28| 25| 29| 27| 24| |
* |---------------------------------------------------------|
* | 38| 06| 07| 08| 09| 0B| 2D| 2E| 2B| 2F| 2C| 0A| 38|
* `---------------------------------------------------------'
* | 3A| 37| 34 | 31| 3A|
* `------------------------------------------------'
*/
const uint8_t PROGMEM unimap_trans[MATRIX_ROWS][MATRIX_COLS] = {
// Position(unimap) scan code(matrix)
// ---------------------------------------------
{
UNIMAP_A, // 0x00
UNIMAP_S, // 0x01
UNIMAP_D, // 0x02
UNIMAP_F, // 0x03
UNIMAP_H, // 0x04
UNIMAP_G, // 0x05
#ifdef M0110_INTL
UNIMAP_NONUS_BSLASH, // 0x06
UNIMAP_Z, // 0x07
},
{
UNIMAP_X, // 0x08
UNIMAP_C, // 0x09
UNIMAP_SLASH, // 0x0A
UNIMAP_V, // 0x0B
#else
UNIMAP_Z, // 0x06
UNIMAP_X, // 0x07
},
{
UNIMAP_C, // 0x08
UNIMAP_V, // 0x09
UNIMAP_NO, // 0x0A
UNIMAP_B, // 0x0B
#endif
UNIMAP_Q, // 0x0C
UNIMAP_W, // 0x0D
UNIMAP_E, // 0x0E
UNIMAP_R, // 0x0F
},
{
UNIMAP_Y, // 0x10
UNIMAP_T, // 0x11
UNIMAP_1, // 0x12
UNIMAP_2, // 0x13
UNIMAP_3, // 0x14
UNIMAP_4, // 0x15
UNIMAP_6, // 0x16
UNIMAP_5, // 0x17
},
{
UNIMAP_EQUAL, // 0x18
UNIMAP_9, // 0x19
UNIMAP_7, // 0x1A
UNIMAP_MINUS, // 0x1B
UNIMAP_8, // 0x1C
UNIMAP_0, // 0x1D
UNIMAP_RBRACKET, // 0x1E
UNIMAP_O, // 0x1F
},
{
UNIMAP_U, // 0x20
UNIMAP_LBRACKET, // 0x21
UNIMAP_I, // 0x22
UNIMAP_P, // 0x23
#ifdef M0110_INTL
UNIMAP_NONUS_HASH, // 0x24
#else
UNIMAP_ENTER, // 0x24
#endif
UNIMAP_L, // 0x25
UNIMAP_J, // 0x26
UNIMAP_QUOTE, // 0x27
},
{
UNIMAP_K, // 0x28
UNIMAP_SCOLON, // 0x29
#ifdef M0110_INTL
UNIMAP_ENTER, // 0x2A
UNIMAP_M, // 0x2B
UNIMAP_DOT, // 0x2C
UNIMAP_B, // 0x2D
UNIMAP_N, // 0x2E
UNIMAP_COMMA, // 0x2F
#else
UNIMAP_BSLASH, // 0x2A
UNIMAP_COMMA, // 0x2B
UNIMAP_SLASH, // 0x2C
UNIMAP_N, // 0x2D
UNIMAP_M, // 0x2E
UNIMAP_DOT, // 0x2F
#endif
},
{
UNIMAP_TAB, // 0x30
#ifdef M0110_INTL
UNIMAP_RGUI, // 0x31
#else
UNIMAP_SPACE, // 0x31
#endif
UNIMAP_GRAVE, // 0x32
UNIMAP_BSPACE, // 0x33
#ifdef M0110_INTL
UNIMAP_SPACE, // 0x34
#else
UNIMAP_RGUI, // 0x34
#endif
UNIMAP_NO, // 0x35
UNIMAP_NO, // 0x36
UNIMAP_LGUI, // 0x37
},
{
UNIMAP_LSHIFT, // 0x38
UNIMAP_CAPSLOCK, // 0x39
UNIMAP_LALT, // 0x3A
UNIMAP_NO, // 0x3B
UNIMAP_NO, // 0x3C
UNIMAP_NO, // 0x3D
UNIMAP_NO, // 0x3E
UNIMAP_NO, // 0x3F
},
{
UNIMAP_NO, // 0x40
UNIMAP_KP_DOT, // 0x41
UNIMAP_RIGHT, // 0x42
UNIMAP_NO, // 0x43
UNIMAP_NO, // 0x44
UNIMAP_NO, // 0x45
UNIMAP_LEFT, // 0x46
UNIMAP_NUMLOCK, // 0x47
},
{
UNIMAP_DOWN, // 0x48
UNIMAP_NO, // 0x49
UNIMAP_NO, // 0x4A
UNIMAP_NO, // 0x4B
UNIMAP_KP_ENTER, // 0x4C
UNIMAP_UP, // 0x4D
UNIMAP_KP_PLUS, // 0x4E keypad minus
UNIMAP_NO, // 0x4F
},
{
UNIMAP_NO, // 0x50
UNIMAP_NO, // 0x51
UNIMAP_KP_0, // 0x52
UNIMAP_KP_1, // 0x53
UNIMAP_KP_2, // 0x54
UNIMAP_KP_3, // 0x55
UNIMAP_KP_4, // 0x56
UNIMAP_KP_5, // 0x57
},
{
UNIMAP_KP_6, // 0x58
UNIMAP_KP_7, // 0x59
UNIMAP_NO, // 0x5A
UNIMAP_KP_8, // 0x5B
UNIMAP_KP_9, // 0x5C
UNIMAP_NO, // 0x5D
UNIMAP_NO, // 0x5E
UNIMAP_NO, // 0x5F
},
{
UNIMAP_NO, // 0x60
UNIMAP_NO, // 0x61
UNIMAP_KP_MINUS, // 0x62 keypad asterisk
UNIMAP_NO, // 0x63
UNIMAP_NO, // 0x64
UNIMAP_NO, // 0x65
UNIMAP_KP_COMMA, // 0x66
UNIMAP_NO, // 0x67
},
{
UNIMAP_KP_SLASH, // 0x68 keypad equal
UNIMAP_NO, // 0x69
UNIMAP_NO, // 0x6A
UNIMAP_NO, // 0x6B
UNIMAP_NO, // 0x6C
UNIMAP_KP_ASTERISK, // 0x6D keypad slash
UNIMAP_NO, // 0x6E compose
UNIMAP_NO, // 0x6F
},
};
#endif