Browse Source

Merge remote-tracking branch 'refs/remotes/tmk/master'

master
di0ib 7 years ago
parent
commit
d3d1814e6d
100 changed files with 9080 additions and 1683 deletions
  1. 2
    0
      .gitignore
  2. 4
    0
      README.md
  3. 31
    55
      converter/adb_usb/Makefile
  4. 2
    142
      converter/adb_usb/Makefile.rev1
  5. 2
    142
      converter/adb_usb/Makefile.teensy
  6. 5
    0
      converter/adb_usb/Makefile.unimap.rev1
  7. 5
    0
      converter/adb_usb/Makefile.unimap.rev2
  8. 3
    3
      converter/adb_usb/README.md
  9. 1286
    0
      converter/adb_usb/binary/adb_usb_rev1_unimap.hex
  10. 1277
    0
      converter/adb_usb/binary/adb_usb_rev2_unimap.hex
  11. 0
    4
      converter/adb_usb/config.h
  12. 1
    1
      converter/adb_usb/keymap_ansi.c
  13. 0
    30
      converter/adb_usb/keymap_common.c
  14. 0
    5
      converter/adb_usb/keymap_common.h
  15. 1
    1
      converter/adb_usb/keymap_hasu.c
  16. 1
    1
      converter/adb_usb/keymap_iso.c
  17. 1
    1
      converter/adb_usb/keymap_plain.c
  18. 213
    0
      converter/adb_usb/unimap_common.h
  19. 46
    0
      converter/adb_usb/unimap_plain.c
  20. 1
    2
      converter/ibm4704_usb/Makefile
  21. 1
    1
      converter/ibm4704_usb/keymap_50key.c
  22. 1
    1
      converter/ibm4704_usb/keymap_alps102key.c
  23. 0
    30
      converter/ibm4704_usb/keymap_common.c
  24. 0
    6
      converter/ibm4704_usb/keymap_common.h
  25. 1
    1
      converter/ibm4704_usb/keymap_hasu.c
  26. 1
    1
      converter/ibm4704_usb/keymap_plain.c
  27. 32
    23
      converter/m0110_usb/Makefile
  28. 3
    0
      converter/m0110_usb/Makefile.rev1
  29. 3
    0
      converter/m0110_usb/Makefile.rev2
  30. 0
    98
      converter/m0110_usb/Makefile.teensy
  31. 0
    96
      converter/m0110_usb/Makefile.tmk_rev1
  32. 0
    96
      converter/m0110_usb/Makefile.tmk_rev2
  33. 6
    0
      converter/m0110_usb/Makefile.unimap.rev1
  34. 6
    0
      converter/m0110_usb/Makefile.unimap.rev2
  35. 15
    12
      converter/m0110_usb/README.md
  36. 1223
    0
      converter/m0110_usb/binary/m0110_usb_rev1_unimap.hex
  37. 1215
    0
      converter/m0110_usb/binary/m0110_usb_rev2_unimap.hex
  38. 2
    2
      converter/m0110_usb/keymap.c
  39. 0
    37
      converter/m0110_usb/keymap_common.c
  40. 3
    8
      converter/m0110_usb/keymap_common.h
  41. 0
    87
      converter/m0110_usb/keymap_hasu.c
  42. 1
    1
      converter/m0110_usb/keymap_intl.c
  43. 1
    1
      converter/m0110_usb/keymap_spacefn.c
  44. 48
    0
      converter/m0110_usb/unimap.c
  45. 244
    0
      converter/m0110_usb/unimap_trans.h
  46. 3
    20
      converter/news_usb/keymap.c
  47. 33
    15
      converter/next_usb/Makefile
  48. 4
    0
      converter/next_usb/Makefile.unimap
  49. 1217
    0
      converter/next_usb/binary/next_usb_unimap.hex
  50. 20
    33
      converter/next_usb/keymap.c
  51. 50
    0
      converter/next_usb/unimap.c
  52. 86
    0
      converter/next_usb/unimap_trans.h
  53. 2
    38
      converter/pc98_usb/keymap.c
  54. 1
    2
      converter/ps2_usb/Makefile
  55. 0
    1
      converter/ps2_usb/Makefile.mbed
  56. 1
    2
      converter/ps2_usb/Makefile.pjrc
  57. 1
    2
      converter/ps2_usb/Makefile.tmk_rev1
  58. 1
    2
      converter/ps2_usb/Makefile.tmk_rev2
  59. 1
    2
      converter/ps2_usb/Makefile.vusb
  60. 0
    31
      converter/ps2_usb/keymap_common.c
  61. 0
    5
      converter/ps2_usb/keymap_common.h
  62. 1
    1
      converter/ps2_usb/keymap_jis.c
  63. 1
    1
      converter/ps2_usb/keymap_plain.c
  64. 1
    1
      converter/ps2_usb/keymap_spacefn.c
  65. 3
    20
      converter/sun_usb/keymap.c
  66. 0
    17
      converter/sun_usb/keymap_sun3.c
  67. 3
    20
      converter/terminal_usb/keymap.c
  68. 28
    18
      converter/usb_usb/Makefile
  69. 4
    0
      converter/usb_usb/Makefile.unimap
  70. 33
    7
      converter/usb_usb/README
  71. 1615
    0
      converter/usb_usb/binary/usb_usb_unimap.hex
  72. 146
    2
      converter/usb_usb/keymap.c
  73. 0
    31
      converter/usb_usb/keymap_common.c
  74. 0
    4
      converter/usb_usb/keymap_common.h
  75. 0
    88
      converter/usb_usb/keymap_editor.c
  76. 0
    158
      converter/usb_usb/keymap_hasu.c
  77. 0
    36
      converter/usb_usb/keymap_iso.c
  78. 0
    36
      converter/usb_usb/keymap_jis.c
  79. 0
    65
      converter/usb_usb/keymap_spacefn.c
  80. 45
    0
      converter/usb_usb/unimap.c
  81. 80
    0
      converter/usb_usb/unimap_trans.h
  82. 2
    16
      converter/x68k_usb/keymap.c
  83. 1
    2
      converter/xt_usb/Makefile
  84. 0
    31
      converter/xt_usb/keymap_common.c
  85. 0
    4
      converter/xt_usb/keymap_common.h
  86. 1
    1
      converter/xt_usb/keymap_jis.c
  87. 1
    1
      converter/xt_usb/keymap_plain.c
  88. 1
    1
      converter/xt_usb/keymap_spacefn.c
  89. 0
    1
      keyboard/alps64/Makefile
  90. 1
    2
      keyboard/alps64/actionmap_hasu.c
  91. 1
    2
      keyboard/alps64/actionmap_plain.c
  92. 0
    30
      keyboard/alps64/keymap_common.c
  93. 0
    5
      keyboard/alps64/keymap_common.h
  94. 2
    2
      keyboard/alps64/keymap_editor.c
  95. 1
    1
      keyboard/alps64/keymap_hasu.c
  96. 1
    1
      keyboard/alps64/keymap_plain.c
  97. 1
    2
      keyboard/gh60/Makefile
  98. 0
    30
      keyboard/gh60/keymap_common.c
  99. 0
    5
      keyboard/gh60/keymap_common.h
  100. 0
    0
      keyboard/gh60/keymap_hasu.c

+ 2
- 0
.gitignore View File

