Bonjour à tous !
Je reviens encore une fois vous parler de notre chère disposition pour iOS, et cette fois je vais un peu plus loin !
[mode histoire]
Après pas mal de réflexion et de recherches, j'ai remarqué que TMK (encore et toujours lui) supporte désormais des actions du type «s(A)» pour «Shift A».
Le Makefile a été modifié à l'aide d' hasu (
https://deskthority.net/workshop-f7/tmk-keyboard-firmware-collection-t4478-210.html)
L'idée est donc maintenant, non plus de se baser sur un qwerty inter, mais sur de l'azerty ! Encore une fois, toutes les touches ne sont pas disponibles (« et », de même que les majuscules accentuées) mais j'y travaille (doucement).
Le très bon côté est que cette version du firmware donne accès au bépo sur *n'importe quel ordinateur configuré en azerty*.
[/mode histoire]
Voici le fichier à utiliser : actionmap_bepo.c
#include <avr/pgmspace.h>
#include "actionmap.h"
#include "action_code.h"
#include "actionmap_common.h"
/*
* Actions
*/
#define AC_LT0 ACTION_LAYER_MOMENTARY(0) // default layer
#define AC_LT1 ACTION_LAYER_MOMENTARY(1) // shift layer
#define AC_LT2 ACTION_LAYER_MOMENTARY(2) // altgr layer
#define AC_LT3 ACTION_LAYER_MOMENTARY(3) // hhkb layer
#define AC_LP4 ACTION_LAYER_TOGGLE(4) // qwerty layer
#define AC_LP5 ACTION_LAYER_TOGGLE(0) //
const uint16_t PROGMEM actionmaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* 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| ;| '|Enter |
* |-----------------------------------------------------------|
* |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift |Fn0|
* `-----------------------------------------------------------'
* |Alt|Gui | Space |Gui |Alt|
* `-------------------------------------------'
*/
[0] = ACTIONMAP_HHKB(\
ESC, 3, NONUS_BSLASH, s(NONUS_BSLASH), 5, MINS, agr(0), s(EQL), 6, s(DOT), BSLS, EQL,s(QUOT), RBRC, 9, \
TAB, B, 2, P, O, 7, LBRC, V , D, L, J, W,Z,BSPC, \
LCTL,Q, U, I, E, M, C, T, S, R, N,SCLN,ENT, \
LT1,0, Y, X, s(COMM), K, 4, A, G,H, F,LT1,LT3, \
LALT,LGUI, SPC, LT2,LP4),
/* Layer 1: HHKB mode (HHKB Fn)
* ,-----------------------------------------------------------.
* |Pwr| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Ins|Del|
* |-----------------------------------------------------------|
* |Caps | | | | | | | |Psc|Slk|Pus|Up | |Backs|
* |-----------------------------------------------------------|
* | |VoD|VoU|Mut| | | *| /|Hom|PgU|Lef|Rig|Enter |
* |-----------------------------------------------------------|
* | | | | | | | +| -|End|PgD|Dow| | |
* `-----------------------------------------------------------'
* | | | | | |
* `-------------------------------------------'
*/
// shift layer
[1] = ACTIONMAP_HHKB(\
ESC, s(1), s(2), s(3), s(4), s(5), s(6), s(7), s(8), s(9), s(0), MINS,EQL, agr(3),BSLASH, \
TAB, s(B), 2, s(P), s(O), 7, SLSH, s(V) , s(D), s(L), s(J), s(W),s(Z),BSPC, \
LCTL,s(Q), s(U), s(I), s(E), COMM, s(C), s(T), s(S), s(R), s(N),s(SCLN),ENT, \
TRNS,0, s(Y), s(X), DOT, s(K), s(M), s(A), s(G),s(H), s(F),TRNS,LT3, \
LALT,LGUI, SPC, LT2,LP4),
// altgr layer
[2] = ACTIONMAP_HHKB( \
TRNS, TRNS, TRNS, TRNS, agr(5), agr(MINS), TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \
TRNS,agr(6),TRNS,1,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, TRNS, TRNS, \
TRNS,TRNS,QUOT,s(LBRC),TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,agr(2),TRNS,TRNS, \
TRNS,TRNS,agr(8),agr(4),agr(EQL),TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS, \
TRNS,TRNS, 8, TRNS,TRNS),
// hhkb layer
[3] = ACTIONMAP_HHKB( \
PWR, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL, \
CAPS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, UP, TRNS, TRNS, \
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,HOME,PGUP,LEFT,RGHT,TRNS, \
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,END, PGDOWN,DOWN,TRNS,TRNS, \
TRNS,TRNS, TRNS, TRNS,TRNS),
// qwerty layer
[4] = ACTIONMAP_HHKB (\
ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSLS,GRV, \
TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSPC, \
LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT,ENT, \
LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH,RSFT,LT3, \
LP5,LGUI, SPC, RALT,TRNS),
};
le .h modifié pour le hhkb : actionmap_common.h
/*
Copyright 2015 Jun Wako <wakojun@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ACTIONMAP_COMMON_H
#define ACTIONMAP_COMMON_H
#define ACTIONMAP( \
K31, K30, K00, K10, K11, K20, K21, K40, K41, K60, K61, K70, K71, K50, K51, \
K32, K01, K02, K13, K12, K23, K22, K42, K43, K62, K63, K73, K72, K52, \
K33, K04, K03, K14, K15, K24, K25, K45, K44, K65, K64, K74, K53, \
K34, K05, K06, K07, K16, K17, K26, K46, K66, K76, K75, K55, K54, \
K35, K36, K37, K57, K56 \
) { \
{ AC_##K00, AC_##K01, AC_##K02, AC_##K03, AC_##K04, AC_##K05, AC_##K06, AC_##K07 }, \
{ AC_##K10, AC_##K11, AC_##K12, AC_##K13, AC_##K14, AC_##K15, AC_##K16, AC_##K17 }, \
{ AC_##K20, AC_##K21, AC_##K22, AC_##K23, AC_##K24, AC_##K25, AC_##K26, AC_NO }, \
{ AC_##K30, AC_##K31, AC_##K32, AC_##K33, AC_##K34, AC_##K35, AC_##K36, AC_##K37 }, \
{ AC_##K40, AC_##K41, AC_##K42, AC_##K43, AC_##K44, AC_##K45, AC_##K46, AC_NO }, \
{ AC_##K50, AC_##K51, AC_##K52, AC_##K53, AC_##K54, AC_##K55, AC_##K56, AC_##K57 }, \
{ AC_##K60, AC_##K61, AC_##K62, AC_##K63, AC_##K64, AC_##K65, AC_##K66, AC_NO }, \
{ AC_##K70, AC_##K71, AC_##K72, AC_##K73, AC_##K74, AC_##K75, AC_##K76, AC_NO } \
}
#define ACTIONMAP_HHKB( \
K31, K30, K00, K10, K11, K20, K21, K40, K41, K60, K61, K70, K71, K50, K51, \
K32, K01, K02, K13, K12, K23, K22, K42, K43, K62, K63, K73, K72, K52, \
K33, K04, K03, K14, K15, K24, K25, K45, K44, K65, K64, K74, K53, \
K34, K05, K06, K07, K16, K17, K26, K46, K66, K76, K75, K55, K54, \
K35, K36, K37, K57, K56 \
) ACTIONMAP( \
K31, K30, K00, K10, K11, K20, K21, K40, K41, K60, K61, K70, K71, K50, K51, \
K32, K01, K02, K13, K12, K23, K22, K42, K43, K62, K63, K73, K72, K52, \
K33, K04, K03, K14, K15, K24, K25, K45, K44, K65, K64, K74, K53, \
K34, K05, K06, K07, K16, K17, K26, K46, K66, K76, K75, K55, K54, \
K35, K36, K37, K57, K56 \
)
#endif
le makefile (dans mon cas version rn42 pour le bluetooth) :
#----------------------------------------------------------------------------
# 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 = hhkb_rn42
# Directory common source filess exist
TMK_DIR = ../../tmk_core
# Directory keyboard dependent files exist
TARGET_DIR = .
# List C source files here. (C dependencies are automatically generated.)
SRC += matrix.c \
led.c
CONFIG_H = config_rn42.h
# MCU name
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
#OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
# Boot Section Size in *bytes*
# Teensy halfKay 512
# Teensy++ halfKay 1024
# Atmel DFU loader 4096 (TMK Alt Controller)
# 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
MOUSEKEY_ENABLE = yes # Mouse keys
EXTRAKEY_ENABLE = yes # Audio control and System control
CONSOLE_ENABLE = yes # Console for debug
COMMAND_ENABLE = yes # Commands for debug and configuration
NKRO_ENABLE = yes # USB Nkey Rollover
#KEYMAP_SECTION_ENABLE = yes # fixed address keymap for keymap editor
#HHKB_JP = yes # HHKB JP support
ACTIONMAP_ENABLE=yes
ifdef ACTIONMAP_ENABLE
KEYMAP_FILE = actionmap
else
KEYMAP_FILE = keymap
SRC := keymap_common.c $(SRC)
endif
#
# Keymap file
#
SRC := $(KEYMAP_FILE)_$(KEYMAP).c $(SRC)
ifneq (, $(or $(findstring keymap_jp.c, $(SRC)), $(findstring yes, $(HHKB_JP))))
OPT_DEFS += -DHHKB_JP
endif
# Search Path
VPATH += $(TARGET_DIR)
VPATH += $(TMK_DIR)
include rn42.mk
include $(TMK_DIR)/protocol.mk
include $(TMK_DIR)/protocol/lufa.mk
include $(TMK_DIR)/common.mk
include $(TMK_DIR)/rules.mk
debug-on: EXTRAFLAGS += -DDEBUG -DDEBUG_ACTION
debug-on: all
debug-off: EXTRAFLAGS += -DNO_DEBUG -DNO_PRINT
debug-off: OPT_DEFS := $(filter-out -DCONSOLE_ENABLE,$(OPT_DEFS))
debug-off: all
et les commandes qui vont bien (dans mon cas) :
makefile -f Makefile.rn42 KEYMAP=bepo # compilation
makefile -f Makefile.rn42 KEYMAP=bepo dfu # compilation et flash
Voili voilou ! J'espère que cette idée aura de bonne répercution pour vous ;-)