build/ build/
*.bak *.bak
.DS_Store .DS_Store
!converter/*/binary/*.hex
!keyboard/*/binary/*.hex

+ 4
- 0
README.md View File



Updates Updates
------- -------
#### 2016/06/26
Keymap framework was updated. `fn_actions[]` should be defined as `action_t` instead of `uint16_t`. And default code for keymap handling is now included in core you just need define `uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS]` and `action_t fn_actions[]`.


#### 2016/06/22 #### 2016/06/22
Some projects were moved from `converter` and `keyboard` to `orphan` directory. Those might be removed in some future but you will be able to access them with `orphans` tag. See <https://github.com/tmk/tmk_keyboard/issues/173> Some projects were moved from `converter` and `keyboard` to `orphan` directory. Those might be removed in some future but you will be able to access them with `orphans` tag. See <https://github.com/tmk/tmk_keyboard/issues/173>



+ 31
- 55
converter/adb_usb/Makefile View File

#----------------------------------------------------------------------------
# On command line:
#
# make all = Make software.
#
# make clean = Clean out built project files.
#
# make coff = Convert ELF to AVR COFF.
#
# make extcoff = Convert ELF to AVR Extended COFF.
#
# make program = Download the hex file to the device.
# Please customize your programmer settings(PROGRAM_CMD)
#
# make teensy = Download the hex file to the device, using teensy_loader_cli.
# (must have teensy_loader_cli installed).
#
# make dfu = Download the hex file to the device, using dfu-programmer (must
# have dfu-programmer installed).
#
# make flip = Download the hex file to the device, using Atmel FLIP (must
# have Atmel FLIP installed).
#
# make dfu-ee = Download the eeprom file to the device, using dfu-programmer
# (must have dfu-programmer installed).
#
# make flip-ee = Download the eeprom file to the device, using Atmel FLIP
# (must have Atmel FLIP installed).
#
# make debug = Start either simulavr or avarice as specified for debugging,
# with avr-gdb or avr-insight as the front end for debugging.
#
# make filename.s = Just compile filename.c into the assembler code only.
#
# make filename.i = Create a preprocessed source file for use in submitting
# bug reports to the GCC project.
#
# To rebuild project do "make clean" then "make all".
#----------------------------------------------------------------------------

# Target file name (without extension). # Target file name (without extension).
TARGET = adb_usb_lufa
TARGET ?= adb_usb


# Directory common source filess exist # Directory common source filess exist
TMK_DIR = ../../tmk_core
TMK_DIR ?= ../../tmk_core


# Directory keyboard dependent files exist # Directory keyboard dependent files exist
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


ifdef KEYMAP
SRC := keymap_$(KEYMAP).c $(SRC)
else
SRC := keymap_plain.c $(SRC)
endif

CONFIG_H = config.h CONFIG_H = config.h




# atmega32u4 Teensy2.0 # atmega32u4 Teensy2.0
# atemga32u4 TMK Converter rev.1 # atemga32u4 TMK Converter rev.1
# atemga32u2 TMK Converter rev.2 # atemga32u2 TMK Converter rev.2
MCU = atmega32u2
MCU ?= atmega32u2


# Processor frequency. # Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the # This will define a symbol, F_CPU, in all source code files equal to the
# does not *change* the processor frequency - it should merely be updated to # does not *change* the processor frequency - it should merely be updated to
# reflect the processor speed set externally so that the code can use accurate # reflect the processor speed set externally so that the code can use accurate
# software delays. # software delays.
F_CPU = 16000000
F_CPU ?= 16000000




# #
# LUFA specific # LUFA specific
# #
# Target architecture (see library "Board Types" documentation). # Target architecture (see library "Board Types" documentation).
ARCH = AVR8
ARCH ?= AVR8


# Input clock frequency. # Input clock frequency.
# This will define a symbol, F_USB, in all source code files equal to the # This will define a symbol, F_USB, in all source code files equal to the
# #
# If no clock division is performed on the input clock inside the AVR (via the # 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. # 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(+60) # Interrupt driven control endpoint task(+60)
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend #SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend
#NKRO_ENABLE = yes # USB Nkey Rollover #NKRO_ENABLE = yes # USB Nkey Rollover
ADB_MOUSE_ENABLE = yes ADB_MOUSE_ENABLE = yes
#UNIMAP_ENABLE = yes
#ACTIONMAP_ENABLE = yes # Use 16bit actionmap instead of 8bit keymap
#KEYMAP_SECTION_ENABLE = yes # fixed address keymap for keymap editor


# ADB Mice need acceleration for todays much bigger screens. # ADB Mice need acceleration for todays much bigger screens.
OPT_DEFS += -DADB_MOUSE_MAXACC=8 OPT_DEFS += -DADB_MOUSE_MAXACC=8
# Optimize size but this may cause error "relocation truncated to fit" # Optimize size but this may cause error "relocation truncated to fit"
#EXTRALDFLAGS = -Wl,--relax #EXTRALDFLAGS = -Wl,--relax



#
# Keymap file
#
ifdef UNIMAP_ENABLE
KEYMAP_FILE = unimap
else
ifdef ACTIONMAP_ENABLE
KEYMAP_FILE = actionmap
else
KEYMAP_FILE = keymap
endif
endif
ifdef KEYMAP
SRC := $(KEYMAP_FILE)_$(KEYMAP).c $(SRC)
else
SRC := $(KEYMAP_FILE)_plain.c $(SRC)
endif


# Search Path # Search Path
VPATH += $(TARGET_DIR) VPATH += $(TARGET_DIR)
VPATH += $(TMK_DIR) VPATH += $(TMK_DIR)

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

#----------------------------------------------------------------------------
# On command line:
#
# make all = Make software.
#
# make clean = Clean out built project files.
#
# make coff = Convert ELF to AVR COFF.
#
# make extcoff = Convert ELF to AVR Extended COFF.
#
# make program = Download the hex file to the device.
# Please customize your programmer settings(PROGRAM_CMD)
#
# make teensy = Download the hex file to the device, using teensy_loader_cli.
# (must have teensy_loader_cli installed).
#
# make dfu = Download the hex file to the device, using dfu-programmer (must
# have dfu-programmer installed).
#
# make flip = Download the hex file to the device, using Atmel FLIP (must
# have Atmel FLIP installed).
#
# make dfu-ee = Download the eeprom file to the device, using dfu-programmer
# (must have dfu-programmer installed).
#
# make flip-ee = Download the eeprom file to the device, using Atmel FLIP
# (must have Atmel FLIP installed).
#
# make debug = Start either simulavr or avarice as specified for debugging,
# with avr-gdb or avr-insight as the front end for debugging.
#
# make filename.s = Just compile filename.c into the assembler code only.
#
# make filename.i = Create a preprocessed source file for use in submitting
# bug reports to the GCC project.
#
# To rebuild project do "make clean" then "make all".
#----------------------------------------------------------------------------

# Target file name (without extension).
TARGET = adb_usb_lufa

# Directory common source filess exist
TMK_DIR = ../../tmk_core

# Directory keyboard dependent files exist
TARGET_DIR = .

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

ifdef KEYMAP
SRC := keymap_$(KEYMAP).c $(SRC)
else
SRC := keymap_ansi.c $(SRC)
endif

CONFIG_H = config.h


# MCU name
# atmega32u4 Teensy2.0
# atemga32u4 TMK Converter rev.1
# atemga32u2 TMK Converter rev.2
TARGET = adb_usb_rev1
MCU = atmega32u4 MCU = atmega32u4

# Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code.
#
# This will be an integer division of F_USB below, as it is sourced by
# F_USB after it has run through any CPU prescalers. Note that this value
# does not *change* the processor frequency - it should merely be updated to
# reflect the processor speed set externally so that the code can use accurate
# software delays.
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(+60)
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT


# Boot Section Size in *bytes*
# Teensy halfKay 512
# Teensy++ halfKay 1024
# Atmel DFU loader 4096 for TMK Converter rev.1/rev.2
# LUFA bootloader 4096
# USBaspLoader 2048
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
ADB_MOUSE_ENABLE = yes

# ADB Mice need acceleration for todays much bigger screens.
OPT_DEFS += -DADB_MOUSE_MAXACC=8


# Optimize size but this may cause error "relocation truncated to fit"
#EXTRALDFLAGS = -Wl,--relax

# 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
include Makefile

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

#----------------------------------------------------------------------------
# On command line:
#
# make all = Make software.
#
# make clean = Clean out built project files.
#
# make coff = Convert ELF to AVR COFF.
#
# make extcoff = Convert ELF to AVR Extended COFF.
#
# make program = Download the hex file to the device.
# Please customize your programmer settings(PROGRAM_CMD)
#
# make teensy = Download the hex file to the device, using teensy_loader_cli.
# (must have teensy_loader_cli installed).
#
# make dfu = Download the hex file to the device, using dfu-programmer (must
# have dfu-programmer installed).
#
# make flip = Download the hex file to the device, using Atmel FLIP (must
# have Atmel FLIP installed).
#
# make dfu-ee = Download the eeprom file to the device, using dfu-programmer
# (must have dfu-programmer installed).
#
# make flip-ee = Download the eeprom file to the device, using Atmel FLIP
# (must have Atmel FLIP installed).
#
# make debug = Start either simulavr or avarice as specified for debugging,
# with avr-gdb or avr-insight as the front end for debugging.
#
# make filename.s = Just compile filename.c into the assembler code only.
#
# make filename.i = Create a preprocessed source file for use in submitting
# bug reports to the GCC project.
#
# To rebuild project do "make clean" then "make all".
#----------------------------------------------------------------------------

# Target file name (without extension).
TARGET = adb_usb_lufa

# Directory common source filess exist
TMK_DIR = ../../tmk_core

# Directory keyboard dependent files exist
TARGET_DIR = .

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

ifdef KEYMAP
SRC := keymap_$(KEYMAP).c $(SRC)
else
SRC := keymap_ansi.c $(SRC)
endif

CONFIG_H = config.h


# MCU name
# atmega32u4 Teensy2.0
# atemga32u4 TMK Converter rev.1
# atemga32u2 TMK Converter rev.2
TARGET = adb_usb_teensy
MCU = atmega32u4 MCU = atmega32u4

# Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code.
#
# This will be an integer division of F_USB below, as it is sourced by
# F_USB after it has run through any CPU prescalers. Note that this value
# does not *change* the processor frequency - it should merely be updated to
# reflect the processor speed set externally so that the code can use accurate
# software delays.
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(+60)
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT


# Boot Section Size in *bytes*
# Teensy halfKay 512
# Teensy++ halfKay 1024
# Atmel DFU loader 4096 for TMK Converter rev.1/rev.2
# LUFA bootloader 4096
# USBaspLoader 2048
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
ADB_MOUSE_ENABLE = yes

# ADB Mice need acceleration for todays much bigger screens.
OPT_DEFS += -DADB_MOUSE_MAXACC=8


# Optimize size but this may cause error "relocation truncated to fit"
#EXTRALDFLAGS = -Wl,--relax

# 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
include Makefile

+ 5
- 0
converter/adb_usb/Makefile.unimap.rev1 View File

TARGET = adb_usb_rev1_unimap
UNIMAP_ENABLE = yes
KEYMAP_SECTION_ENABLE = yes
MCU = atmega32u4
include Makefile

+ 5
- 0
converter/adb_usb/Makefile.unimap.rev2 View File

TARGET = adb_usb_rev2_unimap
UNIMAP_ENABLE = yes
KEYMAP_SECTION_ENABLE = yes
MCU = atmega32u2
include Makefile

+ 3
- 3
converter/adb_usb/README.md View File

ADB to USB keyboard converter ADB to USB keyboard converter
============================= =============================
This firmware converts Apple ADB keyboard protocol to USB. You can use TMK Converter, PJRC Teensy2.0 and other USB AVR MCU(ATMega32U4, AT90USB64/128 or etc) for this. But binary size is probably more than 10KB and it won't fit into 8K flash.
This firmware converts Apple ADB keyboard protocol to USB, you can use it to plug old ADB keyboard into modern computer. It works on TMK ADB-USB Converter, PJRC Teensy2.0 and other USB AVR MCU(ATMega32U4, AT90USB64/128 or etc) and needs more than 10KB flash at least.


Discuss: http://geekhack.org/showwiki.php?title=Island:14290
Discuss here: http://geekhack.org/showwiki.php?title=Island:14290


TMK Converter: https://geekhack.org/index.php?topic=72052.0
You can buy a TMK converter here: https://geekhack.org/index.php?topic=72052.0







+ 1286
- 0
converter/adb_usb/binary/adb_usb_rev1_unimap.hex
File diff suppressed because it is too large
View File


+ 1277
- 0
converter/adb_usb/binary/adb_usb_rev2_unimap.hex
File diff suppressed because it is too large
View File


+ 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

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

), ),
}; };


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

+ 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 uint16_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_hasu.c View File

), ),
}; };


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

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

), ),
}; };


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

+ 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),
}; };

+ 213
- 0
converter/adb_usb/unimap_common.h View File

/*
Copyright 2016 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/>.
*/
#ifndef UNIMAP_COMMON_H
#define UNIMAP_COMMON_H

#include <stdint.h>
#include <avr/pgmspace.h>
#include "unimap.h"


/* Apple Extended Keyboard Common layout: ANSI+ISO
* ,---. .---------------. ,---------------. ,---------------. ,-----------. ,---------------.
* |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| |VDn|VUp|Mut|F24|
* `---' `---------------' `---------------' `---------------' `-----------' `---------------'
* ,-----------------------------------------------------------. ,-----------. ,---------------.
* | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backspa| |Ins|Hom|PgU| |NmL| =| /| *|
* |-----------------------------------------------------------| |-----------| |---------------|
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| |Del|End|PgD| | 7| 8| 9| -|
* |-----------------------------------------------------------| `-----------' |---------------|
* |CapsLo| A| S| D| F| G| H| J| K| L| ;| '|Return | | 4| 5| 6| +|
* |-----------------------------------------------------------| ,---. |---------------|
* |Shif|\ | Z| X| C| V| B| N| M| ,| ,| /|Shift | |Up | | 1| 2| 3| |
* |-----------------------------------------------------------| ,-----------. |-----------|Ent|
* |Ctrl |Alt |Gui | Space |Gui |Alt |Ctrl | |Lef|Dow|Rig| | 0| .| |
* `-----------------------------------------------------------' `-----------' `---------------'
* Command = Gui
* Option = Alt
* Power key = F24
* Mic = F13(Adjustable keyboard)
*/
// http://lxr.free-electrons.com/source/drivers/macintosh/adbhid.c
// http://opensource.apple.com//source/IOHIDFamily/IOHIDFamily-701.20.10/IOHIDFamily/Cosmo_USB2ADB.c
// http://m0115.web.fc2.com/m0115.jpg
const uint8_t PROGMEM unimap_trans[MATRIX_ROWS][MATRIX_COLS] = {
// Position(unimap) ADB scan code(matrix)
// ---------------------------------------------
{
UNIMAP_A, // 0x00
UNIMAP_S, // 0x01
UNIMAP_D, // 0x02
UNIMAP_F, // 0x03
UNIMAP_H, // 0x04
UNIMAP_G, // 0x05
UNIMAP_Z, // 0x06
UNIMAP_X, // 0x07
},
{
UNIMAP_C, // 0x08
UNIMAP_V, // 0x09
UNIMAP_NONUS_BSLASH, // 0x0A
UNIMAP_B, // 0x0B
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
UNIMAP_ENTER, // 0x24
UNIMAP_L, // 0x25
UNIMAP_J, // 0x26
UNIMAP_QUOTE, // 0x27
},
{
UNIMAP_K, // 0x28
UNIMAP_SCOLON, // 0x29
UNIMAP_BSLASH, // 0x2A
UNIMAP_COMMA, // 0x2B
UNIMAP_SLASH, // 0x2C
UNIMAP_N, // 0x2D
UNIMAP_M, // 0x2E
UNIMAP_DOT, // 0x2F
},
{
UNIMAP_TAB, // 0x30
UNIMAP_SPACE, // 0x31
UNIMAP_GRAVE, // 0x32
UNIMAP_BSPACE, // 0x33
UNIMAP_KP_ENTER, // 0x34
UNIMAP_ESCAPE, // 0x35
UNIMAP_LCTRL, // 0x36
UNIMAP_LGUI, // 0x37
},
{
UNIMAP_LSHIFT, // 0x38
UNIMAP_CAPSLOCK, // 0x39
UNIMAP_LALT, // 0x3A
UNIMAP_LEFT, // 0x3B
UNIMAP_RIGHT, // 0x3C
UNIMAP_DOWN, // 0x3D
UNIMAP_UP, // 0x3E
UNIMAP_F23, // 0x3F FN?
},
{
UNIMAP_F17, // 0x40
UNIMAP_KP_DOT, // 0x41
UNIMAP_F13, // 0x42 Mic(Adjustable keyboard)
UNIMAP_KP_MINUS, // 0x43 ADB keypad asterisk(top right)
UNIMAP_NO, // 0x44
UNIMAP_KP_COMMA, // 0x45 ADB keypad plus
UNIMAP_NO, // 0x46
UNIMAP_NUMLOCK, // 0x47
},
{
UNIMAP_VOLUME_UP, // 0x48 Vol Up(Adjustable keyboard)
UNIMAP_VOLUME_DOWN, // 0x49 Vol Down(Adjustable keyboard)
UNIMAP_VOLUME_MUTE, // 0x4A Vol Mute(Adjustable keyboard)
UNIMAP_KP_ASTERISK, // 0x4B ADB keypad slash(between equal and asterisk)
UNIMAP_KP_ENTER, // 0x4C
UNIMAP_NO, // 0x4D
UNIMAP_KP_PLUS, // 0x4E ADB keypad minus
UNIMAP_F18, // 0x4F
},
{
UNIMAP_F19, // 0x50
UNIMAP_KP_SLASH, // 0x51 ADB keypad equal(next to clear/numlock)
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_F20, // 0x5A
UNIMAP_KP_8, // 0x5B
UNIMAP_KP_9, // 0x5C
UNIMAP_JYEN, // 0x5D
UNIMAP_RO, // 0x5E
UNIMAP_KP_COMMA, // 0x5F
},
{
UNIMAP_F5, // 0x60
UNIMAP_F6, // 0x61
UNIMAP_F7, // 0x62
UNIMAP_F3, // 0x63
UNIMAP_F8, // 0x64
UNIMAP_F9, // 0x65
UNIMAP_MHEN, // 0x66
UNIMAP_F11, // 0x67
},
{
UNIMAP_HENK, // 0x68
UNIMAP_PSCREEN, // 0x69
UNIMAP_F16, // 0x6A
UNIMAP_SCROLLLOCK, // 0x6B
UNIMAP_NO, // 0x6C
UNIMAP_F10, // 0x6D
UNIMAP_APPLICATION, // 0x6E compose
UNIMAP_F12, // 0x6F
},
{
UNIMAP_NO, // 0x70
UNIMAP_PAUSE, // 0x71
UNIMAP_INSERT, // 0x72
UNIMAP_HOME, // 0x73
UNIMAP_PGUP, // 0x74
UNIMAP_DELETE, // 0x75
UNIMAP_F4, // 0x76
UNIMAP_END, // 0x77
},
{
UNIMAP_F2, // 0x78
UNIMAP_PGDOWN, // 0x79
UNIMAP_F1, // 0x7A
UNIMAP_RSHIFT, // 0x7B
UNIMAP_RALT, // 0x7C
UNIMAP_RCTRL, // 0x7D
UNIMAP_RGUI, // 0x7E
UNIMAP_F24, // 0x7F power key
}
};

#endif

+ 46
- 0
converter/adb_usb/unimap_plain.c View File

/*
Copyright 2016 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 "unimap_common.h"


#define AC_FN0 ACTION_LAYER_TAP_KEY(1, KC_GRV)
#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(
MPLY,NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, PWR,
ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,PAUS, VOLD,VOLU,MUTE,
FN0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, NO, BSPC, INS, HOME,PGUP, NLCK,PEQL,PSLS,PAST,
TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, FN1, DEL, END, PGDN, P7, P8, P9, PMNS,
LCAP,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, RSFT, UP, P1, P2, P3, NO,
LCTL,LGUI,LALT,NO, SPC, NO, NO, RALT,RGUI,NO, RCTL, LEFT,DOWN,RGHT, P0, PDOT,PENT
),
UNIMAP(
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,
TRNS,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
),
};

+ 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



+ 1
- 1
converter/ibm4704_usb/keymap_50key.c View File

), ),
}; };


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





+ 1
- 1
converter/ibm4704_usb/keymap_alps102key.c View File

), ),
}; };


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

+ 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 uint16_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, \

+ 1
- 1
converter/ibm4704_usb/keymap_hasu.c View File

ALT_TAB, ALT_TAB,
}; };


const uint16_t PROGMEM fn_actions[] = {
const action_t PROGMEM fn_actions[] = {
[0] = ACTION_LAYER_MOMENTARY(1), [0] = ACTION_LAYER_MOMENTARY(1),
[1] = ACTION_LAYER_TAP_KEY(2, KC_SCLN), [1] = ACTION_LAYER_TAP_KEY(2, KC_SCLN),
[2] = ACTION_LAYER_TAP_KEY(3, KC_SLASH), [2] = ACTION_LAYER_TAP_KEY(3, KC_SLASH),

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

), ),
}; };


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

+ 32
- 23
converter/m0110_usb/Makefile View File

# Target file name (without extension). # Target file name (without extension).
TARGET = m0110_lufa
TARGET ?= m0110_usb


# Directory common source filess exist # Directory common source filess exist
TMK_DIR = ../../tmk_core
TMK_DIR ?= ../../tmk_core


# Directory keyboard dependent files exist # Directory keyboard dependent files exist
TARGET_DIR = .
TARGET_DIR ?= .


# 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
#
# Keymap file
#
ifdef UNIMAP_ENABLE
KEYMAP_FILE = unimap
else
ifdef ACTIONMAP_ENABLE
KEYMAP_FILE = actionmap
else
KEYMAP_FILE = keymap
endif
endif
ifdef KEYMAP ifdef KEYMAP
SRC += keymap_$(KEYMAP).c
SRC := $(KEYMAP_FILE)_$(KEYMAP).c $(SRC)
else else
SRC += keymap_default.c
SRC := $(KEYMAP_FILE).c $(SRC)
endif endif


CONFIG_H = config.h
CONFIG_H ?= config.h




# MCU name, you MUST set this to match the board you are using # 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 # 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. # Processor frequency.
# so your program will run at the correct speed. You should also set this # 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 # 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. # examples use this variable to calculate timings. Do not add a "UL" here.
F_CPU = 16000000
F_CPU ?= 16000000




# #
# LUFA specific # LUFA specific
# #
# Target architecture (see library "Board Types" documentation). # Target architecture (see library "Board Types" documentation).
ARCH = AVR8
ARCH ?= AVR8


# Input clock frequency. # Input clock frequency.
# This will define a symbol, F_USB, in all source code files equal to the # This will define a symbol, F_USB, in all source code files equal to the
# #
# If no clock division is performed on the input clock inside the AVR (via the # 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. # 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 # Interrupt driven control endpoint task
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
# Build Options # Build Options
# *Comment out* to disable the 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 -------------------------- #---------------- 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 # Search Path

+ 3
- 0
converter/m0110_usb/Makefile.rev1 View File

TARGET = m0110_usb_rev1
MCU = atmega32u4
include Makefile

+ 3
- 0
converter/m0110_usb/Makefile.rev2 View File

TARGET = m0110_usb_rev2
MCU = atmega32u2
include Makefile

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

# 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 \
keymap_common.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

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

# 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 \
keymap_common.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

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

# 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 \
keymap_common.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

+ 6
- 0
converter/m0110_usb/Makefile.unimap.rev1 View File

TARGET = m0110_usb_rev1_unimap
UNIMAP_ENABLE = yes
KEYMAP_SECTION_ENABLE = yes
MCU = atmega32u4
#OPT_DEFS = -DM0110_INTL
include Makefile

+ 6
- 0
converter/m0110_usb/Makefile.unimap.rev2 View File

TARGET = m0110_usb_rev2_unimap
UNIMAP_ENABLE = yes
KEYMAP_SECTION_ENABLE = yes
MCU = atmega32u2
#OPT_DEFS = -DM0110_INTL
include Makefile

+ 15
- 12
converter/m0110_usb/README.md View File



Read README of top directory too. 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) ![M0110+M0120](http://i.imgur.com/dyvXb2Tm.jpg)
![M0110A](http://i.imgur.com/HuHOEoHm.jpg) ![M0110A](http://i.imgur.com/HuHOEoHm.jpg)
- 2013/09: Change port again, it uses inversely `PD0` for data and `PD1` for clock line now. - 2013/09: Change port again, it uses inversely `PD0` for data and `PD1` for clock line now.
- 2014/06: Change keymaps - 2014/06: Change keymaps
- 2015/03: Add support for "International"(ISO) keyboard(keymap_intl.c) - 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].

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/4G2ZOegm.jpg)](http://i.imgur.com/4G2ZOeg.jpg)
[![M0110 Converter](http://i.imgur.com/yEp2eRim.jpg)](http://i.imgur.com/yEp2eRi.jpg)


### 4P4C phone handset cable ### 4P4C phone handset cable
Note that original cable used with Mac is **straight** while phone handset cable is **crossover**. Note that original cable used with Mac is **straight** while phone handset cable is **crossover**.


<http://en.wikipedia.org/wiki/Modular_connector#4P4C> <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/ [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 ### Socket Pinout
$ git clone git://github.com/tmk/tmk_keyboard.git (or download source) $ git clone git://github.com/tmk/tmk_keyboard.git (or download source)
$ cd m0110_usb $ cd m0110_usb
$ make -f Makefile.rev2 clean $ 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 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 Makefile.rev2 KEYMAP=<name>`.

Or you can edit keymap on web browser and download firmware.


http://www.tmk-kbd.com/tmk_keyboard/editor/




Debug Debug

+ 1223
- 0
converter/m0110_usb/binary/m0110_usb_rev1_unimap.hex
File diff suppressed because it is too large
View File


+ 1215
- 0
converter/m0110_usb/binary/m0110_usb_rev2_unimap.hex
File diff suppressed because it is too large
View File


converter/m0110_usb/keymap_default.c → converter/m0110_usb/keymap.c View File

* Fn action definition * Fn action definition
*/ */
#ifdef KEYMAP_SECTION_ENABLE #ifdef KEYMAP_SECTION_ENABLE
const uint16_t fn_actions[] __attribute__ ((section (".keymap.fn_actions"))) = {
const action_t fn_actions[] __attribute__ ((section (".keymap.fn_actions"))) = {
#else #else
const uint16_t fn_actions[] PROGMEM = {
const action_t fn_actions[] PROGMEM = {
#endif #endif
[0] = ACTION_LAYER_MOMENTARY(1), [0] = ACTION_LAYER_MOMENTARY(1),
[1] = ACTION_LAYER_MOMENTARY(2), [1] = ACTION_LAYER_MOMENTARY(2),

+ 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;
}

+ 3
- 8
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 uint16_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
* ,---------------------------------------------------------. ,---------------. * ,---------------------------------------------------------. ,---------------.
* | 32| 12| 13| 14| 15| 17| 16| 1A| 1C| 19| 1D| 1B| 18| 33| | 47| 68| 6D| 62| * | 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| * | 39| 00| 01| 02| 03| 05| 04| 26| 28| 25| 29| 27| 24| | 56| 57| 58| 66|
* |---------------------------------------------------------| |---------------| * |---------------------------------------------------------| |---------------|
* ,---------------------------------------------------------. ,---------------. * ,---------------------------------------------------------. ,---------------.
* | 32| 12| 13| 14| 15| 17| 16| 1A| 1C| 19| 1D| 1B| 18| 33| | 47| 68| 6D| 62| * | 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| * | 39| 00| 01| 02| 03| 05| 04| 26| 28| 25| 29| 27| 24| | 56| 57| 58| 66|
* |---------------------------------------------------------| |---------------| * |---------------------------------------------------------| |---------------|
* ,---------------------------------------------------------. ,---------------. * ,---------------------------------------------------------. ,---------------.
* | 32| 12| 13| 14| 15| 17| 16| 1A| 1C| 19| 1D| 1B| 18| 33| | 47| 68| 6D| 62| * | 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| * | 39| 00| 01| 02| 03| 05| 04| 26| 28| 25| 29| 27| 24| | | 56| 57| 58| 66|
* |---------------------------------------------------------| |---------------| * |---------------------------------------------------------| |---------------|

+ 0
- 87
converter/m0110_usb/keymap_hasu.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 <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 uint16_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),
};

+ 1
- 1
converter/m0110_usb/keymap_intl.c View File

/* /*
* Fn action definition * Fn action definition
*/ */
const uint16_t fn_actions[] PROGMEM = {
const action_t fn_actions[] PROGMEM = {
[0] = ACTION_LAYER_MOMENTARY(1), [0] = ACTION_LAYER_MOMENTARY(1),
}; };

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

/* /*
* Fn action definition * Fn action definition
*/ */
const uint16_t fn_actions[] PROGMEM = {
const action_t fn_actions[] PROGMEM = {
[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
}; };

+ 48
- 0
converter/m0110_usb/unimap.c View File

/*
Copyright 2016 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 "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
),
};


+ 244
- 0
converter/m0110_usb/unimap_trans.h View File

/*
Copyright 2016 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/>.
*/
#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


+ 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]);
}

+ 33
- 15
converter/next_usb/Makefile View File

# Target file name (without extension). # Target file name (without extension).
TARGET = next_usb
TARGET ?= next_usb


# Directory common source filess exist # Directory common source filess exist
TMK_DIR = ../../tmk_core
TMK_DIR ?= ../../tmk_core


# Directory keyboard dependent files exist # Directory keyboard dependent files exist
TARGET_DIR = .
TARGET_DIR ?= .


# keyboard dependent files # keyboard dependent files
SRC = keymap.c \
matrix.c \
SRC ?= matrix.c \
led.c led.c


CONFIG_H = config.h
CONFIG_H ?= config.h

#
# Keymap file
#
ifeq (yes,$(strip $(UNIMAP_ENABLE)))
KEYMAP_FILE = unimap
else
ifeq (yes,$(strip $(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



# MCU name, you MUST set this to match the board you are using # 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 # type "make clean" after changing this, so all files will be rebuilt
#MCU = atmega32u4 # Teensy 2.0 #MCU = atmega32u4 # Teensy 2.0
#MCU = at90usb646 # Teensy++ 1.0 #MCU = at90usb646 # Teensy++ 1.0
#MCU = at90usb1286 # Teensy++ 2.0 #MCU = at90usb1286 # Teensy++ 2.0
MCU = atmega32u2 # TMK converter
MCU ?= atmega32u2 # TMK converter




# Processor frequency. # Processor frequency.
# so your program will run at the correct speed. You should also set this # 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 # 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. # examples use this variable to calculate timings. Do not add a "UL" here.
F_CPU = 16000000
F_CPU ?= 16000000




# #
# LUFA specific # LUFA specific
# #
# Target architecture (see library "Board Types" documentation). # Target architecture (see library "Board Types" documentation).
ARCH = AVR8
ARCH ?= AVR8


# Input clock frequency. # Input clock frequency.
# This will define a symbol, F_USB, in all source code files equal to the # This will define a symbol, F_USB, in all source code files equal to the
# #
# If no clock division is performed on the input clock inside the AVR (via the # 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. # 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(+60) # Interrupt driven control endpoint task(+60)
#OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT #OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
# *Comment out* to disable the options. # *Comment out* to disable the options.
# #
#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) #BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE = yes # Mouse keys
EXTRAKEY_ENABLE = yes # Audio control and System control
CONSOLE_ENABLE = yes # Console for debug(+400)
COMMAND_ENABLE = yes # Commands for debug and configuration
#NKRO_ENABLE = yes # USB Nkey Rollover
MOUSEKEY_ENABLE ?= yes # Mouse keys
EXTRAKEY_ENABLE ?= yes # Audio control and System control
CONSOLE_ENABLE ?= yes # Console for debug(+400)
COMMAND_ENABLE ?= yes # Commands for debug and configuration
#NKRO_ENABLE ?= yes # USB Nkey Rollover


SRC += next_kbd.c SRC += next_kbd.c



+ 4
- 0
converter/next_usb/Makefile.unimap View File

TARGET = next_usb_unimap
UNIMAP_ENABLE = yes
KEYMAP_SECTION_ENABLE = yes
include Makefile

+ 1217
- 0
converter/next_usb/binary/next_usb_unimap.hex
File diff suppressed because it is too large
View File


+ 20
- 33
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 uint16_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
* ,-----------------------------------------------------------. ,-----------. ,---------------. * ,-----------------------------------------------------------. ,-----------. ,---------------.
* |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| BS | |Ins|Ref|Hom| |` | =| /| *|
* |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| BS | |VoU|Mut|PgU| | `| \| /| *|
* |-----------------------------------------------------------| |-----------| |---------------| * |-----------------------------------------------------------| |-----------| |---------------|
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| | |Del| |End| | 7| 8| 9| -|
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| | |VoD| |PgD| | 7| 8| 9| -|
* |-----------------------------------------------------' | `---' `---' |-----------|---| * |-----------------------------------------------------' | `---' `---' |-----------|---|
* |Ctrl | A| S| D| F| G| H| J| K| L| ;| '| Return| | 4| 5| 6| +| * |Ctrl | A| S| D| F| G| H| J| K| L| ;| '| Return| | 4| 5| 6| +|
* |-----------------------------------------------------------| ,---. |---------------| * |-----------------------------------------------------------| ,---. |---------------|
* |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | |Up | | 1| 2| 3| | * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | |Up | | 1| 2| 3| |
* |-----------------------------------------------------------| ,-----------. |-----------|Ent| * |-----------------------------------------------------------| ,-----------. |-----------|Ent|
* |Fn0 |Alt | Space |LGui |Fn1 | |Lef|Dow|Rig| | 0| .| |
* |LAlt |LGui | Space |FN0 |RAlt | |Lef|Dow|Rig| | 0| .| |
* `-----------------------------------------------------------' `-----------' `---------------' * `-----------------------------------------------------------' `-----------' `---------------'
*/ */
KEYMAP( KEYMAP(
ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, INS, WREF,HOME, GRV, FN3, FN2, PAST,
TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,NO, DEL, END, P7, P8, P9, PMNS,
ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, VOLU,MUTE,PGUP, GRV, BSLS,PSLS,PAST,
TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, VOLD, PGDN, P7, P8, P9, PMNS,
LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT, P4, P5, P6, PPLS, LCTL,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, RSFT, UP, P1, P2, P3, LSFT, Z, X, C, V, B, N, M, COMM,DOT, SLSH, RSFT, UP, P1, P2, P3,
FN0, LALT, SPC, LGUI,FN1, LEFT,DOWN,RGHT, P0, PDOT,PENT
LALT,LGUI, SPC, FN0, RALT, LEFT,DOWN,RGHT, P0, PDOT,PENT
), ),


/* Layer 1: extra keys
/* Layer 1: HHKB like
* ,-----------------------------------------------------------. ,-----------. ,---------------. * ,-----------------------------------------------------------. ,-----------. ,---------------.
* |Grv| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| BS | |VUp|VMu|PgU| |` | =| /| *|
* | `| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| Del | | | | | |Num| | | |
* |-----------------------------------------------------------| |-----------| |---------------| * |-----------------------------------------------------------| |-----------| |---------------|
* |Tab |Pau| W| E| R| T| Y| U| I| O|PSc| \| ]| | |VDn| |PgD| | 7| 8| 9| -|
* |Caps | \| | | | | | |Psc|Slk|Pau|Up |Ins| | | | | | | | | | |
* |-----------------------------------------------------' | `---' `---' |-----------|---| * |-----------------------------------------------------' | `---' `---' |-----------|---|
* |Ctrl | A| S| D| F| G| H| J| K| L| ;| '| Return| | 4| 5| 6| +|
* | |VoD|VoU|Mut| | | *| /|Hom|PgU|Lef|Rig| | | | | | |
* |-----------------------------------------------------------| ,---. |---------------| * |-----------------------------------------------------------| ,---. |---------------|
* |Shift |UND|CUT|COP|PST| B| N| M| ,| .| /|Shift | |Up | | 1| 2| 3| |
* |-----------------------------------------------------------| ,-----------. |-----------|Ent|
* |Fn0 |Alt | Space |RGui |Fn1 | |Lef|Dow|Rig| | 0| .| |
* | |UND|CUT|COP|PST| | +| -|End|PgD|Dow| | |PgU| | | | | |
* |-----------------------------------------------------------| ,-----------. |-----------| |
* | | | | | | |Hom|PgD|End| | | | |
* `-----------------------------------------------------------' `-----------' `---------------' * `-----------------------------------------------------------' `-----------' `---------------'
*/ */
KEYMAP( KEYMAP(
GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, VOLU,MUTE,PGUP, TRNS,TRNS,TRNS,TRNS,
TRNS,PAUS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PSCR,FN3, BSLS,TRNS, VOLD, PGDN, BTN1,MS_U,BTN2,WH_U,
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, MS_L,MS_D,MS_R,WH_D,
TRNS, FN4, FN5, FN6, FN7, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, TRNS, TRNS,TRNS,TRNS,
TRNS,TRNS, TRNS, TRNS,TRNS, TRNS,TRNS,TRNS, TRNS, TRNS,TRNS
GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, DEL, TRNS,TRNS,TRNS, NLCK,TRNS,TRNS,TRNS,
CAPS,BSLS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PSCR,SLCK,PAUS,UP, INS, TRNS, TRNS, TRNS, TRNS,TRNS,TRNS,TRNS,
TRNS,VOLD,VOLU,MUTE,TRNS,TRNS,PAST,PSLS,HOME,PGUP,LEFT,RGHT, TRNS, TRNS,TRNS,TRNS,TRNS,
TRNS, FN4, FN5, FN6, FN7, TRNS,PPLS,PMNS,END, PGDN,DOWN, TRNS, PGUP, TRNS,TRNS,TRNS,
TRNS,TRNS, TRNS, TRNS,TRNS, HOME,PGDN,END, TRNS, TRNS,TRNS
) )
}; };

/* 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)]) };
}

+ 50
- 0
converter/next_usb/unimap.c View File

/*
Copyright 2016 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 "unimap_trans.h"


#define AC_FN0 ACTION_LAYER_MOMENTARY(1)
// Undo, Cut, Copy and Paste
#define AC__UND ACTION_MODS_KEY(MOD_LCTL, KC_Z)
#define AC__CUT ACTION_MODS_KEY(MOD_LCTL, KC_X)
#define AC__CPY ACTION_MODS_KEY(MOD_LCTL, KC_C)
#define AC__PST ACTION_MODS_KEY(MOD_LCTL, KC_V)

#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,
ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, NO, BSPC, VOLU,MUTE,PGUP, GRV, BSLS,PSLS,PAST,
TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, BSLS, VOLD,NO, PGDN, P7, P8, P9, PMNS,
LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT, NO, ENT, P4, P5, P6, PPLS,
LSFT,NO, Z, X, C, V, B, N, M, COMM,DOT, SLSH, NO, RSFT, UP, P1, P2, P3, NO,
LALT,LGUI,NO, NO, SPC, NO, NO, NO, NO, FN0, RALT, LEFT,DOWN,RGHT, P0, PDOT,PENT
),
UNIMAP(
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,
GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS,DEL, TRNS,TRNS,TRNS, NLCK,TRNS,TRNS,TRNS,
CAPS,BSLS,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,PAST,PSLS,HOME,PGUP,LEFT,RGHT, TRNS,TRNS, TRNS,TRNS,TRNS,TRNS,
TRNS,TRNS,_UND,_CUT,_CPY,_PST,TRNS,PPLS,PMNS,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
),
};

+ 86
- 0
converter/next_usb/unimap_trans.h View File

/*
Copyright 2016 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/>.
*/
#ifndef UNIMAP_COMMON_H
#define UNIMAP_COMMON_H

#include <stdint.h>
#include <avr/pgmspace.h>
#include "unimap.h"


/* Mapping to Universal keyboard layout
*
* Universal keyboard layout
* ,-----------------------------------------------.
* |F13|F14|F15|F16|F17|F18|F19|F20|F21|F22|F23|F24|
* ,---. |-----------------------------------------------| ,-----------. ,-----------.
* |Esc| |F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12| |PrS|ScL|Pau| |VDn|VUp|Mut|
* `---' `-----------------------------------------------' `-----------' `-----------'
* ,-----------------------------------------------------------. ,-----------. ,---------------.
* | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|JPY|Bsp| |Ins|Hom|PgU| |NmL| /| *| -|
* |-----------------------------------------------------------| |-----------| |---------------|
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | |Del|End|PgD| | 7| 8| 9| +|
* |-----------------------------------------------------------| `-----------' |---------------|
* |CapsL | A| S| D| F| G| H| J| K| L| ;| '| #|Retn| | 4| 5| 6|KP,|
* |-----------------------------------------------------------| ,---. |---------------|
* |Shft| <| Z| X| C| V| B| N| M| ,| .| /| RO|Shift | |Up | | 1| 2| 3|KP=|
* |-----------------------------------------------------------| ,-----------. |---------------|
* |Ctl|Gui|Alt|MHEN| Space |HENK|KANA|Alt|Gui|App|Ctl| |Lef|Dow|Rig| | 0 | .|Ent|
* `-----------------------------------------------------------' `-----------' `---------------'
*
* NeXT Matrix(Scan code)
* ,-----------------------------------------------------------. ,-----------. ,---------------.
* | 49| 4A| 4B| 4C| 4D| 50| 4F| 4E| 1E| 1F| 20| 1D| 1C| 1B | | 1A| 58| 19| | 26| 27| 28| 25|
* |-----------------------------------------------------------| |-----------| |---------------|
* | 41 | 42| 43| 44| 45| 48| 47| 46| 06| 07| 08| 05| 04| 03 | | 02| | 01| | 21| 22| 23| 24|
* |-----------------------------------------------------------| `---' `---' |-----------|---|
* | 57 | 39| 3A| 3B| 3C| 3D| 40| 3F| 3E| 2D| 2C| 2B| 2A | | 12| 18| 13| 15|
* |-----------------------------------------------------------| ,---. |---------------|
* | 56 | 31| 32| 33| 34| 35| 37| 36| 2E| 2F| 30| 55 | | 16| | 11| 17| 14| |
* |-----------------------------------------------------------| ,-----------. |-----------| |
* | 52 | 54 | 38 | 53 | 51 | | 09| 0F| 10| |0B | 0C| 0D|
* `-----------------------------------------------------------' `-----------' `---------------'
* ,-----------------------------------------------------------. ,-----------. ,---------------.
* | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| BSpc | |Ins|Hom|PgU| |NmL| /| *| -|
* |-----------------------------------------------------------| |-----------| |---------------|
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | |Del| |PgD| | 7| 8| 9| +|
* |-----------------------------------------------------------| `---' `---' |---------------|
* |CapsL | A| S| D| F| G| H| J| K| L| ;| '| Return| | 4| 5| 6|KP,|
* |-----------------------------------------------------------| ,---. |---------------|
* |Shft| <| Z| X| C| V| B| N| M| ,| .| /| Shift | |Up | | 1| 2| 3| |
* |-----------------------------------------------------------| ,-----------. |-----------| |
* |LCtl |Gui | Space | App | RCtl| |Lef|Dow|Rig| | 0 | .|Ent|
* `-----------------------------------------------------------' `-----------' `---------------'
*/

// Matrix 12 * 8
const uint8_t PROGMEM unimap_trans[MATRIX_ROWS][MATRIX_COLS] = {
{ UNIMAP_NO, UNIMAP_PGDN, UNIMAP_DEL, UNIMAP_BSLS, UNIMAP_RBRC, UNIMAP_LBRC, UNIMAP_I, UNIMAP_O }, // 0x00-07
{ UNIMAP_P, UNIMAP_LEFT, UNIMAP_NO, UNIMAP_P0, UNIMAP_PDOT, UNIMAP_PENT, UNIMAP_NO, UNIMAP_DOWN }, // 0x08-0F
{ UNIMAP_RGHT, UNIMAP_P1, UNIMAP_P4, UNIMAP_P6, UNIMAP_P3, UNIMAP_PCMM, UNIMAP_UP, UNIMAP_P2 }, // 0x10-17
{ UNIMAP_P5, UNIMAP_PGUP, UNIMAP_INS, UNIMAP_BSPC, UNIMAP_EQL, UNIMAP_MINS, UNIMAP_8, UNIMAP_9 }, // 0x18-1f
{ UNIMAP_0, UNIMAP_P7, UNIMAP_P8, UNIMAP_P9, UNIMAP_PPLS, UNIMAP_PMNS, UNIMAP_NLCK, UNIMAP_PSLS }, // 0x20-27
{ UNIMAP_PAST, UNIMAP_NO, UNIMAP_ENT, UNIMAP_QUOT, UNIMAP_SCLN, UNIMAP_L, UNIMAP_COMM, UNIMAP_DOT }, // 0x28-2f
{ UNIMAP_SLSH, UNIMAP_Z, UNIMAP_X, UNIMAP_C, UNIMAP_V, UNIMAP_B, UNIMAP_M, UNIMAP_N }, // 0x30-37
{ UNIMAP_SPC, UNIMAP_A, UNIMAP_S, UNIMAP_D, UNIMAP_F, UNIMAP_G, UNIMAP_K, UNIMAP_J }, // 0x38-3f
{ UNIMAP_H, UNIMAP_TAB, UNIMAP_Q, UNIMAP_W, UNIMAP_E, UNIMAP_R, UNIMAP_U, UNIMAP_Y }, // 0x40-47
{ UNIMAP_T, UNIMAP_GRV, UNIMAP_1, UNIMAP_2, UNIMAP_3, UNIMAP_4, UNIMAP_7, UNIMAP_6 }, // 0x48-4f
{ UNIMAP_5, UNIMAP_RCTL, UNIMAP_LCTL, UNIMAP_APP, UNIMAP_LGUI, UNIMAP_RSFT, UNIMAP_LSFT, UNIMAP_CAPS }, // 0x50-57
{ UNIMAP_HOME, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO } // 0x58-5f
};

#endif

+ 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 uint16_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 uint16_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, \

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

), ),
}; };


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

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

), ),
}; };


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

+ 1
- 1
converter/ps2_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
}; };

+ 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]);
}

+ 28
- 18
converter/usb_usb/Makefile View File

#---------------------------------------------------------------------------- #----------------------------------------------------------------------------


# Target file name (without extension). # Target file name (without extension).
TARGET = usb_usb
TARGET ?= usb_usb


TMK_DIR = ../../tmk_core
TMK_DIR ?= ../../tmk_core


# Directory keyboard dependent files exist # Directory keyboard dependent files exist
TARGET_DIR = .
TARGET_DIR ?= .


# MCU name # MCU name
MCU = atmega32u4
MCU ?= atmega32u4




# Processor frequency. # Processor frequency.
# does not *change* the processor frequency - it should merely be updated to # does not *change* the processor frequency - it should merely be updated to
# reflect the processor speed set externally so that the code can use accurate # reflect the processor speed set externally so that the code can use accurate
# software delays. # software delays.
F_CPU = 16000000
F_CPU ?= 16000000






# LUFA specific # LUFA specific
# #
# Target architecture (see library "Board Types" documentation). # Target architecture (see library "Board Types" documentation).
ARCH = AVR8
ARCH ?= AVR8
# Input clock frequency. # Input clock frequency.
# This will define a symbol, F_USB, in all source code files equal to the # 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 # input clock frequency (before any prescaling is performed) in Hz. This value may
# #
# If no clock division is performed on the input clock inside the AVR (via the # 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. # 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 # Interrupt driven control endpoint task
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT


# Build Options # Build Options
# comment out to disable the options. # comment out to disable the options.
# #
MOUSEKEY_ENABLE = yes # Mouse keys
EXTRAKEY_ENABLE = yes # Media control and System control
CONSOLE_ENABLE = yes # Console for debug
#COMMAND_ENABLE = yes # Commands for debug and configuration
#NKRO_ENABLE = yes # USB Nkey Rollover
MOUSEKEY_ENABLE ?= yes # Mouse keys
EXTRAKEY_ENABLE ?= yes # Media control and System control
CONSOLE_ENABLE ?= yes # Console for debug
#COMMAND_ENABLE ?= yes # Commands for debug and configuration
#NKRO_ENABLE ?= yes # USB Nkey Rollover


# Boot Section Size in bytes # Boot Section Size in bytes
# Teensy halfKay 512 # Teensy halfKay 512
#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


#
# Keymap file
#
ifeq (yes,$(strip $(UNIMAP_ENABLE)))
KEYMAP_FILE = unimap
else
ifeq (yes,$(strip $(ACTIONMAP_ENABLE)))
KEYMAP_FILE = actionmap
else
KEYMAP_FILE = keymap
endif
endif
ifdef KEYMAP ifdef KEYMAP
SRC := keymap_$(KEYMAP).c $(SRC)
SRC := $(KEYMAP_FILE)_$(KEYMAP).c $(SRC)
else else
SRC := keymap.c $(SRC)
SRC := $(KEYMAP_FILE).c $(SRC)
endif endif


CONFIG_H = config.h
CONFIG_H ?= config.h







+ 4
- 0
converter/usb_usb/Makefile.unimap View File

TARGET = usb_usb_unimap
UNIMAP_ENABLE = yes
KEYMAP_SECTION_ENABLE = yes
include Makefile

+ 33
- 7
converter/usb_usb/README View File

USB to USB keyboard protocol converter USB to USB keyboard protocol converter
====================================== ======================================
See for detail and discussion.
https://geekhack.org/index.php?topic=69169.0



Hardware requirement Hardware requirement
-------------------- --------------------
Arduino Leonardo
http://arduino.cc/en/Main/ArduinoBoardLeonardo
There are two options.

### TMK USB-USB Converter
You can buy a fully assembled converter from me here.

https://geekhack.org/index.php?topic=69169.0


Circuit@Home USB Host Shield 2.0
### Arduino Leonardo + Circuit@Home USB Host Shield 2.0
Buying Arduino Leonardo and USB Host Shield 2.0(from Circuit@home) will be better, you won't need even soldering iron.

http://arduino.cc/en/Main/ArduinoBoardLeonardo
https://www.circuitsathome.com/products-page/arduino-shields/usb-host-shield-2-0-for-arduino-assembled/ https://www.circuitsathome.com/products-page/arduino-shields/usb-host-shield-2-0-for-arduino-assembled/


Buying Arduino Leonardo and USB Host Shield 2.0(from Circuit@home) will be the easiest way, you won't need even soldering iron.
Arduino's Shield will also work well but I think Sparkfun's needs to be modified.
Other compatible boards like Arduino's Shield will also work well but I think Sparkfun's needs to be modified.


http://arduino.cc/en/Main/ArduinoUSBHostShield http://arduino.cc/en/Main/ArduinoUSBHostShield
https://www.sparkfun.com/products/9947 https://www.sparkfun.com/products/9947


Also Pro Micro 3.3V(not Mini) or Teensy with mini host shield will work with some fixes on signal/power routing. Also Pro Micro 3.3V(not Mini) or Teensy with mini host shield will work with some fixes on signal/power routing.

https://www.circuitsathome.com/products-page/arduino-shields/usb-host-shield-for-arduino-pro-mini https://www.circuitsathome.com/products-page/arduino-shields/usb-host-shield-for-arduino-pro-mini
https://www.sparkfun.com/products/12587 https://www.sparkfun.com/products/12587
https://www.pjrc.com/teensy/td_libs_USBHostShield.html https://www.pjrc.com/teensy/td_libs_USBHostShield.html


Build firmware Build firmware
-------------- --------------
Build.

$ git clone git://github.com/tmk/tmk_keyboard.git $ git clone git://github.com/tmk/tmk_keyboard.git
$ cd tmk_keyboard $ cd tmk_keyboard
$ git submodule init $ git submodule init
$ cd converter/usb_usb $ cd converter/usb_usb
$ make $ make


Program converter. Push reset button on Leonardo before run this command. Serial port name(COM17) depends your system. On Linux I got /dev/ttyACM0.
And Program converter. Push button on TMK converter and just run this.

$ make dfu


In case of Leonardo push reset button then run command. Serial port name(COM17) depends your system. On Linux I got /dev/ttyACM0.


$ DEV=COM17 make program $ DEV=COM17 make program
or or
Only supports 'HID Boot protocol'. Only supports 'HID Boot protocol'.
Not support keyboard LED yet. Not support keyboard LED yet.


Note that the converter can host only USB "boot protocol" keyboard(6KRO) and not NKRO, it is possible to support NKRO keyboard but you will need to write HID report parser for that. Every NKRO keyboard can have different HID report and it is difficult to support all kind of NKRO keyboards in the market.
Note that the converter can host only USB "boot protocol" keyboard(6KRO), not NKRO, it is possible to support NKRO keyboard but you will need to write HID report parser for that. Every NKRO keyboard can have different HID report and it is difficult to support all kind of NKRO keyboards in the market.



Keymap editor
-------------
You can editor keymap and download firmware with web brwoser.

- http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?usb_usb






Update Update
------ ------
2014/12/11 Added Hub support(confirmed with HHKB pro2) 2014/12/11 Added Hub support(confirmed with HHKB pro2)
2016/09/10 Unimap editor support







+ 1615
- 0
converter/usb_usb/binary/usb_usb_unimap.hex
File diff suppressed because it is too large
View File


+ 146
- 2
converter/usb_usb/keymap.c View File

LSFT,NUBS,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RO, RSFT, UP, P1, P2, P3, PEQL, EXEC,PSTE, LSFT,NUBS,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RO, RSFT, UP, P1, P2, P3, PEQL, EXEC,PSTE,
LCTL,LGUI,LALT,MHEN,HANJ, SPC, HAEN,HENK,KANA,RALT,RGUI,APP, RCTL, LEFT,DOWN,RGHT, P0, PDOT,PENT, FIND,CUT LCTL,LGUI,LALT,MHEN,HANJ, SPC, HAEN,HENK,KANA,RALT,RGUI,APP, RCTL, LEFT,DOWN,RGHT, P0, PDOT,PENT, FIND,CUT
), ),
};

const action_t fn_actions[] PROGMEM = {};




/*
* Keymap samples
*/
#if 0 #if 0
/* ANSI layout
* ,---. ,---------------. ,---------------. ,---------------. ,-----------.
* |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau|
* `---' `---------------' `---------------' `---------------' `-----------'
* ,-----------------------------------------------------------. ,-----------. ,---------------.
* | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| Bsp| |Ins|Hom|PgU| |NmL| /| *| -|
* |-----------------------------------------------------------| |-----------| |---------------|
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | |Del|End|PgD| | 7| 8| 9| +|
* |-----------------------------------------------------------| `-----------' |-----------| |
* |CapsL | A| S| D| F| G| H| J| K| L| ;| '| Return| | 4| 5| 6| |
* |-----------------------------------------------------------| ,---. |---------------|
* |Shift | Z| X| C| V| B| N| M| ,| ,| /|Shift | |Up | | 1| 2| 3| |
* |-----------------------------------------------------------| ,-----------. |-----------| |
* |Ctl|Gui|Alt| Space |Alt|Gui|App|Ctl| |Lef|Dow|Rig| | 0| .|Ent|
* `-----------------------------------------------------------' `-----------' `---------------'
*/
KEYMAP(
ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,BRK,
GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS,
TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, DEL, END, PGDN, P7, P8, P9,
LCTL,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, RSFT, UP, P1, P2, P3,
LCTL,LGUI,LALT, SPC, RALT,RGUI,APP, RCTL, LEFT,DOWN,RGHT, P0, PDOT,PENT
),

/* ISO layout
* ,---. ,---------------. ,---------------. ,---------------. ,-----------.
* |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau|
* `---' `---------------' `---------------' `---------------' `-----------'
* ,-----------------------------------------------------------. ,-----------. ,---------------.
* | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| ^| Bsp| |Ins|Hom|PgU| |NmL| /| *| -|
* |-----------------------------------------------------------| |-----------| |---------------|
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| Retn| |Del|End|PgD| | 7| 8| 9| +|
* |------------------------------------------------------` | `-----------' |-----------| |
* |CapsL | A| S| D| F| G| H| J| K| L| ;| '| #| | | 4| 5| 6| |
* |-----------------------------------------------------------| ,---. |---------------|
* |Shft|\ | Z| X| C| V| B| N| M| ,| ,| /|Shift | |Up | | 1| 2| 3|Ent|
* |-----------------------------------------------------------| ,-----------. |-----------| |
* |Ctl|Gui|Alt| Space |HNK|KNA|Alt|Gui|App|Ctl| |Lef|Dow|Rig| | 0| .| |
* `-----------------------------------------------------------' `-----------' `---------------'
*/
KEYMAP_ISO(
ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,BRK,
GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS,
TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,ENT, DEL, END, PGDN, P7, P8, P9, PPLS,
LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT,NUHS, P4, P5, P6,
LSFT,NUBS,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RSFT, UP, P1, P2, P3, PENT,
LCTL,LGUI,LALT, SPC, RALT,RGUI,APP, RCTL, LEFT,DOWN,RGHT, P0, PDOT
),

/* JIS layout
* ,---. ,---------------. ,---------------. ,---------------. ,-----------.
* |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau|
* `---' `---------------' `---------------' `---------------' `-----------'
* ,-----------------------------------------------------------. ,-----------. ,---------------.
* | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| ^|JPY|Bsp| |Ins|Hom|PgU| |NmL| /| *| -|
* |-----------------------------------------------------------| |-----------| |---------------|
* |Tab | Q| W| E| R| T| Y| U| I| O| P| @| [| Retn| |Del|End|PgD| | 7| 8| 9| +|
* |------------------------------------------------------` | `-----------' |-----------| |
* |CapsL | A| S| D| F| G| H| J| K| L| ;| :| ]| | | 4| 5| 6| |
* |-----------------------------------------------------------| ,---. |---------------|
* |Shft | Z| X| C| V| B| N| M| ,| ,| /| RO|Shift | |Up | | 1| 2| 3|Ent|
* |-----------------------------------------------------------| ,-----------. |-----------| |
* |Ctl|Gui|Alt|MHEN| Space |HENK|KNA|Alt|Gui|App|Ctl| |Lef|Dow|Rig| | 0| .| |
* `-----------------------------------------------------------' `-----------' `---------------'
*/
KEYMAP_JIS(
ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,BRK,
GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, JPY, BSPC, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS,
TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, ENT, DEL, END, PGDN, P7, P8, P9, PPLS,
LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT,NUHS, P4, P5, P6,
LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RO, RSFT, UP, P1, P2, P3, PENT,
LCTL,LGUI,LALT,MHEN, SPC, HENK,KANA,RALT,RGUI,APP, RCTL, LEFT,DOWN,RGHT, P0, PDOT
),

/* Colemak http://colemak.com /* Colemak http://colemak.com
* ,-----------------------------------------------------------. * ,-----------------------------------------------------------.
* | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backspa| * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backspa|
LSFT,NUBS,Z, X, M, C, V, K, L, COMM,DOT, SLSH, RO, RSFT, UP, P1, P2, P3, PEQL, EXEC,PSTE, LSFT,NUBS,Z, X, M, C, V, K, L, COMM,DOT, SLSH, RO, RSFT, UP, P1, P2, P3, PEQL, EXEC,PSTE,
LCTL,LGUI,LALT,MHEN,HANJ, SPC, HAEN,HENK,KANA,RALT,RGUI,APP, RCTL, LEFT,DOWN,RGHT, P0, PDOT,PENT, FIND,CUT LCTL,LGUI,LALT,MHEN,HANJ, SPC, HAEN,HENK,KANA,RALT,RGUI,APP, RCTL, LEFT,DOWN,RGHT, P0, PDOT,PENT, FIND,CUT
), ),
#endif


/*
* SpaceFN layout
* http://geekhack.org/index.php?topic=51069.0
*/
const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* 0: plain Qwerty
* ,---------------. ,---------------. ,---------------.
* |F13|F14|F15|F16| |F17|F18|F19|F20| |F21|F22|F23|F24|
* ,---. |---------------| |---------------| |---------------| ,-----------. ,---------------. ,-------.
* |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| |VDn|VUp|Mut|Pwr| | Help |
* `---' `---------------' `---------------' `---------------' `-----------' `---------------' `-------'
* ,-----------------------------------------------------------. ,-----------. ,---------------. ,-------.
* | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|JPY|Bsp| |Ins|Hom|PgU| |NmL| /| *| -| |Stp|Agn|
* |-----------------------------------------------------------| |-----------| |---------------| |-------|
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | |Del|End|PgD| | 7| 8| 9| +| |Mnu|Und|
* |-----------------------------------------------------------| `-----------' |---------------| |-------|
* |LCtrl | A| S| D| F| G| H| J| K| L| ;| :| #|Retn| | 4| 5| 6|KP,| |Sel|Cpy|
* |-----------------------------------------------------------| ,---. |---------------| |-------|
* |Shft| <| Z| X| C| V| B| N| M| ,| ,| /| RO|Shift | |Up | | 1| 2| 3|KP=| |Exe|Pst|
* |-----------------------------------------------------------| ,-----------. |---------------| |-------|
* |Ctl|Gui|Alt|MHEN|HNJ| Space |H/E|HENK|KANA|Alt|Gui|App|Ctl| |Lef|Dow|Rig| | 0 | .|Ent| |Fnd|Cut|
* `-----------------------------------------------------------' `-----------' `---------------' `-------'
*/
[0] = KEYMAP_ALL(
F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24,
ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,PAUS, VOLD,VOLU,MUTE,PWR, HELP,
ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, JYEN,BSPC, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS, STOP,AGIN,
TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, BSLS, DEL, END, PGDN, P7, P8, P9, PPLS, MENU,UNDO,
LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT, NUHS,ENT, P4, P5, P6, PCMM, SLCT,COPY,
LSFT,NUBS,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RO, RSFT, UP, P1, P2, P3, PEQL, EXEC,PSTE,
LCTL,LGUI,LALT,MHEN,HANJ, FN0, HAEN,HENK,KANA,RALT,RGUI,APP, RCTL, LEFT,DOWN,RGHT, P0, PDOT,PENT, FIND,CUT
),

/* 1: SpaceFN
* ,-----------------------------------------------------------.
* |` | F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Delete |
* |-----------------------------------------------------------|
* |Caps | | |Esc| | | |Hom|Up |End|Psc|Slk|Pau|Ins |
* |-----------------------------------------------------------|
* | | | | | | |PgU|Lef|Dow|Rig| | | |
* |-----------------------------------------------------------|
* | | | | | |Spc|PgD|` |~ | |Men| |
* |-----------------------------------------------------------|
* | | | | | | | | |
* `-----------------------------------------------------------'
*/
[1] = KEYMAP_ALL(
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS, TRNS,
GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS,DEL, TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,
CAPS,TRNS,TRNS,ESC, TRNS,TRNS,TRNS,HOME,UP, END, PSCR,SLCK,PAUS, INS, TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PGUP,LEFT,DOWN,RGHT,TRNS,TRNS, TRNS,TRNS, TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,SPC, PGDN,GRV, FN1, TRNS,APP, TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,
TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS, TRNS, TRNS,TRNS, TRNS,TRNS
),
}; };


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

#endif

+ 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 uint16_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|
* ,---. |---------------| |---------------| |---------------| ,-----------. ,---------------. ,-------. * ,---. |---------------| |---------------| |---------------| ,-----------. ,---------------. ,-------.

+ 0
- 88
converter/usb_usb/keymap_editor.c View File

/*
Copyright 2016 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"


#ifndef KEYMAP_SECTION_ENABLE
#error "KEYMAP_SECTION_ENABLE is not defined."
#endif

const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] __attribute__ ((section (".keymap.keymaps"))) = {
/* 0: plain Qwerty without layer switching
* ,---------------. ,---------------. ,---------------.
* |F13|F14|F15|F16| |F17|F18|F19|F20| |F21|F22|F23|F24|
* ,---. |---------------| |---------------| |---------------| ,-----------. ,---------------. ,-------.
* |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| |VDn|VUp|Mut|Pwr| | Help |
* `---' `---------------' `---------------' `---------------' `-----------' `---------------' `-------'
* ,-----------------------------------------------------------. ,-----------. ,---------------. ,-------.
* | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|JPY|Bsp| |Ins|Hom|PgU| |NmL| /| *| -| |Stp|Agn|
* |-----------------------------------------------------------| |-----------| |---------------| |-------|
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | |Del|End|PgD| | 7| 8| 9| +| |Mnu|Und|
* |-----------------------------------------------------------| `-----------' |---------------| |-------|
* |CapsL | A| S| D| F| G| H| J| K| L| ;| :| #|Retn| | 4| 5| 6|KP,| |Sel|Cpy|
* |-----------------------------------------------------------| ,---. |---------------| |-------|
* |Shft| <| Z| X| C| V| B| N| M| ,| ,| /| RO|Shift | |Up | | 1| 2| 3|KP=| |Exe|Pst|
* |-----------------------------------------------------------| ,-----------. |---------------| |-------|
* |Ctl|Gui|Alt|MHEN|HNJ| Space |H/E|HENK|KANA|Alt|Gui|App|Ctl| |Lef|Dow|Rig| | 0 | .|Ent| |Fnd|Cut|
* `-----------------------------------------------------------' `-----------' `---------------' `-------'
*/
KEYMAP_ALL(
F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24,
ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,PAUS, VOLD,VOLU,MUTE,PWR, HELP,
GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, JYEN,BSPC, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS, STOP,AGIN,
TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, BSLS, DEL, END, PGDN, P7, P8, P9, PPLS, MENU,UNDO,
CAPS,A, S, D, F, G, H, J, K, L, SCLN,QUOT, NUHS,ENT, P4, P5, P6, PCMM, SLCT,COPY,
LSFT,NUBS,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RO, RSFT, UP, P1, P2, P3, PEQL, EXEC,PSTE,
LCTL,LGUI,LALT,MHEN,HANJ, SPC, HAEN,HENK,KANA,RALT,RGUI,APP, RCTL, LEFT,DOWN,RGHT, P0, PDOT,PENT, FIND,CUT
),
};

const uint16_t fn_actions[] __attribute__ ((section (".keymap.fn_actions"))) = {
[0] = ACTION_LAYER_MOMENTARY(1),
[1] = ACTION_LAYER_MOMENTARY(2),
[2] = ACTION_LAYER_MOMENTARY(3),
[3] = ACTION_LAYER_MOMENTARY(4),
[4] = ACTION_LAYER_MOMENTARY(5),
[5] = ACTION_LAYER_MOMENTARY(6),
[6] = ACTION_LAYER_MOMENTARY(7),
[7] = ACTION_LAYER_TOGGLE(1),
[8] = ACTION_LAYER_TOGGLE(2),
[9] = ACTION_LAYER_TOGGLE(3),
[10] = ACTION_LAYER_TAP_TOGGLE(1),
[11] = ACTION_LAYER_TAP_TOGGLE(2),
[12] = ACTION_LAYER_TAP_TOGGLE(3),
[13] = ACTION_LAYER_TAP_KEY(1, KC_BSLASH),
[14] = ACTION_LAYER_TAP_KEY(2, KC_TAB),
[15] = ACTION_LAYER_TAP_KEY(3, KC_ENTER),
[16] = ACTION_LAYER_TAP_KEY(4, KC_SPACE),
[17] = ACTION_LAYER_TAP_KEY(5, KC_SCOLON),
[18] = ACTION_LAYER_TAP_KEY(6, KC_QUOTE),
[19] = ACTION_LAYER_TAP_KEY(7, KC_SLASH),
[20] = ACTION_MODS_TAP_KEY(MOD_LSFT, KC_SPACE),
[21] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_SPACE),
[22] = ACTION_MODS_TAP_KEY(MOD_RCTL, KC_QUOTE),
[23] = ACTION_MODS_TAP_KEY(MOD_RCTL, KC_ENTER),
[24] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_ESC),
[25] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_BSPACE),
[26] = ACTION_MODS_ONESHOT(MOD_LCTL),
[27] = ACTION_MODS_TAP_KEY(MOD_LSFT, KC_ESC),
[28] = ACTION_MODS_TAP_KEY(MOD_LSFT, KC_BSPACE),
[29] = ACTION_MODS_ONESHOT(MOD_LSFT),
[30] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_GRAVE),
[31] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_BSLASH),
};

+ 0
- 158
converter/usb_usb/keymap_hasu.c View File

#include "keymap_common.h"

const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = {
/* Layer 0: Default Layer
* ,-----------------------------------------------------------.
* |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \| `|
* |-----------------------------------------------------------|
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]|Backs|
* |-----------------------------------------------------------|
* |Contro| A| S| D| F| G| H| J| K| L|Fn3| '|Fn6 |
* |-----------------------------------------------------------|
* |Fn7 | Z| X| C| V| B| N| M| ,| .|Fn2|Shift |Fn1|
* `-----------------------------------------------------------'
* |Gui|Alt | Fn4 |Fn5 |Gui|
* `-------------------------------------------'
*/
[0] = \
KEYMAP(
ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,BRK,
ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS,
TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, DEL, END, PGDN, P7, P8, P9,
LCTL,A, S, D, F, G, H, J, K, L, FN3, QUOT, FN6, P4, P5, P6, PPLS,
FN7, Z, X, C, V, B, N, M, COMM,DOT, FN2, RSFT, UP, P1, P2, P3,
LCTL,LGUI,LALT, FN4, RALT,FN5, FN5, FN1, LEFT,DOWN,RGHT, P0, PDOT,PENT
),

/* Layer 1: HHKB mode[HHKB Fn]
* ,-----------------------------------------------------------.
* |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Ins|Del|
* |-----------------------------------------------------------|
* |Caps | | | | | | | |Psc|Slk|Pus|Up | |Backs|
* |-----------------------------------------------------------|
* |Contro|VoD|VoU|Mut| | | *| /|Hom|PgU|Lef|Rig|Enter |
* |-----------------------------------------------------------|
* |Shift | | | | | | +| -|End|PgD|Dow|Shift | |
* `-----------------------------------------------------------'
* |Gui|Alt | Space |Alt |Gui|
* `-------------------------------------------'
*/
[1] = \
KEYMAP(
ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,BRK,
GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, DEL, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS,
CAPS,NO, NO, NO, NO, NO, NO, NO, PSCR,SLCK,PAUS, UP, NO, BSLS, DEL, END, PGDN, P7, P8, P9,
LCTL,VOLD,VOLU,MUTE,NO, NO, PAST,PSLS,HOME,PGUP,LEFT,RGHT, ENT, P4, P5, P6, PPLS,
LSFT,NO, NO, NO, NO, NO, PPLS,PMNS,END, PGDN,DOWN, RSFT, UP, P1, P2, P3,
LCTL,LGUI,LALT, SPC, RALT,RGUI,APP, TRNS, LEFT,DOWN,RGHT, P0, PDOT,PENT
),

/* Layer 2: Vi mode[Slash]
* ,-----------------------------------------------------------.
* |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Ins|Del|
* |-----------------------------------------------------------|
* |Tab |Hom|PgD|Up |PgU|End|Hom|PgD|PgUlEnd| | | |Backs|
* |-----------------------------------------------------------|
* |Contro| |Lef|Dow|Rig| |Lef|Dow|Up |Rig| | |Return |
* |-----------------------------------------------------------|
* |Shift | | | | | |Hom|PgD|PgUlEnd|Fn0|Shift | |
* `-----------------------------------------------------------'
* |Gui|Alt | Space |Alt |Gui|
* `-------------------------------------------'
*/
[2] = \
KEYMAP(
ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,BRK,
GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, DEL, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS,
TAB, HOME,PGDN,UP, PGUP,END, HOME,PGDN,PGUP,END, NO, NO, NO, BSLS, DEL, END, PGDN, P7, P8, P9,
LCTL,NO, LEFT,DOWN,RGHT,NO, LEFT,DOWN,UP, RGHT,NO, NO, ENT, P4, P5, P6, PPLS,
LSFT,NO, NO, NO, NO, NO, HOME,PGDN,PGUP,END, TRNS, RSFT, UP, P1, P2, P3,
LCTL,LGUI,LALT, SPC, RALT,RGUI,APP, RCTL, LEFT,DOWN,RGHT, P0, PDOT,PENT
),

/* Layer 3: Mouse mode(IJKL)[Semicolon]
* ,-----------------------------------------------------------.
* |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Ins|Del|
* |-----------------------------------------------------------|
* |Tab | | | | | |MwL|MwD|McU|MwU|MwR|Wbk|Wfr|Alt-T|
* |-----------------------------------------------------------|
* |Contro| | | | | |Mb2|McL|McD|McR|Fn | |Return |
* |-----------------------------------------------------------|
* |Shift | | | | |Mb3|Mb2|Mb1|Mb4|Mb5| |Shift | |
* `-----------------------------------------------------------'
* |Gui |Alt | Mb1 |Fn |Fn |
* `--------------------------------------------'
* Mc: Mouse Cursor / Mb: Mouse Button / Mw: Mouse Wheel8
*/
[3] = \
KEYMAP(
ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,BRK,
GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, FN8, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS,
FN8, NO, NO, NO, NO, NO, WH_L,WH_D,MS_U,WH_U,WH_R,WBAK,WFWD,FN8, DEL, END, PGDN, P7, P8, P9,
LCTL,ACL0,ACL1,ACL2,ACL2,NO, NO, MS_L,MS_D,MS_R,TRNS,NO, ENT, P4, P5, P6, PPLS,
LSFT,NO, NO, NO, NO, BTN3,BTN2,BTN1,BTN4,BTN5,NO, RSFT, UP, P1, P2, P3,
LCTL,LGUI,LALT, BTN1, RALT,TRNS,TRNS,RCTL, LEFT,DOWN,RGHT, P0, PDOT,PENT
),

/* Layer 5: Mouse mode(IJKL)[Space]
* ,-----------------------------------------------------------.
* |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Ins|Del|
* |-----------------------------------------------------------|
* |Tab | | | | | |MwL|MwD|McU|MwU|MwR|Wbk|Wfr|Alt-T|
* |-----------------------------------------------------------|
* |Contro| | | | | |Mb2|McL|McD|McR|Mb1| |Return |
* |-----------------------------------------------------------|
* |Shift | | | | |Mb3|Mb2|Mb1|Mb4|Mb5| |Shift | |
* `-----------------------------------------------------------'
* |Gui |Alt | Mb1 |Fn |Fn |
* `--------------------------------------------'
* Mc: Mouse Cursor / Mb: Mouse Button / Mw: Mouse Wheel8
*/
[4] = \
KEYMAP(
ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,BRK,
GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, FN8, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS,
FN8, NO, NO, NO, NO, NO, WH_L,WH_D,MS_U,WH_U,WH_R,WBAK,WFWD,FN8, DEL, END, PGDN, P7, P8, P9,
LCTL,ACL0,ACL1,ACL2,ACL2,NO, NO, MS_L,MS_D,MS_R,BTN1,NO, ENT, P4, P5, P6, PPLS,
LSFT,NO, NO, NO, NO, BTN3,BTN2,BTN1,BTN4,BTN5,NO, RSFT, UP, P1, P2, P3,
LCTL,LGUI,LALT, TRNS, RALT,RGUI,APP, RCTL, LEFT,DOWN,RGHT, P0, PDOT,PENT
),
};


/*
* Macro definition
*/
enum macro_id {
ALT_TAB,
};
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{
switch (id) {
case ALT_TAB:
return (record->event.pressed ?
MACRO( D(LALT), D(TAB), END ) :
MACRO( U(TAB), END ));
}
return MACRO_NONE;
}


/*
* Fn action definition
*/
#ifdef KEYMAP_SECTION_ENABLE
const uint16_t fn_actions[] __attribute__ ((section (".keymap.fn_actions"))) = {
#else
const uint16_t fn_actions[] PROGMEM = {
#endif
[0] = ACTION_DEFAULT_LAYER_SET(0), // Default layer(not used)
[1] = ACTION_LAYER_TAP_TOGGLE(1), // HHKB layer(toggle with 5 taps)
[2] = ACTION_LAYER_TAP_KEY(2, KC_SLASH), // Cursor layer with Slash*
[3] = ACTION_LAYER_TAP_KEY(3, KC_SCLN), // Mousekey layer with Semicolon*
[4] = ACTION_LAYER_TAP_KEY(4, KC_SPC), // Mousekey layer with Space
[5] = ACTION_LAYER_MOMENTARY(3), // Mousekey layer
[6] = ACTION_MODS_TAP_KEY(MOD_RCTL, KC_ENT), // RControl with tap Enter
[7] = ACTION_MODS_ONESHOT(MOD_LSFT), // Oneshot Shift
[8] = ACTION_MACRO(ALT_TAB), // Application switching
};

+ 0
- 36
converter/usb_usb/keymap_iso.c View File

#include "keymap_common.h"

const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = {
/* Layer 0: Default Layer
* ,---. ,---------------. ,---------------. ,---------------. ,-----------.
* |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau|
* `---' `---------------' `---------------' `---------------' `-----------'
* ,-----------------------------------------------------------. ,-----------. ,---------------.
* | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| ^| Bsp| |Ins|Hom|PgU| |NmL| /| *| -|
* |-----------------------------------------------------------| |-----------| |---------------|
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| Retn| |Del|End|PgD| | 7| 8| 9| +|
* |------------------------------------------------------` | `-----------' |-----------| |
* |CapsL | A| S| D| F| G| H| J| K| L| ;| '| #| | | 4| 5| 6| |
* |-----------------------------------------------------------| ,---. |---------------|
* |Shft|\ | Z| X| C| V| B| N| M| ,| ,| /| RO|Shift | |Up | | 1| 2| 3|Ent|
* |-----------------------------------------------------------| ,-----------. |-----------| |
* |Ctl|Gui|Alt| Space |HNK|KNA|Alt|Gui|App|Ctl| |Lef|Dow|Rig| | 0| .| |
* `-----------------------------------------------------------' `-----------' `---------------'
*/
[0] = \
KEYMAP_ISO(
ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,BRK,
GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS,
TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,ENT, DEL, END, PGDN, P7, P8, P9, PPLS,
LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT,NUHS, P4, P5, P6,
LSFT,NUBS,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RSFT, UP, P1, P2, P3, PENT,
LCTL,LGUI,LALT, SPC, RALT,RGUI,APP, RCTL, LEFT,DOWN,RGHT, P0, PDOT
),
};


/*
* Fn action definition
*/
const uint16_t fn_actions[] PROGMEM = {
};

+ 0
- 36
converter/usb_usb/keymap_jis.c View File

#include "keymap_common.h"

const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = {
/* Layer 0: Default Layer
* ,---. ,---------------. ,---------------. ,---------------. ,-----------.
* |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau|
* `---' `---------------' `---------------' `---------------' `-----------'
* ,-----------------------------------------------------------. ,-----------. ,---------------.
* | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| ^|JPY|Bsp| |Ins|Hom|PgU| |NmL| /| *| -|
* |-----------------------------------------------------------| |-----------| |---------------|
* |Tab | Q| W| E| R| T| Y| U| I| O| P| @| [| Retn| |Del|End|PgD| | 7| 8| 9| +|
* |------------------------------------------------------` | `-----------' |-----------| |
* |CapsL | A| S| D| F| G| H| J| K| L| ;| :| ]| | | 4| 5| 6| |
* |-----------------------------------------------------------| ,---. |---------------|
* |Shft | Z| X| C| V| B| N| M| ,| ,| /| RO|Shift | |Up | | 1| 2| 3|Ent|
* |-----------------------------------------------------------| ,-----------. |-----------| |
* |Ctl|Gui|Alt|MHEN| Space |HENK|KNA|Alt|Gui|App|Ctl| |Lef|Dow|Rig| | 0| .| |
* `-----------------------------------------------------------' `-----------' `---------------'
*/
[0] = \
KEYMAP_JIS(
ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,BRK,
GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, JPY, BSPC, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS,
TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, ENT, DEL, END, PGDN, P7, P8, P9, PPLS,
LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT,NUHS, P4, P5, P6,
LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RO, RSFT, UP, P1, P2, P3, PENT,
LCTL,LGUI,LALT,MHEN, SPC, HENK,KANA,RALT,RGUI,APP, RCTL, LEFT,DOWN,RGHT, P0, PDOT
),
};


/*
* Fn action definition
*/
const uint16_t fn_actions[] PROGMEM = {
};

+ 0
- 65
converter/usb_usb/keymap_spacefn.c View File

/*
* SpaceFN layout
* http://geekhack.org/index.php?topic=51069.0
*/
#include "keymap_common.h"


const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* 0: plain Qwerty
* ,---------------. ,---------------. ,---------------.
* |F13|F14|F15|F16| |F17|F18|F19|F20| |F21|F22|F23|F24|
* ,---. |---------------| |---------------| |---------------| ,-----------. ,---------------. ,-------.
* |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| |VDn|VUp|Mut|Pwr| | Help |
* `---' `---------------' `---------------' `---------------' `-----------' `---------------' `-------'
* ,-----------------------------------------------------------. ,-----------. ,---------------. ,-------.
* | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|JPY|Bsp| |Ins|Hom|PgU| |NmL| /| *| -| |Stp|Agn|
* |-----------------------------------------------------------| |-----------| |---------------| |-------|
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | |Del|End|PgD| | 7| 8| 9| +| |Mnu|Und|
* |-----------------------------------------------------------| `-----------' |---------------| |-------|
* |LCtrl | A| S| D| F| G| H| J| K| L| ;| :| #|Retn| | 4| 5| 6|KP,| |Sel|Cpy|
* |-----------------------------------------------------------| ,---. |---------------| |-------|
* |Shft| <| Z| X| C| V| B| N| M| ,| ,| /| RO|Shift | |Up | | 1| 2| 3|KP=| |Exe|Pst|
* |-----------------------------------------------------------| ,-----------. |---------------| |-------|
* |Ctl|Gui|Alt|MHEN|HNJ| Space |H/E|HENK|KANA|Alt|Gui|App|Ctl| |Lef|Dow|Rig| | 0 | .|Ent| |Fnd|Cut|
* `-----------------------------------------------------------' `-----------' `---------------' `-------'
*/
KEYMAP_ALL(
F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24,
ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,PAUS, VOLD,VOLU,MUTE,PWR, HELP,
ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, JYEN,BSPC, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS, STOP,AGIN,
TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, BSLS, DEL, END, PGDN, P7, P8, P9, PPLS, MENU,UNDO,
LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT, NUHS,ENT, P4, P5, P6, PCMM, SLCT,COPY,
LSFT,NUBS,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RO, RSFT, UP, P1, P2, P3, PEQL, EXEC,PSTE,
LCTL,LGUI,LALT,MHEN,HANJ, FN0, HAEN,HENK,KANA,RALT,RGUI,APP, RCTL, LEFT,DOWN,RGHT, P0, PDOT,PENT, FIND,CUT
),

/* 1: SpaceFN
* ,-----------------------------------------------------------.
* |` | F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Delete |
* |-----------------------------------------------------------|
* |Caps | | |Esc| | | |Hom|Up |End|Psc|Slk|Pau|Ins |
* |-----------------------------------------------------------|
* | | | | | | |PgU|Lef|Dow|Rig| | | |
* |-----------------------------------------------------------|
* | | | | | |Spc|PgD|` |~ | |Men| |
* |-----------------------------------------------------------|
* | | | | | | | | |
* `-----------------------------------------------------------'
*/
KEYMAP_ALL(
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS, TRNS,
GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS,DEL, TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,
CAPS,TRNS,TRNS,ESC, TRNS,TRNS,TRNS,HOME,UP, END, PSCR,SLCK,PAUS, INS, TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PGUP,LEFT,DOWN,RGHT,TRNS,TRNS, TRNS,TRNS, TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,SPC, PGDN,GRV, FN1, TRNS,APP, TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,
TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS, TRNS, TRNS,TRNS, TRNS,TRNS
),
};

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


+ 45
- 0
converter/usb_usb/unimap.c View File

/*
Copyright 2016 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 "unimap_trans.h"


#define AC_FN0 ACTION_LAYER_MOMENTARY(1)

#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(
F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24,
ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,PAUS, VOLD,VOLU,MUTE,
GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, JYEN,BSPC, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS,
TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, BSLS, DEL, END, PGDN, P7, P8, P9, PPLS,
CAPS,A, S, D, F, G, H, J, K, L, SCLN,QUOT, NUHS,ENT, P4, P5, P6, PCMM,
LSFT,NUBS,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RO, RSFT, UP, P1, P2, P3, PEQL,
LCTL,LGUI,LALT,MHEN, SPC, HENK,KANA,RALT,RGUI,FN0, RCTL, LEFT,DOWN,RGHT, P0, PDOT,PENT
),
UNIMAP(
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
GRV, 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, INS, 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
),
};

+ 80
- 0
converter/usb_usb/unimap_trans.h View File

/*
Copyright 2016 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/>.
*/
#ifndef UNIMAP_COMMON_H
#define UNIMAP_COMMON_H

#include <stdint.h>
#include <avr/pgmspace.h>
#include "unimap.h"


/* Mapping to Universal keyboard layout
*
* Universal keyboard layout
* ,-----------------------------------------------.
* |F13|F14|F15|F16|F17|F18|F19|F20|F21|F22|F23|F24|
* ,---. |-----------------------------------------------| ,-----------. ,-----------.
* |Esc| |F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12| |PrS|ScL|Pau| |VDn|VUp|Mut|
* `---' `-----------------------------------------------' `-----------' `-----------'
* ,-----------------------------------------------------------. ,-----------. ,---------------.
* | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|JPY|Bsp| |Ins|Hom|PgU| |NmL| /| *| -|
* |-----------------------------------------------------------| |-----------| |---------------|
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | |Del|End|PgD| | 7| 8| 9| +|
* |-----------------------------------------------------------| `-----------' |---------------|
* |CapsL | A| S| D| F| G| H| J| K| L| ;| '| #|Retn| | 4| 5| 6|KP,|
* |-----------------------------------------------------------| ,---. |---------------|
* |Shft| <| Z| X| C| V| B| N| M| ,| .| /| RO|Shift | |Up | | 1| 2| 3|KP=|
* |-----------------------------------------------------------| ,-----------. |---------------|
* |Ctl|Gui|Alt|MHEN| Space |HENK|KANA|Alt|Gui|App|Ctl| |Lef|Dow|Rig| | 0 | .|Ent|
* `-----------------------------------------------------------' `-----------' `---------------'
*/
const uint8_t PROGMEM unimap_trans[MATRIX_ROWS][MATRIX_COLS] = {
{ UNIMAP_KANA, UNIMAP_VOLUME_DOWN, UNIMAP_VOLUME_UP, UNIMAP_VOLUME_MUTE, UNIMAP_A, UNIMAP_B, UNIMAP_C, UNIMAP_D,
UNIMAP_E, UNIMAP_F, UNIMAP_G, UNIMAP_H, UNIMAP_I, UNIMAP_J, UNIMAP_K, UNIMAP_L },
{ UNIMAP_M, UNIMAP_N, UNIMAP_O, UNIMAP_P, UNIMAP_Q, UNIMAP_R, UNIMAP_S, UNIMAP_T,
UNIMAP_U, UNIMAP_V, UNIMAP_W, UNIMAP_X, UNIMAP_Y, UNIMAP_Z, UNIMAP_1, UNIMAP_2 },
{ UNIMAP_3, UNIMAP_4, UNIMAP_5, UNIMAP_6, UNIMAP_7, UNIMAP_8, UNIMAP_9, UNIMAP_0,
UNIMAP_ENTER, UNIMAP_ESCAPE,UNIMAP_BSPACE,UNIMAP_TAB, UNIMAP_SPACE, UNIMAP_MINUS, UNIMAP_EQUAL, UNIMAP_LBRACKET },
{ UNIMAP_RBRACKET,UNIMAP_BSLASH,UNIMAP_NONUS_HASH, UNIMAP_SCOLON, UNIMAP_QUOTE, UNIMAP_GRAVE, UNIMAP_COMMA, UNIMAP_DOT,
UNIMAP_SLASH, UNIMAP_CAPSLOCK,UNIMAP_F1, UNIMAP_F2, UNIMAP_F3, UNIMAP_F4, UNIMAP_F5, UNIMAP_F6 },
{ UNIMAP_F7, UNIMAP_F8, UNIMAP_F9, UNIMAP_F10, UNIMAP_F11, UNIMAP_F12, UNIMAP_PSCREEN,UNIMAP_SCROLLLOCK,
UNIMAP_PAUSE, UNIMAP_INSERT,UNIMAP_HOME, UNIMAP_PGUP, UNIMAP_DELETE,UNIMAP_END, UNIMAP_PGDOWN, UNIMAP_RIGHT },
{ UNIMAP_LEFT, UNIMAP_DOWN, UNIMAP_UP, UNIMAP_NUMLOCK, UNIMAP_KP_SLASH, UNIMAP_KP_ASTERISK, UNIMAP_KP_MINUS, UNIMAP_KP_PLUS,
UNIMAP_KP_ENTER,UNIMAP_KP_1,UNIMAP_KP_2, UNIMAP_KP_3, UNIMAP_KP_4, UNIMAP_KP_5, UNIMAP_KP_6, UNIMAP_KP_7 },
{ UNIMAP_KP_8, UNIMAP_KP_9, UNIMAP_KP_0, UNIMAP_KP_DOT,UNIMAP_NONUS_BSLASH,UNIMAP_APPLICATION,UNIMAP_KP_COMMA,UNIMAP_KP_EQUAL,
UNIMAP_F13, UNIMAP_F14, UNIMAP_F15, UNIMAP_F16, UNIMAP_F17, UNIMAP_F18, UNIMAP_F19, UNIMAP_F20 },
{ UNIMAP_F21, UNIMAP_F22, UNIMAP_F23, UNIMAP_F24, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO,
UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO }, /* 78-7F */ \
{ UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_RO, /* 80-87 */ \
UNIMAP_NO, UNIMAP_JYEN, UNIMAP_HENK, UNIMAP_MHEN, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO }, /* 88-8F */ \
{ UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, /* 90-97 */ \
UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO }, /* 98-9F */ \
{ UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, /* A0-A7 */ \
UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO }, /* A8-AF */ \
{ UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, /* B0-B7 */ \
UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO }, /* B8-BF */ \
{ UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, /* C0-C7 */ \
UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO }, /* C8-CF */ \
{ UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, /* D0-D7 */ \
UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO }, /* D8-DF */ \
{ UNIMAP_LCTRL, UNIMAP_LSHIFT,UNIMAP_LALT, UNIMAP_LGUI, UNIMAP_RCTRL, UNIMAP_RSHIFT,UNIMAP_RALT, UNIMAP_RGUI, /* E0-E7 */ \
UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO }, /* E8-EF */ \
{ UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, /* F0-F7 */ \
UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO }, /* F8-FF */ \
};

#endif

+ 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)

+ 1
- 2
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"
} }




const uint16_t PROGMEM actionmaps[][MATRIX_ROWS][MATRIX_COLS] = {
const action_t PROGMEM actionmaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Default Layer /* Default Layer
* ,-----------------------------------------------------------. * ,-----------------------------------------------------------.
* |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \ | * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \ |

+ 1
- 2
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"
#define AC_LM1 ACTION_LAYER_MOMENTARY(1) // HHKB layer #define AC_LM1 ACTION_LAYER_MOMENTARY(1) // HHKB layer




const uint16_t PROGMEM actionmaps[][MATRIX_ROWS][MATRIX_COLS] = {
const action_t PROGMEM actionmaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Default Layer /* Default Layer
* ,-----------------------------------------------------------. * ,-----------------------------------------------------------.
* |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|BSpc | * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|BSpc |

+ 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 uint16_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, \

+ 2
- 2
keyboard/alps64/keymap_editor.c View File

}; };


#ifdef KEYMAP_SECTION_ENABLE #ifdef KEYMAP_SECTION_ENABLE
const uint16_t fn_actions[] __attribute__ ((section (".keymap.fn_actions"))) = {
const action_t fn_actions[] __attribute__ ((section (".keymap.fn_actions"))) = {
#else #else
const uint16_t fn_actions[] PROGMEM = {
const action_t fn_actions[] PROGMEM = {
#endif #endif
[0] = ACTION_LAYER_MOMENTARY(1), [0] = ACTION_LAYER_MOMENTARY(1),
[1] = ACTION_LAYER_MOMENTARY(2), [1] = ACTION_LAYER_MOMENTARY(2),

+ 1
- 1
keyboard/alps64/keymap_hasu.c View File

/* /*
* Fn action definition * Fn action definition
*/ */
const uint16_t PROGMEM fn_actions[] = {
const action_t PROGMEM fn_actions[] = {
[0] = ACTION_LAYER_MOMENTARY(1), // HHKB layer [0] = ACTION_LAYER_MOMENTARY(1), // HHKB layer
[1] = ACTION_LAYER_TAP_KEY(1, KC_ENTER), // HHKB layer [1] = ACTION_LAYER_TAP_KEY(1, KC_ENTER), // HHKB layer
[2] = ACTION_LAYER_TAP_KEY(2, KC_SLASH), // Cursor layer with Slash* [2] = ACTION_LAYER_TAP_KEY(2, KC_SLASH), // Cursor layer with Slash*

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

TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS), TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS),
}; };


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

+ 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 uint16_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
*/ */

+ 0
- 0
keyboard/gh60/keymap_hasu.c View File


Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save