From 499d7c8ce610a3c150c64eaacbca3038f7796cc5 Mon Sep 17 00:00:00 2001 From: brickbots Date: Sun, 15 Mar 2020 00:17:48 -0700 Subject: [PATCH 01/18] [Docs] Update to I2C docs: Clarify address expectation and return values (#8413) * Clarifying docs for i2c * Fix typo * Fix up punctuation * Implementing great suggestions * Update docs/i2c_driver.md * Update docs/i2c_driver.md --- docs/i2c_driver.md | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/docs/i2c_driver.md b/docs/i2c_driver.md index d5c340edce7..c9f53ef0d65 100644 --- a/docs/i2c_driver.md +++ b/docs/i2c_driver.md @@ -2,27 +2,40 @@ The I2C Master drivers used in QMK have a set of common functions to allow portability between MCUs. +## An important note on I2C Addresses + +All of the addresses expected by this driver should be pushed to the upper 7 bits of the address byte. Setting +the lower bit (indicating read/write) will be done by the respective functions. Almost all I2C addresses listed +on datasheets and the internet will be represented as 7 bits occupying the lower 7 bits and will need to be +shifted to the left (more significant) by one bit. This is easy to do via the bitwise shift operator `<< 1`. + +You can either do this on each call to the functions below, or once in your definition of the address. For example if your device has an address of `0x18`: + +`#define MY_I2C_ADDRESS (0x18 << 1)` + +See https://www.robot-electronics.co.uk/i2c-tutorial for more information about I2C addressing and other technical details. + ## Available functions |Function |Description | |------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------| |`void i2c_init(void);` |Initializes the I2C driver. This function should be called once before any transaction is initiated. | -|`uint8_t i2c_start(uint8_t address, uint16_t timeout);` |Starts an I2C transaction. Address is the 7-bit slave address without the direction bit. | -|`uint8_t i2c_transmit(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout);` |Transmit data over I2C. Address is the 7-bit slave address without the direction. Returns status of transaction. | -|`uint8_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout);` |Receive data over I2C. Address is the 7-bit slave address without the direction. Saves number of bytes specified by `length` in `data` array. Returns status of transaction. | -|`uint8_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout);` |Same as the `i2c_transmit` function but `regaddr` sets where in the slave the data will be written. | -|`uint8_t i2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout);` |Same as the `i2c_receive` function but `regaddr` sets from where in the slave the data will be read. | -|`uint8_t i2c_stop(void);` |Ends an I2C transaction. | +|`i2c_status_t i2c_start(uint8_t address, uint16_t timeout);` |Starts an I2C transaction. Address is the 7-bit slave address without the direction bit. | +|`i2c_status_t i2c_transmit(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout);` |Transmit data over I2C. Address is the 7-bit slave address without the direction. Returns status of transaction. | +|`i2c_status_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout);` |Receive data over I2C. Address is the 7-bit slave address without the direction. Saves number of bytes specified by `length` in `data` array. Returns status of transaction. | +|`i2c_status_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout);` |Same as the `i2c_transmit` function but `regaddr` sets where in the slave the data will be written. | +|`i2c_status_t i2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout);` |Same as the `i2c_receive` function but `regaddr` sets from where in the slave the data will be read. | +|`i2c_status_t i2c_stop(void);` |Ends an I2C transaction. | ### Function Return All the above functions, except `void i2c_init(void);` return the following truth table: -|Return Value |Description | -|---------------|---------------------------------------------------| -|0 |Operation executed successfully. | -|-1 |Operation failed. | -|-2 |Operation timed out. | +|Return Constant |Value|Description | +|--------------------|-----|--------------------------------| +|`I2C_STATUS_SUCCESS`|0 |Operation executed successfully.| +|`I2C_STATUS_ERROR` |-1 |Operation failed. | +|`I2C_STATUS_TIMEOUT`|-2 |Operation timed out. | ## AVR From dc68418660e9ba1d21e391548038652b793790a7 Mon Sep 17 00:00:00 2001 From: skullydazed Date: Sun, 15 Mar 2020 07:48:44 -0700 Subject: [PATCH 02/18] Fix some broken links in the docs (#8394) * fix some broken links * remove duplicate and confusing material from cli.md * Switch brazil to the 2 letter country code * Update docs/_langs.md Co-Authored-By: Ryan Co-authored-by: Ryan --- docs/_summary.md | 2 - docs/cli.md | 287 +----------------- docs/cli_commands.md | 247 +++++++++++++++ ..._configuration.md => cli_configuration.md} | 0 docs/index.html | 1 + 5 files changed, 254 insertions(+), 283 deletions(-) create mode 100644 docs/cli_commands.md rename docs/{cli_dev_configuration.md => cli_configuration.md} (100%) diff --git a/docs/_summary.md b/docs/_summary.md index 9eb58b9a808..e7e9fa13205 100644 --- a/docs/_summary.md +++ b/docs/_summary.md @@ -18,7 +18,6 @@ * [Overview](newbs_building_firmware_configurator.md) * [Step by Step](configurator_step_by_step.md) * [Troubleshooting](configurator_troubleshooting.md) - * [Problems and Bugs](configurator_problems.md) * QMK API * [Overview](api_overview.md) * [API Documentation](api_docs.md) @@ -128,7 +127,6 @@ * Python Development * [Coding Conventions](coding_conventions_python.md) * [QMK CLI Development](cli_development.md) - * [QMK CLI Config](cli_dev_configuration.md) * Configurator Development * QMK API diff --git a/docs/cli.md b/docs/cli.md index 61f838536eb..165f2a37214 100644 --- a/docs/cli.md +++ b/docs/cli.md @@ -1,24 +1,14 @@ # QMK CLI -This page describes how to setup and use the QMK CLI. - -# Overview +## Overview The QMK CLI makes building and working with QMK keyboards easier. We have provided a number of commands to simplify and streamline tasks such as obtaining and compiling the QMK firmware, creating keymaps, and more. -* [Global CLI](#global-cli) -* [Local CLI](#local-cli) -* [CLI Commands](#cli-commands) +### Requirements -# Requirements +The CLI requires Python 3.5 or greater. We try to keep the number of requirements small but you will also need to install the packages listed in [`requirements.txt`](https://github.com/qmk/qmk_firmware/blob/master/requirements.txt). These are installed automatically when you install the QMK CLI. -The CLI requires Python 3.5 or greater. We try to keep the number of requirements small but you will also need to install the packages listed in [`requirements.txt`](https://github.com/qmk/qmk_firmware/blob/master/requirements.txt). - -# Global CLI - -QMK provides an installable CLI that can be used to setup your QMK build environment, work with QMK, and which makes working with multiple copies of `qmk_firmware` easier. We recommend installing and updating this periodically. - -## Install Using Homebrew (macOS, some Linux) +### Install Using Homebrew (macOS, some Linux) If you have installed [Homebrew](https://brew.sh) you can tap and install QMK: @@ -29,7 +19,7 @@ export QMK_HOME='~/qmk_firmware' # Optional, set the location for `qmk_firmware` qmk setup # This will clone `qmk/qmk_firmware` and optionally set up your build environment ``` -## Install Using easy_install or pip +### Install Using easy_install or pip If your system is not listed above you can install QMK manually. First ensure that you have python 3.5 (or later) installed and have installed pip. Then install QMK with this command: @@ -39,7 +29,7 @@ export QMK_HOME='~/qmk_firmware' # Optional, set the location for `qmk_firmware` qmk setup # This will clone `qmk/qmk_firmware` and optionally set up your build environment ``` -## Packaging For Other Operating Systems +### Packaging For Other Operating Systems We are looking for people to create and maintain a `qmk` package for more operating systems. If you would like to create a package for your OS please follow these guidelines: @@ -47,268 +37,3 @@ We are looking for people to create and maintain a `qmk` package for more operat * Document why in a comment when you do deviate * Install using a virtualenv * Instruct the user to set the environment variable `QMK_HOME` to have the firmware source checked out somewhere other than `~/qmk_firmware`. - -# Local CLI - -If you do not want to use the global CLI there is a local CLI bundled with `qmk_firmware`. You can find it in `qmk_firmware/bin/qmk`. You can run the `qmk` command from any directory and it will always operate on that copy of `qmk_firmware`. - -**Example**: - -``` -$ ~/qmk_firmware/bin/qmk hello -Ψ Hello, World! -``` - -## Local CLI Limitations - -There are some limitations to the local CLI compared to the global CLI: - -* The local CLI does not support `qmk setup` or `qmk clone` -* The local CLI always operates on the same `qmk_firmware` tree, even if you have multiple repositories cloned. -* The local CLI does not run in a virtualenv, so it's possible that dependencies will conflict - -# CLI Commands - -## `qmk cformat` - -This command formats C code using clang-format. - -Run it with no arguments to format all core code that has been changed. Default checks `origin/master` with `git diff`, branch can be changed using `-b ` - -Run it with `-a` to format all core code, or pass filenames on the command line to run it on specific files. - -**Usage for specified files**: - -``` -qmk cformat [file1] [file2] [...] [fileN] -``` - -**Usage for all core files**: - -``` -qmk cformat -a -``` - -**Usage for only changed files against origin/master**: - -``` -qmk cformat -``` - -**Usage for only changed files against branch_name**: - -``` -qmk cformat -b branch_name -``` - -## `qmk compile` - -This command allows you to compile firmware from any directory. You can compile JSON exports from , compile keymaps in the repo, or compile the keyboard in the current working directory. - -**Usage for Configurator Exports**: - -``` -qmk compile -``` - -**Usage for Keymaps**: - -``` -qmk compile -kb -km -``` - -**Usage in Keyboard Directory**: - -Must be in keyboard directory with a default keymap, or in keymap directory for keyboard, or supply one with `--keymap ` -``` -qmk compile -``` - -**Example**: -``` -$ qmk config compile.keymap=default -$ cd ~/qmk_firmware/keyboards/planck/rev6 -$ qmk compile -Ψ Compiling keymap with make planck/rev6:default -... -``` -or with optional keymap argument - -``` -$ cd ~/qmk_firmware/keyboards/clueboard/66/rev4 -$ qmk compile -km 66_iso -Ψ Compiling keymap with make clueboard/66/rev4:66_iso -... -``` -or in keymap directory - -``` -$ cd ~/qmk_firmware/keyboards/gh60/satan/keymaps/colemak -$ qmk compile -Ψ Compiling keymap with make make gh60/satan:colemak -... -``` - -**Usage in Layout Directory**: - -Must be under `qmk_firmware/layouts/`, and in a keymap folder. -``` -qmk compile -kb -``` - -**Example**: -``` -$ cd ~/qmk_firmware/layouts/community/60_ansi/mechmerlin-ansi -$ qmk compile -kb dz60 -Ψ Compiling keymap with make dz60:mechmerlin-ansi -... -``` - -## `qmk flash` - -This command is similar to `qmk compile`, but can also target a bootloader. The bootloader is optional, and is set to `:flash` by default. -To specify a different bootloader, use `-bl `. Visit the [Flashing Firmware](flashing.md) guide for more details of the available bootloaders. - -**Usage for Configurator Exports**: - -``` -qmk flash -bl -``` - -**Usage for Keymaps**: - -``` -qmk flash -kb -km -bl -``` - -**Listing the Bootloaders** - -``` -qmk flash -b -``` - -## `qmk config` - -This command lets you configure the behavior of QMK. For the full `qmk config` documentation see [CLI Configuration](cli_configuration.md). - -**Usage**: - -``` -qmk config [-ro] [config_token1] [config_token2] [...] [config_tokenN] -``` - -## `qmk docs` - -This command starts a local HTTP server which you can use for browsing or improving the docs. Default port is 8936. - -**Usage**: - -``` -qmk docs [-p PORT] -``` - -## `qmk doctor` - -This command examines your environment and alerts you to potential build or flash problems. It can fix many of them if you want it to. - -**Usage**: - -``` -qmk doctor [-y] [-n] -``` - -**Examples**: - -Check your environment for problems and prompt to fix them: - - qmk doctor - -Check your environment and automatically fix any problems found: - - qmk doctor -y - -Check your environment and report problems only: - - qmk doctor -n - -## `qmk json2c` - -Creates a keymap.c from a QMK Configurator export. - -**Usage**: - -``` -qmk json2c [-o OUTPUT] filename -``` - -## `qmk kle2json` - -This command allows you to convert from raw KLE data to QMK Configurator JSON. It accepts either an absolute file path, or a file name in the current directory. By default it will not overwrite `info.json` if it is already present. Use the `-f` or `--force` flag to overwrite. - -**Usage**: - -``` -qmk kle2json [-f] -``` - -**Examples**: - -``` -$ qmk kle2json kle.txt -☒ File info.json already exists, use -f or --force to overwrite. -``` - -``` -$ qmk kle2json -f kle.txt -f -Ψ Wrote out to info.json -``` - -## `qmk list-keyboards` - -This command lists all the keyboards currently defined in `qmk_firmware` - -**Usage**: - -``` -qmk list-keyboards -``` - -## `qmk list-keymaps` - -This command lists all the keymaps for a specified keyboard (and revision). - -**Usage**: - -``` -qmk list-keymaps -kb planck/ez -``` - -## `qmk new-keymap` - -This command creates a new keymap based on a keyboard's existing default keymap. - -**Usage**: - -``` -qmk new-keymap [-kb KEYBOARD] [-km KEYMAP] -``` - -## `qmk pyformat` - -This command formats python code in `qmk_firmware`. - -**Usage**: - -``` -qmk pyformat -``` - -## `qmk pytest` - -This command runs the python test suite. If you make changes to python code you should ensure this runs successfully. - -**Usage**: - -``` -qmk pytest -``` diff --git a/docs/cli_commands.md b/docs/cli_commands.md new file mode 100644 index 00000000000..bffa8263e71 --- /dev/null +++ b/docs/cli_commands.md @@ -0,0 +1,247 @@ +# QMK CLI Commands + +# CLI Commands + +## `qmk cformat` + +This command formats C code using clang-format. + +Run it with no arguments to format all core code that has been changed. Default checks `origin/master` with `git diff`, branch can be changed using `-b ` + +Run it with `-a` to format all core code, or pass filenames on the command line to run it on specific files. + +**Usage for specified files**: + +``` +qmk cformat [file1] [file2] [...] [fileN] +``` + +**Usage for all core files**: + +``` +qmk cformat -a +``` + +**Usage for only changed files against origin/master**: + +``` +qmk cformat +``` + +**Usage for only changed files against branch_name**: + +``` +qmk cformat -b branch_name +``` + +## `qmk compile` + +This command allows you to compile firmware from any directory. You can compile JSON exports from , compile keymaps in the repo, or compile the keyboard in the current working directory. + +**Usage for Configurator Exports**: + +``` +qmk compile +``` + +**Usage for Keymaps**: + +``` +qmk compile -kb -km +``` + +**Usage in Keyboard Directory**: + +Must be in keyboard directory with a default keymap, or in keymap directory for keyboard, or supply one with `--keymap ` +``` +qmk compile +``` + +**Example**: +``` +$ qmk config compile.keymap=default +$ cd ~/qmk_firmware/keyboards/planck/rev6 +$ qmk compile +Ψ Compiling keymap with make planck/rev6:default +... +``` +or with optional keymap argument + +``` +$ cd ~/qmk_firmware/keyboards/clueboard/66/rev4 +$ qmk compile -km 66_iso +Ψ Compiling keymap with make clueboard/66/rev4:66_iso +... +``` +or in keymap directory + +``` +$ cd ~/qmk_firmware/keyboards/gh60/satan/keymaps/colemak +$ qmk compile +Ψ Compiling keymap with make make gh60/satan:colemak +... +``` + +**Usage in Layout Directory**: + +Must be under `qmk_firmware/layouts/`, and in a keymap folder. +``` +qmk compile -kb +``` + +**Example**: +``` +$ cd ~/qmk_firmware/layouts/community/60_ansi/mechmerlin-ansi +$ qmk compile -kb dz60 +Ψ Compiling keymap with make dz60:mechmerlin-ansi +... +``` + +## `qmk flash` + +This command is similar to `qmk compile`, but can also target a bootloader. The bootloader is optional, and is set to `:flash` by default. +To specify a different bootloader, use `-bl `. Visit the [Flashing Firmware](flashing.md) guide for more details of the available bootloaders. + +**Usage for Configurator Exports**: + +``` +qmk flash -bl +``` + +**Usage for Keymaps**: + +``` +qmk flash -kb -km -bl +``` + +**Listing the Bootloaders** + +``` +qmk flash -b +``` + +## `qmk config` + +This command lets you configure the behavior of QMK. For the full `qmk config` documentation see [CLI Configuration](cli_configuration.md). + +**Usage**: + +``` +qmk config [-ro] [config_token1] [config_token2] [...] [config_tokenN] +``` + +## `qmk docs` + +This command starts a local HTTP server which you can use for browsing or improving the docs. Default port is 8936. + +**Usage**: + +``` +qmk docs [-p PORT] +``` + +## `qmk doctor` + +This command examines your environment and alerts you to potential build or flash problems. It can fix many of them if you want it to. + +**Usage**: + +``` +qmk doctor [-y] [-n] +``` + +**Examples**: + +Check your environment for problems and prompt to fix them: + + qmk doctor + +Check your environment and automatically fix any problems found: + + qmk doctor -y + +Check your environment and report problems only: + + qmk doctor -n + +## `qmk json2c` + +Creates a keymap.c from a QMK Configurator export. + +**Usage**: + +``` +qmk json2c [-o OUTPUT] filename +``` + +## `qmk kle2json` + +This command allows you to convert from raw KLE data to QMK Configurator JSON. It accepts either an absolute file path, or a file name in the current directory. By default it will not overwrite `info.json` if it is already present. Use the `-f` or `--force` flag to overwrite. + +**Usage**: + +``` +qmk kle2json [-f] +``` + +**Examples**: + +``` +$ qmk kle2json kle.txt +☒ File info.json already exists, use -f or --force to overwrite. +``` + +``` +$ qmk kle2json -f kle.txt -f +Ψ Wrote out to info.json +``` + +## `qmk list-keyboards` + +This command lists all the keyboards currently defined in `qmk_firmware` + +**Usage**: + +``` +qmk list-keyboards +``` + +## `qmk list-keymaps` + +This command lists all the keymaps for a specified keyboard (and revision). + +**Usage**: + +``` +qmk list-keymaps -kb planck/ez +``` + +## `qmk new-keymap` + +This command creates a new keymap based on a keyboard's existing default keymap. + +**Usage**: + +``` +qmk new-keymap [-kb KEYBOARD] [-km KEYMAP] +``` + +## `qmk pyformat` + +This command formats python code in `qmk_firmware`. + +**Usage**: + +``` +qmk pyformat +``` + +## `qmk pytest` + +This command runs the python test suite. If you make changes to python code you should ensure this runs successfully. + +**Usage**: + +``` +qmk pytest +``` diff --git a/docs/cli_dev_configuration.md b/docs/cli_configuration.md similarity index 100% rename from docs/cli_dev_configuration.md rename to docs/cli_configuration.md diff --git a/docs/index.html b/docs/index.html index ec92de4950c..f810e6c38fd 100644 --- a/docs/index.html +++ b/docs/index.html @@ -33,6 +33,7 @@ // Moved pages '/adding_a_keyboard_to_qmk': '/hardware_keyboard_guidelines', '/build_environment_setup': '/getting_started_build_tools', + '/cli_dev_configuration': '/cli_configuration', '/dynamic_macros': '/feature_dynamic_macros', '/feature_common_shortcuts': '/feature_advanced_keycodes', '/glossary': '/reference_glossary', From c18b51e68e6ee28def492f283c67858e6adf9a95 Mon Sep 17 00:00:00 2001 From: Ryan Date: Mon, 16 Mar 2020 04:15:42 +1100 Subject: [PATCH 03/18] msys2_install.sh: wrap requirements.txt in quotes (#8424) --- util/msys2_install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/msys2_install.sh b/util/msys2_install.sh index d1e24ca6d0a..001f55dc480 100755 --- a/util/msys2_install.sh +++ b/util/msys2_install.sh @@ -81,7 +81,7 @@ else fi popd -pip3 install -r ${util_dir}/../requirements.txt +pip3 install -r "${util_dir}/../requirements.txt" cp -f "$dir/activate_msys2.sh" "$download_dir/" From fe1a055391c9c6984a73afdfa86896d5fc94a403 Mon Sep 17 00:00:00 2001 From: jotix <47826561+jotix@users.noreply.github.com> Date: Sun, 15 Mar 2020 14:16:30 -0300 Subject: [PATCH 04/18] [Keymap] Update ortho 4x12 jotix layout (#8425) * ortho 4x12 jotix layout * jotix ortho_4x12 layout --- layouts/community/ortho_4x12/jotix/keymap.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/layouts/community/ortho_4x12/jotix/keymap.c b/layouts/community/ortho_4x12/jotix/keymap.c index 9d7727de895..2247c848173 100644 --- a/layouts/community/ortho_4x12/jotix/keymap.c +++ b/layouts/community/ortho_4x12/jotix/keymap.c @@ -24,17 +24,17 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // ├───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┤ KC_LSFT,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,KC_ENT, // ├───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┤ - KC_LCTL,KC_LGUI,KC_LALT,KC_RALT,LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT,KC_DOWN,KC_UP, KC_RGHT + KC_LCTL,KC_LGUI,KC_LALT,KC_DEL, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT,KC_DOWN,KC_UP, KC_RGHT // └───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┘ ), [_LOWER] = LAYOUT_ortho_4x12 ( // ┌───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┐ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, + _______,KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, // ├───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┤ - _______,KC_MINS,KC_EQL, KC_LBRC,KC_RBRC,KC_BSLS,KC_MS_L,KC_MS_D,KC_MS_U,KC_MS_R,_______,_______, + _______,KC_MINS,KC_EQL, KC_LBRC,KC_RBRC,KC_BSLS,KC_GRV, _______,_______,_______,_______,_______, // ├───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┤ - _______,KC_UNDS,KC_PLUS,KC_LCBR,KC_RCBR,KC_PIPE,KC_BTN1,KC_BTN2,_______,_______,_______,_______, + _______,KC_UNDS,KC_PLUS,KC_LCBR,KC_RCBR,KC_PIPE,KC_TILD,_______,_______,_______,_______,_______, // ├───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┤ _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______ // └───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┘ @@ -42,13 +42,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_RAISE] = LAYOUT_ortho_4x12 ( // ┌───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┐ - KC_TILD,KC_EXLM,KC_AT, KC_HASH,KC_DLR, KC_PERC,KC_CIRC,KC_AMPR,KC_ASTR,KC_LPRN,KC_RPRN,KC_DEL, + _______,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, // ├───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┤ - KC_CAPS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS,KC_EQL, KC_LBRC,KC_RBRC,KC_BSLS, + _______,KC_F11, KC_F12, _______,_______,_______,KC_HOME,KC_PGUP,_______,_______,_______,_______, // ├───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┤ - _______,KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_UNDS,KC_PLUS,KC_LCBR,KC_RCBR,KC_PIPE, + _______,_______,_______,KC_CAPS,_______,KC_PGDN,KC_END, KC_PGDN,_______,KC_BTN1,KC_BTN2,_______, // ├───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┤ - _______,_______,_______,_______,TGLOWER,_______,_______,_______,KC_HOME,KC_PGDN,KC_PGUP, KC_END + _______,_______,_______,_______,TGLOWER,_______,_______,_______,KC_MS_L,KC_MS_D,KC_MS_U,KC_MS_R // └───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┘ ), From f1c6fa38950405f24b98702846a018c0cb4066af Mon Sep 17 00:00:00 2001 From: Ryan Date: Mon, 16 Mar 2020 07:37:32 +1100 Subject: [PATCH 05/18] Update Plover keymap (#8405) --- quantum/keymap_extras/keymap_plover.h | 68 +++++++++++++++++---------- 1 file changed, 43 insertions(+), 25 deletions(-) diff --git a/quantum/keymap_extras/keymap_plover.h b/quantum/keymap_extras/keymap_plover.h index 3bfcb7ad906..f27d2ba77ab 100644 --- a/quantum/keymap_extras/keymap_plover.h +++ b/quantum/keymap_extras/keymap_plover.h @@ -13,35 +13,53 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#ifndef KEYMAP_PLOVER_H -#define KEYMAP_PLOVER_H + +#pragma once #include "keymap.h" -#define PV_NUM KC_1 -#define PV_LS KC_Q -#define PV_LT KC_W -#define PV_LP KC_E -#define PV_LH KC_R -#define PV_LK KC_S -#define PV_LW KC_D -#define PV_LR KC_F +// clang-format off +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │   │Num│   │   │   │   │   │   │   │   │   │   │   │       │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │     │ S │ T │ P │ H │   │ * │ F │ P │ L │ T │ D │   │     │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │      │   │ K │ W │ R │   │   │ R │ B │ G │ S │ Z │        │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ + * │        │   │   │ A │ O │   │ E │ U │   │   │   │          │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │    │    │    │                        │    │    │    │    │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ +// Row 1 +#define PV_NUM KC_1 + +// Row 2 +#define PV_LS KC_Q +#define PV_LT KC_W +#define PV_LP KC_E +#define PV_LH KC_R #define PV_STAR KC_Y -#define PV_RF KC_U -#define PV_RP KC_I -#define PV_RL KC_O -#define PV_RT KC_P -#define PV_RD KC_LBRC -#define PV_RR KC_J -#define PV_RB KC_K -#define PV_RG KC_L -#define PV_RS KC_SCLN -#define PV_RZ KC_QUOT +#define PV_RF KC_U +#define PV_RP KC_I +#define PV_RL KC_O +#define PV_RT KC_P +#define PV_RD KC_LBRC -#define PV_A KC_C -#define PV_O KC_V -#define PV_E KC_N -#define PV_U KC_M +// Row 3 +#define PV_LK KC_S +#define PV_LW KC_D +#define PV_LR KC_F +#define PV_RR KC_J +#define PV_RB KC_K +#define PV_RG KC_L +#define PV_RS KC_SCLN +#define PV_RZ KC_QUOT -#endif +// Row 4 +#define PV_A KC_C +#define PV_O KC_V +#define PV_E KC_N +#define PV_U KC_M From 4b1430fd0944461bb9abcf688bfe8bf51fa3eb8a Mon Sep 17 00:00:00 2001 From: Ryan Date: Mon, 16 Mar 2020 07:38:05 +1100 Subject: [PATCH 06/18] Update Norman keymap and sendstring LUT (#8404) --- quantum/keymap_extras/keymap_norman.h | 138 ++++++++++++++++------ quantum/keymap_extras/sendstring_norman.h | 16 +-- 2 files changed, 113 insertions(+), 41 deletions(-) diff --git a/quantum/keymap_extras/keymap_norman.h b/quantum/keymap_extras/keymap_norman.h index e0f246f8238..45727467bce 100644 --- a/quantum/keymap_extras/keymap_norman.h +++ b/quantum/keymap_extras/keymap_norman.h @@ -1,4 +1,3 @@ - /* Copyright 2019 Torben Hoffmann * * This program is free software: you can redistribute it and/or modify @@ -14,40 +13,113 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + #pragma once #include "keymap.h" -// For software implementation of norman -#define NM_Q KC_Q -#define NM_W KC_W -#define NM_D KC_E -#define NM_F KC_R -#define NM_K KC_T -#define NM_J KC_Y -#define NM_U KC_U -#define NM_R KC_I -#define NM_L KC_O -#define NM_SCLN KC_P -#define NM_COLN LSFT(NM_SCLN) -#define NM_A KC_A -#define NM_S KC_S -#define NM_E KC_D -#define NM_T KC_F -#define NM_G KC_G -#define NM_Y KC_H -#define NM_N KC_J -#define NM_I KC_K -#define NM_O KC_L -#define NM_H KC_SCLN +// clang-format off -#define NM_Z KC_Z -#define NM_X KC_X -#define NM_C KC_C -#define NM_V KC_V -#define NM_B KC_B -#define NM_P KC_N -#define NM_M KC_M -#define NM_COMM KC_COMM -#define NM_DOT KC_DOT -#define NM_SLSH KC_SLSH +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │       │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │     │ Q │ W │ D │ F │ K │ J │ U │ R │ L │ ; │ [ │ ] │  \  │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │      │ A │ S │ E │ T │ G │ Y │ N │ I │ O │ H │ ' │        │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ + * │        │ Z │ X │ C │ V │ B │ P │ M │ , │ . │ / │          │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │    │    │    │                        │    │    │    │    │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ +// Row 1 +#define NM_GRV KC_GRV // ` +#define NM_1 KC_1 // 1 +#define NM_2 KC_2 // 2 +#define NM_3 KC_3 // 3 +#define NM_4 KC_4 // 4 +#define NM_5 KC_5 // 5 +#define NM_6 KC_6 // 6 +#define NM_7 KC_7 // 7 +#define NM_8 KC_8 // 8 +#define NM_9 KC_9 // 9 +#define NM_0 KC_0 // 0 +#define NM_MINS KC_MINS // - +#define NM_EQL KC_EQL // = +// Row 2 +#define NM_Q KC_Q // Q +#define NM_W KC_W // W +#define NM_D KC_E // D +#define NM_F KC_R // F +#define NM_K KC_T // K +#define NM_J KC_Y // J +#define NM_U KC_U // U +#define NM_R KC_I // R +#define NM_L KC_O // L +#define NM_SCLN KC_P // ; +#define NM_LBRC KC_LBRC // [ +#define NM_RBRC KC_RBRC // ] +#define NM_BSLS KC_BSLS // (backslash) +// Row 3 +#define NM_A KC_A // A +#define NM_S KC_S // S +#define NM_E KC_D // E +#define NM_T KC_F // T +#define NM_G KC_G // G +#define NM_Y KC_H // Y +#define NM_N KC_J // N +#define NM_I KC_K // I +#define NM_O KC_L // O +#define NM_H KC_SCLN // H +#define NM_QUOT KC_QUOT // ' +// Row 4 +#define NM_Z KC_Z // Z +#define NM_X KC_X // X +#define NM_C KC_C // C +#define NM_V KC_V // V +#define NM_B KC_B // B +#define NM_P KC_N // P +#define NM_M KC_M // M +#define NM_COMM KC_COMM // , +#define NM_DOT KC_DOT // . +#define NM_SLSH KC_SLSH // / + +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ~ │ ! │ @ │ # │ $ │ % │ ^ │ & │ * │ ( │ ) │ _ │ + │       │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │     │   │   │   │   │   │   │   │   │   │ ; │ { │ } │  |  │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │      │   │   │   │   │   │   │   │   │   │   │ " │        │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ + * │        │   │   │   │   │   │   │   │ < │ > │ ? │          │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │    │    │    │                        │    │    │    │    │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ +// Row 1 +#define NM_TILD S(NM_GRV) // ~ +#define NM_EXLM S(NM_1) // ! +#define NM_AT S(NM_2) // @ +#define NM_HASH S(NM_3) // # +#define NM_DLR S(NM_4) // $ +#define NM_PERC S(NM_5) // % +#define NM_CIRC S(NM_6) // ^ +#define NM_AMPR S(NM_7) // & +#define NM_ASTR S(NM_8) // * +#define NM_LPRN S(NM_9) // ( +#define NM_RPRN S(NM_0) // ) +#define NM_UNDS S(NM_MINS) // _ +#define NM_PLUS S(NM_EQL) // + +// Row 2 +#define NM_COLN S(NM_SCLN) // : +#define NM_LCBR S(NM_LBRC) // { +#define NM_RCBR S(NM_RBRC) // } +#define NM_PIPE S(NM_BSLS) // | +// Row 3 +#define NM_DQUO S(NM_QUOT) // " +// Row 4 +#define NM_LABK S(NM_COMM) // < +#define NM_RABK S(NM_DOT) // > +#define NM_QUES S(NM_SLSH) // ? diff --git a/quantum/keymap_extras/sendstring_norman.h b/quantum/keymap_extras/sendstring_norman.h index 4146e6ca7be..21dbbdd7054 100644 --- a/quantum/keymap_extras/sendstring_norman.h +++ b/quantum/keymap_extras/sendstring_norman.h @@ -33,27 +33,27 @@ const uint8_t ascii_to_keycode_lut[128] PROGMEM = { XXXXXXX, XXXXXXX, XXXXXXX, KC_ESC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, // ! " # $ % & ' - KC_SPC, KC_1, KC_QUOT, KC_3, KC_4, KC_5, KC_7, KC_QUOT, + KC_SPC, NM_1, NM_QUOT, NM_3, NM_4, NM_5, NM_7, NM_QUOT, // ( ) * + , - . / - KC_9, KC_0, KC_8, KC_EQL, KC_COMM, KC_MINS, KC_DOT, KC_SLSH, + NM_9, NM_0, NM_8, NM_EQL, NM_COMM, NM_MINS, NM_DOT, NM_SLSH, // 0 1 2 3 4 5 6 7 - KC_0, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, + NM_0, NM_1, NM_2, NM_3, NM_4, NM_5, NM_6, NM_7, // 8 9 : ; < = > ? - KC_8, KC_9, NM_SCLN, NM_SCLN, KC_COMM, KC_EQL, KC_DOT, KC_SLSH, + NM_8, NM_9, NM_SCLN, NM_SCLN, NM_COMM, NM_EQL, NM_DOT, NM_SLSH, // @ A B C D E F G - KC_2, NM_A, NM_B, NM_C, NM_D, NM_E, NM_F, NM_G, + NM_2, NM_A, NM_B, NM_C, NM_D, NM_E, NM_F, NM_G, // H I J K L M N O NM_H, NM_I, NM_J, NM_K, NM_L, NM_M, NM_N, NM_O, // P Q R S T U V W NM_P, NM_Q, NM_R, NM_S, NM_T, NM_U, NM_V, NM_W, // X Y Z [ \ ] ^ _ - NM_X, NM_Y, NM_Z, KC_LBRC, KC_BSLS, KC_RBRC, KC_6, KC_MINS, + NM_X, NM_Y, NM_Z, NM_LBRC, NM_BSLS, NM_RBRC, NM_6, NM_MINS, // ` a b c d e f g - KC_GRV, NM_A, NM_B, NM_C, NM_D, NM_E, NM_F, NM_G, + NM_GRV, NM_A, NM_B, NM_C, NM_D, NM_E, NM_F, NM_G, // h i j k l m n o NM_H, NM_I, NM_J, NM_K, NM_L, NM_M, NM_N, NM_O, // p q r s t u v w NM_P, NM_Q, NM_R, NM_S, NM_T, NM_U, NM_V, NM_W, // x y z { | } ~ DEL - NM_X, NM_Y, NM_Z, KC_LBRC, KC_BSLS, KC_RBRC, KC_GRV, KC_DEL + NM_X, NM_Y, NM_Z, NM_LBRC, NM_BSLS, NM_RBRC, NM_GRV, KC_DEL }; From 49a2fbea0c4e0a9847c17c2e7c86133a5fa0d77a Mon Sep 17 00:00:00 2001 From: Ryan Date: Mon, 16 Mar 2020 07:40:54 +1100 Subject: [PATCH 07/18] Update Slovenian keymap and add sendstring LUT (#8350) --- quantum/keymap_extras/keymap_slovenian.h | 232 ++++++++++++------- quantum/keymap_extras/sendstring_slovenian.h | 100 ++++++++ 2 files changed, 248 insertions(+), 84 deletions(-) create mode 100644 quantum/keymap_extras/sendstring_slovenian.h diff --git a/quantum/keymap_extras/keymap_slovenian.h b/quantum/keymap_extras/keymap_slovenian.h index 7a8b7bec370..c479cc07ba4 100644 --- a/quantum/keymap_extras/keymap_slovenian.h +++ b/quantum/keymap_extras/keymap_slovenian.h @@ -1,5 +1,4 @@ /* Copyright 2018 Žan Pevec - * * 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 @@ -15,93 +14,158 @@ * along with this program. If not, see . */ -#ifndef KEYMAP_SLOVENIAN -#define KEYMAP_SLOVENIAN +#pragma once #include "keymap.h" -// Swapped Z and Y -#define SI_Z KC_Y -#define SI_Y KC_Z +// clang-format off -// Special characters -#define SI_CV KC_SCLN -#define SI_SV KC_LBRC -#define SI_ZV KC_BSLS +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ¸ │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ ' │ + │       │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │     │ Q │ W │ E │ R │ T │ Z │ U │ I │ O │ P │ Š │ Đ │     │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐    │ + * │      │ A │ S │ D │ F │ G │ H │ J │ K │ L │ Č │ Ć │ Ž │    │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │    │ < │ Y │ X │ C │ V │ B │ N │ M │ , │ . │ - │          │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │    │    │    │                        │    │    │    │    │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ +// Row 1 +#define SI_CEDL KC_GRV // ¸ (dead) +#define SI_1 KC_1 // 1 +#define SI_2 KC_2 // 2 +#define SI_3 KC_3 // 3 +#define SI_4 KC_4 // 4 +#define SI_5 KC_5 // 5 +#define SI_6 KC_6 // 6 +#define SI_7 KC_7 // 7 +#define SI_8 KC_8 // 8 +#define SI_9 KC_9 // 9 +#define SI_0 KC_0 // 0 +#define SI_QUOT KC_MINS // ' +#define SI_PLUS KC_EQL // + +// Row 2 +#define SI_Q KC_Q // Q +#define SI_W KC_W // W +#define SI_E KC_E // E +#define SI_R KC_R // R +#define SI_T KC_T // T +#define SI_Z KC_Y // Z +#define SI_U KC_U // U +#define SI_I KC_I // I +#define SI_O KC_O // O +#define SI_P KC_P // P +#define SI_SCAR KC_LBRC // Š +#define SI_DSTR KC_RBRC // Đ +// Row 3 +#define SI_A KC_A // A +#define SI_S KC_S // S +#define SI_D KC_D // D +#define SI_F KC_F // F +#define SI_G KC_G // G +#define SI_H KC_H // H +#define SI_J KC_J // J +#define SI_K KC_K // K +#define SI_L KC_L // L +#define SI_CCAR KC_SCLN // Č +#define SI_CACU KC_QUOT // Ć +#define SI_ZCAR KC_NUHS // Ž +// Row 4 +#define SI_LABK KC_NUBS // < +#define SI_Y KC_Z // Y +#define SI_X KC_X // X +#define SI_C KC_C // C +#define SI_V KC_V // V +#define SI_B KC_B // B +#define SI_N KC_N // N +#define SI_M KC_M // M +#define SI_COMM KC_COMM // , +#define SI_DOT KC_DOT // . +#define SI_MINS KC_SLSH // - -#define SI_A KC_A -#define SI_B KC_B -#define SI_C KC_C -#define SI_D KC_D -#define SI_E KC_E -#define SI_F KC_F -#define SI_G KC_G -#define SI_H KC_H -#define SI_I KC_I -#define SI_J KC_J -#define SI_K KC_K -#define SI_L KC_L -#define SI_M KC_M -#define SI_N KC_N -#define SI_O KC_O -#define SI_P KC_P -#define SI_Q KC_Q -#define SI_R KC_R -#define SI_S KC_S -#define SI_T KC_T -#define SI_U KC_U -#define SI_V KC_V -#define SI_W KC_W -#define SI_X KC_X +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ¨ │ ! │ " │ # │ $ │ % │ & │ / │ ( │ ) │ = │ ? │ * │       │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │     │   │   │   │   │   │   │   │   │   │   │   │   │     │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐    │ + * │      │   │   │   │   │   │   │   │   │   │   │   │   │    │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │    │ > │   │   │   │   │   │   │   │ ; │ : │ _ │          │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │    │    │    │                        │    │    │    │    │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ +// Row 1 +#define SI_DIAE S(SI_CEDL) // ¨ (dead) +#define SI_EXLM S(SI_1) // ! +#define SI_DQUO S(SI_2) // " +#define SI_HASH S(SI_3) // # +#define SI_DLR S(SI_4) // $ +#define SI_PERC S(SI_5) // % +#define SI_AMPR S(SI_6) // & +#define SI_SLSH S(SI_7) // / +#define SI_LPRN S(SI_8) // ( +#define SI_RPRN S(SI_9) // ) +#define SI_EQL S(SI_0) // = +#define SI_QUES S(SI_QUOT) // ? +#define SI_ASTR S(SI_PLUS) // * +// Row 4 +#define SI_RABK S(SI_LABK) // > +#define SI_SCLN S(SI_COMM) // ; +#define SI_COLN S(SI_DOT) // : +#define SI_UNDS S(SI_MINS) // _ -#define SI_0 KC_0 -#define SI_1 KC_1 -#define SI_2 KC_2 -#define SI_3 KC_3 -#define SI_4 KC_4 -#define SI_5 KC_5 -#define SI_6 KC_6 -#define SI_7 KC_7 -#define SI_8 KC_8 -#define SI_9 KC_9 +/* AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │   │ ~ │ ˇ │ ^ │ ˘ │ ° │ ˛ │ ` │ ˙ │ ´ │ ˝ │   │   │       │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │     │ \ │ | │ € │   │   │   │   │   │   │   │ ÷ │ × │     │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐    │ + * │      │   │   │   │ [ │ ] │   │   │ ł │ Ł │   │ ß │ ¤ │    │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │    │   │   │   │   │ @ │ { │ } │ § │   │   │   │          │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │    │    │    │                        │    │    │    │    │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ +// Row 1 +#define SI_TILD ALGR(SI_1) // ~ +#define SI_CARN ALGR(SI_2) // ˇ (dead) +#define SI_CIRC ALGR(SI_3) // ^ (dead) +#define SI_BREV ALGR(SI_4) // ˘ (dead) +#define SI_DEG ALGR(SI_5) // ° (dead) +#define SI_OGON ALGR(SI_6) // ˛ (dead) +#define SI_GRV ALGR(SI_7) // ` +#define SI_DOTA ALGR(SI_8) // ˙ (dead) +#define SI_ACCU ALGR(SI_9) // ´ (dead) +#define SI_DACU ALGR(SI_0) // ˝ (dead) +// Row 2 +#define SI_BSLS ALGR(SI_Q) // (backslash) +#define SI_PIPE ALGR(SI_W) // | +#define SI_EURO ALGR(SI_E) // € +#define SI_DIV ALGR(SI_SCAR) // ÷ +#define SI_MUL ALGR(SI_DSTR) // × +// Row 3 +#define SI_LBRC ALGR(SI_F) // [ +#define SI_RBRC ALGR(SI_G) // ] +#define SI_LLST ALGR(SI_K) // ł +#define SI_CLST ALGR(SI_L) // Ł +#define SI_SS ALGR(SI_CACU) // ß +#define SI_CURR ALGR(SI_ZCAR) // ¤ +// Row 4 +#define SI_AT ALGR(SI_V) // @ +#define SI_LCBR ALGR(SI_B) // { +#define SI_RCBR ALGR(SI_N) // } +#define SI_SECT ALGR(SI_M) // § -#define SI_DOT KC_DOT -#define SI_COMM KC_COMM - -#define SI_PLUS KC_EQL // + and * and ~ -#define SI_QOT KC_MINS // Single quote -#define SI_MINS KC_SLSH // - and _ - -// shifted characters -#define SI_EXLM LSFT(KC_1) // ! -#define SI_DQOT LSFT(KC_2) // " -#define SI_HASH LSFT(KC_3) // # -#define SI_DLR LSFT(KC_4) // $ -#define SI_PERC LSFT(KC_5) // % -#define SI_AMPR LSFT(KC_6) // & -#define SI_SLSH LSFT(KC_7) // / -#define SI_LPRN LSFT(KC_8) // ( -#define SI_RPRN LSFT(KC_9) // ) -#define SI_EQL LSFT(KC_0) // = -#define SI_QST LSFT(SI_QOT) // ? -#define SI_ASTR LSFT(SI_PLUS) // * -#define SI_COLN LSFT(KC_DOT) // : -#define SI_SCLN LSFT(KC_COMM) // ; -#define SI_UNDS LSFT(SI_MINS) // _ - -// Alt Gr-ed characters -#define SI_CIRC ALGR(KC_3) // ^ -#define SI_DEG ALGR(KC_5) // ° -#define SI_GRV ALGR(KC_7) // ` -#define SI_ACCU ALGR(KC_9) // ´ -#define SI_LCBR ALGR(KC_B) // { -#define SI_RCBR ALGR(KC_N) // } -#define SI_LBRC ALGR(KC_F) // [ -#define SI_RBRC ALGR(KC_G) // ] -#define SI_BSLS ALGR(KC_Q) // backslash -#define SI_AT ALGR(KC_V) // @ -#define SI_EURO ALGR(KC_E) // € -#define SI_TILD ALGR(KC_1) // ~ -#define SI_PIPE ALGR(KC_W) // | - -#endif +// DEPRECATED +#define SI_QOT SI_QUOT +#define SI_SV SI_SCAR +#define SI_CV SI_CCAR +#define SI_ZV SI_ZCAR +#define SI_DQOT SI_DQUO +#define SI_QST SI_QUES diff --git a/quantum/keymap_extras/sendstring_slovenian.h b/quantum/keymap_extras/sendstring_slovenian.h new file mode 100644 index 00000000000..adf7ea47db9 --- /dev/null +++ b/quantum/keymap_extras/sendstring_slovenian.h @@ -0,0 +1,100 @@ +/* Copyright 2019 + * + * 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 . + */ + +// Sendstring lookup tables for Slovenian layouts + +#pragma once + +#include "keymap_slovenian.h" +#include "quantum.h" + +// clang-format off + +const uint8_t ascii_to_shift_lut[16] PROGMEM = { + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + + KCLUT_ENTRY(0, 1, 1, 1, 1, 1, 1, 0), + KCLUT_ENTRY(1, 1, 1, 0, 0, 0, 0, 1), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 1, 1, 0, 1, 1, 1), + KCLUT_ENTRY(0, 1, 1, 1, 1, 1, 1, 1), + KCLUT_ENTRY(1, 1, 1, 1, 1, 1, 1, 1), + KCLUT_ENTRY(1, 1, 1, 1, 1, 1, 1, 1), + KCLUT_ENTRY(1, 1, 1, 0, 0, 0, 0, 1), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0) +}; + +const uint8_t ascii_to_altgr_lut[16] PROGMEM = { + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(1, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 1, 1, 1, 1, 0), + KCLUT_ENTRY(1, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 1, 1, 1, 1, 0) +}; + +const uint8_t ascii_to_keycode_lut[128] PROGMEM = { + // NUL SOH STX ETX EOT ENQ ACK BEL + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + // BS TAB LF VT FF CR SO SI + KC_BSPC, KC_TAB, KC_ENT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + // DLE DC1 DC2 DC3 DC4 NAK SYN ETB + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + // CAN EM SUB ESC FS GS RS US + XXXXXXX, XXXXXXX, XXXXXXX, KC_ESC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + + // ! " # $ % & ' + KC_SPC, SI_1, SI_2, SI_3, SI_4, SI_5, SI_6, SI_QUOT, + // ( ) * + , - . / + SI_8, SI_9, SI_PLUS, SI_PLUS, SI_COMM, SI_MINS, SI_DOT, SI_7, + // 0 1 2 3 4 5 6 7 + SI_0, SI_1, SI_2, SI_3, SI_4, SI_5, SI_6, SI_7, + // 8 9 : ; < = > ? + SI_8, SI_9, SI_DOT, SI_COMM, SI_LABK, SI_0, SI_LABK, SI_QUOT, + // @ A B C D E F G + SI_V, SI_A, SI_B, SI_C, SI_D, SI_E, SI_F, SI_G, + // H I J K L M N O + SI_H, SI_I, SI_J, SI_K, SI_L, SI_M, SI_N, SI_O, + // P Q R S T U V W + SI_P, SI_Q, SI_R, SI_S, SI_T, SI_U, SI_V, SI_W, + // X Y Z [ \ ] ^ _ + SI_X, SI_Y, SI_Z, SI_F, SI_Q, SI_G, SI_3, SI_MINS, + // ` a b c d e f g + SI_7, SI_A, SI_B, SI_C, SI_D, SI_E, SI_F, SI_G, + // h i j k l m n o + SI_H, SI_I, SI_J, SI_K, SI_L, SI_M, SI_N, SI_O, + // p q r s t u v w + SI_P, SI_Q, SI_R, SI_S, SI_T, SI_U, SI_V, SI_W, + // x y z { | } ~ DEL + SI_X, SI_Y, SI_Z, SI_B, SI_W, SI_N, SI_1, KC_DEL +}; From 5f1f370463d818a5283a17001ad832073efc45a4 Mon Sep 17 00:00:00 2001 From: Ryan Date: Mon, 16 Mar 2020 07:41:34 +1100 Subject: [PATCH 08/18] Update Belgian keymap and sendstring LUT (#8349) --- quantum/keymap_extras/keymap_belgian.h | 235 +++++++++++++-------- quantum/keymap_extras/sendstring_belgian.h | 26 +-- 2 files changed, 162 insertions(+), 99 deletions(-) diff --git a/quantum/keymap_extras/keymap_belgian.h b/quantum/keymap_extras/keymap_belgian.h index 55a0d892c52..a6912afef54 100644 --- a/quantum/keymap_extras/keymap_belgian.h +++ b/quantum/keymap_extras/keymap_belgian.h @@ -13,96 +13,159 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#ifndef KEYMAP_BELGIAN_H -#define KEYMAP_BELGIAN_H + +#pragma once #include "keymap.h" -// Normal characters -// Line 1 -#define BE_SUP2 KC_GRV -#define BE_AMP KC_1 -#define BE_EACU KC_2 -#define BE_QUOT KC_3 -#define BE_APOS KC_4 -#define BE_LPRN KC_5 -#define BE_PARA KC_6 -#define BE_EGRV KC_7 -#define BE_EXLM KC_8 -#define BE_CCED KC_9 -#define BE_AGRV KC_0 -#define BE_RPRN KC_MINS -#define BE_MINS KC_EQL +// clang-format off -// Line 2 -#define BE_A KC_Q -#define BE_Z KC_W -#define BE_CIRC KC_LBRC -#define BE_DLR KC_RBRC +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ² │ & │ é │ " │ ' │ ( │ § │ è │ ! │ ç │ à │ ) │ - │       │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │     │ A │ Z │ E │ R │ T │ Y │ U │ I │ O │ P │ ^ │ $ │     │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐    │ + * │      │ Q │ S │ D │ F │ G │ H │ J │ K │ L │ M │ ù │ µ │    │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │    │ < │ W │ X │ C │ V │ B │ N │ , │ ; │ : │ = │          │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │    │    │    │                        │    │    │    │    │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ +// Row 1 +#define BE_SUP2 KC_GRV // ² +#define BE_AMPR KC_1 // & +#define BE_EACU KC_2 // é +#define BE_DQUO KC_3 // " +#define BE_QUOT KC_4 // ' +#define BE_LPRN KC_5 // ( +#define BE_SECT KC_6 // § +#define BE_EGRV KC_7 // è +#define BE_EXLM KC_8 // ! +#define BE_CCED KC_9 // ç +#define BE_AGRV KC_0 // à +#define BE_RPRN KC_MINS // ) +#define BE_MINS KC_EQL // - +// Row 2 +#define BE_A KC_Q // A +#define BE_Z KC_W // Z +#define BE_E KC_E // E +#define BE_R KC_R // R +#define BE_T KC_T // T +#define BE_Y KC_Y // Y +#define BE_U KC_U // U +#define BE_I KC_I // I +#define BE_O KC_O // O +#define BE_P KC_P // P +#define BE_DCIR KC_LBRC // ^ (dead) +#define BE_DLR KC_RBRC // $ +// Row 3 +#define BE_Q KC_A // Q +#define BE_S KC_S // S +#define BE_D KC_D // D +#define BE_F KC_F // F +#define BE_G KC_G // G +#define BE_H KC_H // H +#define BE_J KC_K // J +#define BE_K KC_K // K +#define BE_L KC_L // L +#define BE_M KC_SCLN // M +#define BE_UGRV KC_QUOT // ù +#define BE_MICR KC_NUHS // µ +// Row 4 +#define BE_LABK KC_NUBS // < +#define BE_W KC_Z // W +#define BE_X KC_X // X +#define BE_C KC_C // C +#define BE_V KC_V // V +#define BE_B KC_B // B +#define BE_N KC_N // N +#define BE_COMM KC_M // , +#define BE_SCLN KC_COMM // ; +#define BE_COLN KC_DOT // : +#define BE_EQL KC_SLSH // = -// Line 3 -#define BE_Q KC_A -#define BE_M KC_SCLN -#define BE_UGRV KC_QUOT -#define BE_MU KC_NUHS +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ³ │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ ° │ _ │       │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │     │   │   │   │   │   │   │   │   │   │   │ ¨ │ * │     │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐    │ + * │      │   │   │   │   │   │   │   │   │   │   │ % │ £ │    │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │    │ > │   │   │   │   │   │   │ ? │ . │ / │ + │          │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │    │    │    │                        │    │    │    │    │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ +// Row 1 +#define BE_SUP3 S(BE_SUP2) // ³ +#define BE_1 S(BE_AMPR) // 1 +#define BE_2 S(BE_EACU) // 2 +#define BE_3 S(BE_DQUO) // 3 +#define BE_4 S(BE_QUOT) // 4 +#define BE_5 S(BE_LPRN) // 5 +#define BE_6 S(BE_SECT) // 6 +#define BE_7 S(BE_EGRV) // 7 +#define BE_8 S(BE_EXLM) // 8 +#define BE_9 S(BE_CCED) // 9 +#define BE_0 S(BE_AGRV) // 0 +#define BE_RNGA S(BE_RPRN) // ° +#define BE_UNDS S(BE_MINS) // _ +// Row 2 +#define BE_DIAE S(BE_DCIR) // ¨ (dead) +#define BE_ASTR S(BE_DLR) // * +// Row 3 +#define BE_PERC S(BE_UGRV) // % +#define BE_PND S(BE_MICR) // £ +// Row 4 +#define BE_RABK S(BE_LABK) // > +#define BE_QUES S(BE_COMM) // ? +#define BE_DOT S(BE_SCLN) // . +#define BE_SLSH S(BE_COLN) // / +#define BE_PLUS S(BE_EQL) // + -// Line 4 -#define BE_LESS KC_NUBS -#define BE_W KC_Z -#define BE_COMM KC_M -#define BE_SCLN KC_COMM -#define BE_COLN KC_DOT -#define BE_EQL KC_SLSH +/* AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │   │ | │ @ │ # │   │   │ ^ │   │   │ { │ } │   │   │       │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │     │   │   │ € │   │   │   │   │   │   │   │ [ │ ] │     │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐    │ + * │      │   │   │   │   │   │   │   │   │   │   │ ´ │ ` │    │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │    │ \ │   │   │   │   │   │   │   │   │   │ ~ │          │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │    │    │    │                        │    │    │    │    │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ +// Row 1 +#define BE_PIPE ALGR(BE_AMPR) // | +#define BE_AT ALGR(BE_EACU) // @ +#define BE_HASH ALGR(BE_DQUO) // # +#define BE_CIRC ALGR(BE_SECT) // ^ +#define BE_LCBR ALGR(BE_CCED) // { +#define BE_RCBR ALGR(BE_AGRV) // } +// Row 2 +#define BE_EURO ALGR(BE_E) // € +#define BE_LBRC ALGR(BE_DCIR) // [ +#define BE_RBRC ALGR(BE_DLR) // ] +// Row 3 +#define BE_ACUT ALGR(BE_UGRV) // ´ (dead) +#define BE_GRV ALGR(BE_MICR) // ` (dead) +// Row 4 +#define BE_BSLS ALGR(BE_LABK) // (backslash) +#define BE_TILD ALGR(BE_EQL) // ~ -// Shifted characters -// Line 1 -#define BE_SUP3 KC_TILD -#define BE_1 LSFT(KC_1) -#define BE_2 LSFT(KC_2) -#define BE_3 LSFT(KC_3) -#define BE_4 LSFT(KC_4) -#define BE_5 LSFT(KC_5) -#define BE_6 LSFT(KC_6) -#define BE_7 LSFT(KC_7) -#define BE_8 LSFT(KC_8) -#define BE_9 LSFT(KC_9) -#define BE_0 LSFT(KC_0) -#define BE_OVRR KC_UNDS -#define BE_UNDS KC_PLUS - -// Line 2 -#define BE_UMLT LSFT(BE_CIRC) -#define BE_PND LSFT(BE_DLR) - -// Line 3 -#define BE_PERC LSFT(BE_UGRV) - -// Line 4 -#define BE_GRTR LSFT(BE_LESS) -#define BE_QUES LSFT(BE_COMM) -#define BE_DOT LSFT(BE_SCLN) -#define BE_SLSH LSFT(BE_COLN) -#define BE_PLUS LSFT(BE_EQL) - -// Alt Gr-ed characters -// Line 1 -#define BE_PIPE ALGR(KC_1) -#define BE_AT ALGR(KC_2) -#define BE_HASH ALGR(KC_3) -#define BE_LCBR ALGR(KC_9) -#define BE_RCBR ALGR(KC_0) - -// Line 2 -#define BE_EURO ALGR(KC_E) -#define BE_LSBR ALGR(BE_CIRC) -#define BE_RSBR ALGR(BE_DLR) - -// Line 3 -#define BE_ACUT ALGR(BE_UGRV) -#define BE_GRV ALGR(BE_MU) - -// Line 4 -#define BE_BSLS ALGR(BE_LESS) -#define BE_TILT ALGR(BE_EQL) - -#endif +// DEPRECATED +#define BE_AMP BE_AMPR +#define BE_APOS BE_QUOT +#define BE_PARA BE_SECT +#define BE_MU BE_MICR +#define BE_LESS BE_LABK +#define BE_OVRR BE_RNGA +#define BE_UMLT BE_DIAE +#define BE_GRTR BE_RABK +#define BE_LSBR BE_LBRC +#define BE_RSBR BE_RBRC +#define BE_TILT BE_TILD diff --git a/quantum/keymap_extras/sendstring_belgian.h b/quantum/keymap_extras/sendstring_belgian.h index ef5a2f049d9..5e9a079a956 100644 --- a/quantum/keymap_extras/sendstring_belgian.h +++ b/quantum/keymap_extras/sendstring_belgian.h @@ -40,7 +40,7 @@ const uint8_t ascii_to_shift_lut[16] PROGMEM = { KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), - KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0) }; const uint8_t ascii_to_altgr_lut[16] PROGMEM = { @@ -60,7 +60,7 @@ const uint8_t ascii_to_altgr_lut[16] PROGMEM = { KCLUT_ENTRY(1, 0, 0, 0, 0, 0, 0, 0), KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), - KCLUT_ENTRY(0, 0, 0, 1, 1, 1, 1, 0), + KCLUT_ENTRY(0, 0, 0, 1, 1, 1, 1, 0) }; const uint8_t ascii_to_keycode_lut[128] PROGMEM = { @@ -74,27 +74,27 @@ const uint8_t ascii_to_keycode_lut[128] PROGMEM = { XXXXXXX, XXXXXXX, XXXXXXX, KC_ESC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, // ! " # $ % & ' - KC_SPC, BE_EXLM, BE_QUOT, BE_QUOT, BE_DLR, BE_UGRV, BE_AMP, BE_APOS, + KC_SPC, BE_EXLM, BE_DQUO, BE_DQUO, BE_DLR, BE_UGRV, BE_AMPR, BE_QUOT, // ( ) * + , - . / BE_LPRN, BE_RPRN, BE_DLR, BE_EQL, BE_COMM, BE_MINS, BE_SCLN, BE_COLN, // 0 1 2 3 4 5 6 7 - BE_AGRV, BE_AMP, BE_EACU, BE_QUOT, BE_APOS, BE_LPRN, BE_PARA, BE_EGRV, + BE_AGRV, BE_AMPR, BE_EACU, BE_DQUO, BE_QUOT, BE_LPRN, BE_SECT, BE_EGRV, // 8 9 : ; < = > ? - BE_EXLM, BE_CCED, BE_COLN, BE_SCLN, BE_LESS, BE_EQL, BE_LESS, BE_COMM, + BE_EXLM, BE_CCED, BE_COLN, BE_SCLN, BE_LABK, BE_EQL, BE_LABK, BE_COMM, // @ A B C D E F G - BE_EACU, BE_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, + BE_EACU, BE_A, BE_B, BE_C, BE_D, BE_E, BE_F, BE_G, // H I J K L M N O - KC_H, KC_I, KC_J, KC_K, KC_L, BE_M, KC_N, KC_O, + BE_H, BE_I, BE_J, BE_K, BE_L, BE_M, BE_N, BE_O, // P Q R S T U V W - KC_P, BE_Q, KC_R, KC_S, KC_T, KC_U, KC_V, BE_W, + BE_P, BE_Q, BE_R, BE_S, BE_T, BE_U, BE_V, BE_W, // X Y Z [ \ ] ^ _ - KC_X, KC_Y, BE_Z, BE_CIRC, BE_LESS, BE_DLR, BE_PARA, BE_MINS, + BE_X, BE_Y, BE_Z, BE_CIRC, BE_LABK, BE_DLR, BE_SECT, BE_MINS, // ` a b c d e f g - BE_MU, BE_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, + BE_MICR, BE_A, BE_B, BE_C, BE_D, BE_E, BE_F, BE_G, // h i j k l m n o - KC_H, KC_I, KC_J, KC_K, KC_L, BE_M, KC_N, KC_O, + BE_H, BE_I, BE_J, BE_K, BE_L, BE_M, BE_N, BE_O, // p q r s t u v w - KC_P, BE_Q, KC_R, KC_S, KC_T, KC_U, KC_V, BE_W, + BE_P, BE_Q, BE_R, BE_S, BE_T, BE_U, BE_V, BE_W, // x y z { | } ~ DEL - KC_X, KC_Y, BE_Z, BE_CCED, BE_AMP, BE_AGRV, BE_EQL, KC_DEL + BE_X, BE_Y, BE_Z, BE_CCED, BE_AMPR, BE_AGRV, BE_EQL, KC_DEL }; From b272c035ba7fa8555a88c922b3e94c3f3817c4ff Mon Sep 17 00:00:00 2001 From: James Young <18669334+noroadsleft@users.noreply.github.com> Date: Sun, 15 Mar 2020 20:29:11 -0700 Subject: [PATCH 09/18] [Docs] Random Fixes (#8340) * fix CLI section links in the Summary * fix heading in Pointing Device doc * fix headings in PS/2 Mouse Support doc * add explicit section ids to I2C Master Driver doc * reformat GPIO Controls table Much like the I2C Master Driver doc, I found this a bit less than ideal to read. (The table was actually wider than the space available for it.) Reformatted so each GPIO function is an H3 heading, followed by a paragraph and a table of each architecture's old-style function. * migrate changes from I2C Master Driver doc to Japanese translation * add explicit anchors to I2C Master Driver docs * fix code block language markers The language markers are case-sensitive; using the wrong case means the syntax highlighting doesn't work. Good: ```c Bad: ```C * restore Japanese I2C Master Driver doc to current master Can't update the internal tracking references accurately until the changes to the English doc are committed to master. * add explicit anchors to edited files * change ChibiOS/ARM to ARM/ChibiOS Because ARM/ATSAM is also a thing that exists. * fix code block language markers again Used the wrong markers in a few spots. Also these are apparently always supposed to be lowercase. * add section anchors to cli.md * restore table formatting on GPIO Control doc * remove changes to _summary.md --- docs/cli.md | 12 +++---- docs/feature_pointing_device.md | 6 ++-- docs/feature_ps2_mouse.md | 59 +++++++++++++++++---------------- docs/feature_rgb_matrix.md | 56 +++++++++++++++---------------- docs/feature_stenography.md | 28 ++++++++-------- docs/i2c_driver.md | 24 +++++++------- docs/internals_gpio_control.md | 26 +++++++-------- 7 files changed, 106 insertions(+), 105 deletions(-) diff --git a/docs/cli.md b/docs/cli.md index 165f2a37214..760fe1cdb56 100644 --- a/docs/cli.md +++ b/docs/cli.md @@ -1,14 +1,14 @@ -# QMK CLI +# QMK CLI :id=qmk-cli -## Overview +## Overview :id=overview The QMK CLI makes building and working with QMK keyboards easier. We have provided a number of commands to simplify and streamline tasks such as obtaining and compiling the QMK firmware, creating keymaps, and more. -### Requirements +### Requirements :id=requirements The CLI requires Python 3.5 or greater. We try to keep the number of requirements small but you will also need to install the packages listed in [`requirements.txt`](https://github.com/qmk/qmk_firmware/blob/master/requirements.txt). These are installed automatically when you install the QMK CLI. -### Install Using Homebrew (macOS, some Linux) +### Install Using Homebrew (macOS, some Linux) :id=install-using-homebrew If you have installed [Homebrew](https://brew.sh) you can tap and install QMK: @@ -19,7 +19,7 @@ export QMK_HOME='~/qmk_firmware' # Optional, set the location for `qmk_firmware` qmk setup # This will clone `qmk/qmk_firmware` and optionally set up your build environment ``` -### Install Using easy_install or pip +### Install Using easy_install or pip :id=install-using-easy_install-or-pip If your system is not listed above you can install QMK manually. First ensure that you have python 3.5 (or later) installed and have installed pip. Then install QMK with this command: @@ -29,7 +29,7 @@ export QMK_HOME='~/qmk_firmware' # Optional, set the location for `qmk_firmware` qmk setup # This will clone `qmk/qmk_firmware` and optionally set up your build environment ``` -### Packaging For Other Operating Systems +### Packaging For Other Operating Systems :id=packaging-for-other-operating-systems We are looking for people to create and maintain a `qmk` package for more operating systems. If you would like to create a package for your OS please follow these guidelines: diff --git a/docs/feature_pointing_device.md b/docs/feature_pointing_device.md index 8ad428939a0..b90c341d5ed 100644 --- a/docs/feature_pointing_device.md +++ b/docs/feature_pointing_device.md @@ -1,10 +1,10 @@ -## Pointing Device +# Pointing Device :id=pointing-device Pointing Device is a generic name for a feature intended to be generic: moving the system pointer around. There are certainly other options for it - like mousekeys - but this aims to be easily modifiable and lightweight. You can implement custom keys to control functionality, or you can gather information from other peripherals and insert it directly here - let QMK handle the processing for you. To enable Pointing Device, uncomment the following line in your rules.mk: -``` +```makefile POINTING_DEVICE_ENABLE = yes ``` @@ -25,7 +25,7 @@ When the mouse report is sent, the x, y, v, and h values are set to 0 (this is d In the following example, a custom key is used to click the mouse and scroll 127 units vertically and horizontally, then undo all of that when released - because that's a totally useful function. Listen, this is an example: -``` +```c case MS_SPECIAL: report_mouse_t currentReport = pointing_device_get_report(); if (record->event.pressed) diff --git a/docs/feature_ps2_mouse.md b/docs/feature_ps2_mouse.md index d138967991f..ce072fbe935 100644 --- a/docs/feature_ps2_mouse.md +++ b/docs/feature_ps2_mouse.md @@ -1,4 +1,4 @@ -## PS/2 Mouse Support +# PS/2 Mouse Support :id=ps2-mouse-support Its possible to hook up a PS/2 mouse (for example touchpads or trackpoints) to your keyboard as a composite device. @@ -6,7 +6,7 @@ To hook up a Trackpoint, you need to obtain a Trackpoint module (i.e. harvest fr There are three available modes for hooking up PS/2 devices: USART (best), interrupts (better) or busywait (not recommended). -### The Cirtuitry between Trackpoint and Controller +## The Circuitry between Trackpoint and Controller :id=the-circuitry-between-trackpoint-and-controller To get the things working, a 4.7K drag is needed between the two lines DATA and CLK and the line 5+. @@ -24,20 +24,20 @@ MODULE 5+ --------+--+--------- PWR CONTROLLER ``` -### Busywait Version +## Busywait Version :id=busywait-version Note: This is not recommended, you may encounter jerky movement or unsent inputs. Please use interrupt or USART version if possible. In rules.mk: -``` +```makefile PS2_MOUSE_ENABLE = yes PS2_USE_BUSYWAIT = yes ``` In your keyboard config.h: -``` +```c #ifdef PS2_USE_BUSYWAIT # define PS2_CLOCK_PORT PORTD # define PS2_CLOCK_PIN PIND @@ -50,20 +50,20 @@ In your keyboard config.h: #endif ``` -### Interrupt Version +## Interrupt Version :id=interrupt-version The following example uses D2 for clock and D5 for data. You can use any INT or PCINT pin for clock, and any pin for data. In rules.mk: -``` +```makefile PS2_MOUSE_ENABLE = yes PS2_USE_INT = yes ``` In your keyboard config.h: -``` +```c #ifdef PS2_USE_INT #define PS2_CLOCK_PORT PORTD #define PS2_CLOCK_PIN PIND @@ -88,20 +88,20 @@ In your keyboard config.h: #endif ``` -### USART Version +## USART Version :id=usart-version To use USART on the ATMega32u4, you have to use PD5 for clock and PD2 for data. If one of those are unavailable, you need to use interrupt version. In rules.mk: -``` +```makefile PS2_MOUSE_ENABLE = yes PS2_USE_USART = yes ``` In your keyboard config.h: -``` +```c #ifdef PS2_USE_USART #define PS2_CLOCK_PORT PORTD #define PS2_CLOCK_PIN PIND @@ -145,13 +145,13 @@ In your keyboard config.h: #endif ``` -### Additional Settings +## Additional Settings :id=additional-settings -#### PS/2 Mouse Features +### PS/2 Mouse Features :id=ps2-mouse-features These enable settings supported by the PS/2 mouse protocol. -``` +```c /* Use remote mode instead of the default stream mode (see link) */ #define PS2_MOUSE_USE_REMOTE_MODE @@ -170,7 +170,7 @@ These enable settings supported by the PS/2 mouse protocol. You can also call the following functions from ps2_mouse.h -``` +```c void ps2_mouse_disable_data_reporting(void); void ps2_mouse_enable_data_reporting(void); @@ -188,36 +188,36 @@ void ps2_mouse_set_resolution(ps2_mouse_resolution_t resolution); void ps2_mouse_set_sample_rate(ps2_mouse_sample_rate_t sample_rate); ``` -#### Fine Control +### Fine Control :id=fine-control Use the following defines to change the sensitivity and speed of the mouse. Note: you can also use `ps2_mouse_set_resolution` for the same effect (not supported on most touchpads). -``` +```c #define PS2_MOUSE_X_MULTIPLIER 3 #define PS2_MOUSE_Y_MULTIPLIER 3 #define PS2_MOUSE_V_MULTIPLIER 1 ``` -#### Scroll Button +### Scroll Button :id=scroll-button If you're using a trackpoint, you will likely want to be able to use it for scrolling. It's possible to enable a "scroll button/s" that when pressed will cause the mouse to scroll instead of moving. To enable the feature, you must set a scroll button mask as follows: -``` +```c #define PS2_MOUSE_SCROLL_BTN_MASK (1<.c`: -```C +```c const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { /* Refer to IS31 manual for these locations * driver @@ -55,19 +55,19 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { Where `Cx_y` is the location of the LED in the matrix defined by [the datasheet](http://www.issi.com/WW/pdf/31FL3731.pdf) and the header file `drivers/issi/is31fl3731.h`. The `driver` is the index of the driver you defined in your `config.h` (`0` or `1` right now). --- -### IS31FL3733/IS31FL3737 +### IS31FL3733/IS31FL3737 :id=is31fl3733is31fl3737 !> For the IS31FL3737, replace all instances of `IS31FL3733` below with `IS31FL3737`. There is basic support for addressable RGB matrix lighting with the I2C IS31FL3733 RGB controller. To enable it, add this to your `rules.mk`: -```C +```makefile RGB_MATRIX_ENABLE = IS31FL3733 ``` Configure the hardware via your `config.h`: -```C +```c // This is a 7-bit address, that gets left-shifted and bit 0 // set to 0 for write, 1 for read (as per I2C protocol) // The address will vary depending on your wiring: @@ -90,7 +90,7 @@ Currently only a single drivers is supported, but it would be trivial to support Define these arrays listing all the LEDs in your `.c`: -```C +```c const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { /* Refer to IS31 manual for these locations * driver @@ -107,17 +107,17 @@ Where `X_Y` is the location of the LED in the matrix defined by [the datasheet]( --- -### WS2812 +### WS2812 :id=ws2812 There is basic support for addressable RGB matrix lighting with a WS2811/WS2812{a,b,c} addressable LED strand. To enable it, add this to your `rules.mk`: -```C +```makefile RGB_MATRIX_ENABLE = WS2812 ``` Configure the hardware via your `config.h`: -```C +```c // The pin connected to the data pin of the LEDs #define RGB_DI_PIN D7 // The number of LEDs connected @@ -128,7 +128,7 @@ Configure the hardware via your `config.h`: From this point forward the configuration is the same for all the drivers. The `led_config_t` struct provides a key electrical matrix to led index lookup table, what the physical position of each LED is on the board, and what type of key or usage the LED if the LED represents. Here is a brief example: -```C +```c const led_config_t g_led_config = { { // Key Matrix to LED Index { 5, NO_LED, NO_LED, 0 }, @@ -146,7 +146,7 @@ const led_config_t g_led_config = { { The first part, `// Key Matrix to LED Index`, tells the system what key this LED represents by using the key's electrical matrix row & col. The second part, `// LED Index to Physical Position` represents the LED's physical `{ x, y }` position on the keyboard. The default expected range of values for `{ x, y }` is the inclusive range `{ 0..224, 0..64 }`. This default expected range is due to effects that calculate the center of the keyboard for their animations. The easiest way to calculate these positions is imagine your keyboard is a grid, and the top left of the keyboard represents `{ x, y }` coordinate `{ 0, 0 }` and the bottom right of your keyboard represents `{ 224, 64 }`. Using this as a basis, you can use the following formula to calculate the physical position: -```C +```c x = 224 / (NUMBER_OF_COLS - 1) * COL_POSITION y = 64 / (NUMBER_OF_ROWS - 1) * ROW_POSITION ``` @@ -157,7 +157,7 @@ As mentioned earlier, the center of the keyboard by default is expected to be `{ `// LED Index to Flag` is a bitmask, whether or not a certain LEDs is of a certain type. It is recommended that LEDs are set to only 1 type. -## Flags +## Flags :id=flags |Define |Description | |------------------------------------|-------------------------------------------| @@ -169,7 +169,7 @@ As mentioned earlier, the center of the keyboard by default is expected to be `{ |`#define LED_FLAG_UNDERGLOW 0x02` |If the LED is for underglow. | |`#define LED_FLAG_KEYLIGHT 0x04` |If the LED is for key backlight. | -## Keycodes +## Keycodes :id=keycodes All RGB keycodes are currently shared with the RGBLIGHT system: @@ -189,11 +189,11 @@ All RGB keycodes are currently shared with the RGBLIGHT system: * `RGB_MODE_*` keycodes will generally work, but are not currently mapped to the correct effects for the RGB Matrix system -## RGB Matrix Effects +## RGB Matrix Effects :id=rgb-matrix-effects All effects have been configured to support current configuration values (Hue, Saturation, Value, & Speed) unless otherwise noted below. These are the effects that are currently available: -```C +```c enum rgb_matrix_effects { RGB_MATRIX_NONE = 0, RGB_MATRIX_SOLID_COLOR = 1, // Static single hue, no speed support @@ -285,7 +285,7 @@ You can disable a single effect by defining `DISABLE_[EFFECT_NAME]` in your `con |`#define DISABLE_RGB_MATRIX_SOLID_MULTISPLASH` |Disables `RGB_MATRIX_SOLID_MULTISPLASH` | -## Custom RGB Matrix Effects +## Custom RGB Matrix Effects :id=custom-rgb-matrix-effects By setting `RGB_MATRIX_CUSTOM_USER` (and/or `RGB_MATRIX_CUSTOM_KB`) in `rules.mk`, new effects can be defined directly from userspace, without having to edit any QMK core files. @@ -294,7 +294,7 @@ To declare new effects, create a new `rgb_matrix_user/kb.inc` that looks somethi `rgb_matrix_user.inc` should go in the root of the keymap directory. `rgb_matrix_kb.inc` should go in the root of the keyboard directory. -```C +```c // !!! DO NOT ADD #pragma once !!! // // Step 1. @@ -341,7 +341,7 @@ static bool my_cool_effect2(effect_params_t* params) { For inspiration and examples, check out the built-in effects under `quantum/rgb_matrix_animation/` -## Colors +## Colors :id=colors These are shorthands to popular colors. The `RGB` ones can be passed to the `setrgb` functions, while the `HSV` ones to the `sethsv` functions. @@ -369,9 +369,9 @@ These are shorthands to popular colors. The `RGB` ones can be passed to the `set These are defined in [`rgblight_list.h`](https://github.com/qmk/qmk_firmware/blob/master/quantum/rgblight_list.h). Feel free to add to this list! -## Additional `config.h` Options +## Additional `config.h` Options :id=additional-configh-options -```C +```c #define RGB_MATRIX_KEYPRESSES // reacts to keypresses #define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (instead of keypresses) #define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects @@ -386,21 +386,21 @@ These are defined in [`rgblight_list.h`](https://github.com/qmk/qmk_firmware/blo #define RGB_MATRIX_STARTUP_SPD 127 // Sets the default animation speed, if none has been set ``` -## EEPROM storage +## EEPROM storage :id=eeprom-storage The EEPROM for it is currently shared with the RGBLIGHT system (it's generally assumed only one RGB would be used at a time), but could be configured to use its own 32bit address with: -```C +```c #define EECONFIG_RGB_MATRIX (uint32_t *)28 ``` Where `28` is an unused index from `eeconfig.h`. -## Suspended state +## Suspended state :id=suspended-state To use the suspend feature, add this to your `.c`: -```C +```c void suspend_power_down_kb(void) { rgb_matrix_set_suspend_state(true); diff --git a/docs/feature_stenography.md b/docs/feature_stenography.md index 4d7374a03a9..099993f8579 100644 --- a/docs/feature_stenography.md +++ b/docs/feature_stenography.md @@ -1,16 +1,16 @@ -# Stenography in QMK +# Stenography in QMK :id=stenography-in-qmk [Stenography](https://en.wikipedia.org/wiki/Stenotype) is a method of writing most often used by court reports, closed-captioning, and real-time transcription for the deaf. In stenography words are chorded syllable by syllable with a mixture of spelling, phonetic, and shortcut (briefs) strokes. Professional stenographers can reach 200-300 WPM without any of the strain usually found in standard typing and with far fewer errors (>99.9% accuracy). The [Open Steno Project](http://www.openstenoproject.org/) has built an open-source program called Plover that provides real-time translation of steno strokes into words and commands. It has an established dictionary and supports -## Plover with QWERTY Keyboard +## Plover with QWERTY Keyboard :id=plover-with-qwerty-keyboard Plover can work with any standard QWERTY keyboard, although it is more efficient if the keyboard supports NKRO (n-key rollover) to allow Plover to see all the pressed keys at once. An example keymap for Plover can be found in `planck/keymaps/default`. Switching to the `PLOVER` layer adjusts the position of the keyboard to support the number bar. To use Plover with QMK just enable NKRO and optionally adjust your layout if you have anything other than a standard layout. You may also want to purchase some steno-friendly keycaps to make it easier to hit multiple keys. -## Plover with Steno Protocol +## Plover with Steno Protocol :id=plover-with-steno-protocol Plover also understands the language of several steno machines. QMK can speak a couple of these languages, TX Bolt and GeminiPR. An example layout can be found in `planck/keymaps/steno`. @@ -20,26 +20,26 @@ In this mode Plover expects to speak with a steno machine over a serial port so > Note: Due to hardware limitations you may not be able to run both a virtual serial port and mouse emulation at the same time. -### TX Bolt +### TX Bolt :id=tx-bolt TX Bolt communicates the status of 24 keys over a very simple protocol in variable-sized (1-5 byte) packets. -### GeminiPR +### GeminiPR :id=geminipr GeminiPR encodes 42 keys into a 6-byte packet. While TX Bolt contains everything that is necessary for standard stenography, GeminiPR opens up many more options, including supporting non-English theories. -## Configuring QMK for Steno +## Configuring QMK for Steno :id=configuring-qmk-for-steno Firstly, enable steno in your keymap's Makefile. You may also need disable mousekeys, extra keys, or another USB endpoint to prevent conflicts. The builtin USB stack for some processors only supports a certain number of USB endpoints and the virtual serial port needed for steno fills 3 of them. -```Makefile +```makefile STENO_ENABLE = yes MOUSEKEY_ENABLE = no ``` In your keymap create a new layer for Plover. You will need to include `keymap_steno.h`. See `planck/keymaps/steno/keymap.c` for an example. Remember to create a key to switch to the layer as well as a key for exiting the layer. If you would like to switch modes on the fly you can use the keycodes `QK_STENO_BOLT` and `QK_STENO_GEMINI`. If you only want to use one of the protocols you may set it up in your initialization function: -```C +```c void matrix_init_user() { steno_set_mode(STENO_MODE_GEMINI); // or STENO_MODE_BOLT } @@ -49,37 +49,37 @@ Once you have your keyboard flashed launch Plover. Click the 'Configure...' butt On the display tab click 'Open stroke display'. With Plover disabled you should be able to hit keys on your keyboard and see them show up in the stroke display window. Use this to make sure you have set up your keymap correctly. You are now ready to steno! -## Learning Stenography +## Learning Stenography :id=learning-stenography * [Learn Plover!](https://sites.google.com/site/learnplover/) * [QWERTY Steno](http://qwertysteno.com/Home/) * [Steno Jig](https://joshuagrams.github.io/steno-jig/) * More resources at the Plover [Learning Stenography](https://github.com/openstenoproject/plover/wiki/Learning-Stenography) wiki -## Interfacing with the code +## Interfacing with the code :id=interfacing-with-the-code The steno code has three interceptible hooks. If you define these functions, they will be called at certain points in processing; if they return true, processing continues, otherwise it's assumed you handled things. -```C +```c bool send_steno_chord_user(steno_mode_t mode, uint8_t chord[6]); ``` This function is called when a chord is about to be sent. Mode will be one of `STENO_MODE_BOLT` or `STENO_MODE_GEMINI`. This represents the actual chord that would be sent via whichever protocol. You can modify the chord provided to alter what gets sent. Remember to return true if you want the regular sending process to happen. -```C +```c bool process_steno_user(uint16_t keycode, keyrecord_t *record) { return true; } ``` This function is called when a keypress has come in, before it is processed. The keycode should be one of `QK_STENO_BOLT`, `QK_STENO_GEMINI`, or one of the `STN_*` key values. -```C +```c bool postprocess_steno_user(uint16_t keycode, keyrecord_t *record, steno_mode_t mode, uint8_t chord[6], int8_t pressed); ``` This function is called after a key has been processed, but before any decision about whether or not to send a chord. If `IS_PRESSED(record->event)` is false, and `pressed` is 0 or 1, the chord will be sent shortly, but has not yet been sent. This is where to put hooks for things like, say, live displays of steno chords or keys. -## Keycode Reference +## Keycode Reference :id=keycode-reference As defined in `keymap_steno.h`. diff --git a/docs/i2c_driver.md b/docs/i2c_driver.md index c9f53ef0d65..d28a20fa16a 100644 --- a/docs/i2c_driver.md +++ b/docs/i2c_driver.md @@ -1,8 +1,8 @@ -# I2C Master Driver +# I2C Master Driver :id=i2c-master-driver The I2C Master drivers used in QMK have a set of common functions to allow portability between MCUs. -## An important note on I2C Addresses +## An important note on I2C Addresses :id=note-on-i2c-addresses All of the addresses expected by this driver should be pushed to the upper 7 bits of the address byte. Setting the lower bit (indicating read/write) will be done by the respective functions. Almost all I2C addresses listed @@ -15,7 +15,7 @@ You can either do this on each call to the functions below, or once in your defi See https://www.robot-electronics.co.uk/i2c-tutorial for more information about I2C addressing and other technical details. -## Available functions +## Available functions :id=available-functions |Function |Description | |------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------| @@ -27,7 +27,7 @@ See https://www.robot-electronics.co.uk/i2c-tutorial for more information about |`i2c_status_t i2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout);` |Same as the `i2c_receive` function but `regaddr` sets from where in the slave the data will be read. | |`i2c_status_t i2c_stop(void);` |Ends an I2C transaction. | -### Function Return +### Function Return :id=function-return All the above functions, except `void i2c_init(void);` return the following truth table: @@ -38,9 +38,9 @@ All the above functions, except `void i2c_init(void);` return the following trut |`I2C_STATUS_TIMEOUT`|-2 |Operation timed out. | -## AVR +## AVR :id=avr -### Configuration +### Configuration :id=avr-configuration The following defines can be used to configure the I2C master driver. @@ -50,12 +50,12 @@ The following defines can be used to configure the I2C master driver. AVRs usually have set GPIO which turn into I2C pins, therefore no further configuration is required. -## ARM +## ARM :id=arm For ARM the Chibios I2C HAL driver is under the hood. This section assumes an STM32 MCU. -### Configuration +### Configuration :id=arm-configuration The configuration for ARM MCUs can be quite complex as often there are multiple I2C drivers which can be assigned to a variety of ports. @@ -90,7 +90,7 @@ The ChibiOS I2C driver configuration depends on STM32 MCU: STM32F1xx, STM32F2xx, STM32F4xx, STM32L0xx and STM32L1xx use I2Cv1; STM32F0xx, STM32F3xx, STM32F7xx and STM32L4xx use I2Cv2; -#### I2Cv1 +#### I2Cv1 :id=i2cv1 STM32 MCUs allow for different clock and duty parameters when configuring I2Cv1. These can be modified using the following parameters, using as a reference: | Variable | Default | @@ -99,7 +99,7 @@ STM32 MCUs allow for different clock and duty parameters when configuring I2Cv1. | `I2C1_CLOCK_SPEED` | `100000` | | `I2C1_DUTY_CYCLE` | `STD_DUTY_CYCLE` | -#### I2Cv2 +#### I2Cv2 :id=i2cv2 STM32 MCUs allow for different timing parameters when configuring I2Cv2. These can be modified using the following parameters, using as a reference: | Variable | Default | @@ -117,10 +117,10 @@ STM32 MCUs allow for different "alternate function" modes when configuring GPIO | `I2C1_SCL_PAL_MODE` | `4` | | `I2C1_SDA_PAL_MODE` | `4` | -#### Other +#### Other :id=other You can also overload the `void i2c_init(void)` function, which has a weak attribute. If you do this the configuration variables above will not be used. Please consult the datasheet of your MCU for the available GPIO configurations. The following is an example initialization function: -```C +```c void i2c_init(void) { setPinInput(B6); // Try releasing special pins for a short time diff --git a/docs/internals_gpio_control.md b/docs/internals_gpio_control.md index 8b8351382d1..74ac090355f 100644 --- a/docs/internals_gpio_control.md +++ b/docs/internals_gpio_control.md @@ -1,22 +1,22 @@ -# GPIO Control +# GPIO Control :id=gpio-control QMK has a GPIO control abstraction layer which is microcontroller agnostic. This is done to allow easy access to pin control across different platforms. -## Functions +## Functions :id=functions The following functions can provide basic control of GPIOs and are found in `quantum/quantum.h`. -|Function |Description | Old AVR Examples | Old ChibiOS/ARM Examples | -|----------------------|------------------------------------------------------------------|------------------------------------------------|-------------------------------------------------| -|`setPinInput(pin)` |Set pin as input with high impedance (High-Z) | `DDRB &= ~(1<<2)` | `palSetLineMode(pin, PAL_MODE_INPUT)` | -|`setPinInputHigh(pin)`|Set pin as input with builtin pull-up resistor | `DDRB &= ~(1<<2); PORTB \|= (1<<2)` | `palSetLineMode(pin, PAL_MODE_INPUT_PULLUP)` | -|`setPinInputLow(pin)` |Set pin as input with builtin pull-down resistor | N/A (Not supported on AVR) | `palSetLineMode(pin, PAL_MODE_INPUT_PULLDOWN)` | -|`setPinOutput(pin)` |Set pin as output | `DDRB \|= (1<<2)` | `palSetLineMode(pin, PAL_MODE_OUTPUT_PUSHPULL)` | -|`writePinHigh(pin)` |Set pin level as high, assuming it is an output | `PORTB \|= (1<<2)` | `palSetLine(pin)` | -|`writePinLow(pin)` |Set pin level as low, assuming it is an output | `PORTB &= ~(1<<2)` | `palClearLine(pin)` | -|`writePin(pin, level)`|Set pin level, assuming it is an output | `(level) ? PORTB \|= (1<<2) : PORTB &= ~(1<<2)` | `(level) ? palSetLine(pin) : palClearLine(pin)` | -|`readPin(pin)` |Returns the level of the pin | `_SFR_IO8(pin >> 4) & _BV(pin & 0xF)` | `palReadLine(pin)` | +|Function |Description | Old AVR Examples | Old ChibiOS/ARM Examples | +|------------------------|--------------------------------------------------|-------------------------------------------------|-------------------------------------------------| +| `setPinInput(pin)` | Set pin as input with high impedance (High-Z) | `DDRB &= ~(1<<2)` | `palSetLineMode(pin, PAL_MODE_INPUT)` | +| `setPinInputHigh(pin)` | Set pin as input with builtin pull-up resistor | `DDRB &= ~(1<<2); PORTB \|= (1<<2)` | `palSetLineMode(pin, PAL_MODE_INPUT_PULLUP)` | +| `setPinInputLow(pin)` | Set pin as input with builtin pull-down resistor | N/A (Not supported on AVR) | `palSetLineMode(pin, PAL_MODE_INPUT_PULLDOWN)` | +| `setPinOutput(pin)` | Set pin as output | `DDRB \|= (1<<2)` | `palSetLineMode(pin, PAL_MODE_OUTPUT_PUSHPULL)` | +| `writePinHigh(pin)` | Set pin level as high, assuming it is an output | `PORTB \|= (1<<2)` | `palSetLine(pin)` | +| `writePinLow(pin)` | Set pin level as low, assuming it is an output | `PORTB &= ~(1<<2)` | `palClearLine(pin)` | +| `writePin(pin, level)` | Set pin level, assuming it is an output | `(level) ? PORTB \|= (1<<2) : PORTB &= ~(1<<2)` | `(level) ? palSetLine(pin) : palClearLine(pin)` | +| `readPin(pin)` | Returns the level of the pin | `_SFR_IO8(pin >> 4) & _BV(pin & 0xF)` | `palReadLine(pin)` | -## Advanced Settings +## Advanced Settings :id=advanced-settings Each microcontroller can have multiple advanced settings regarding its GPIO. This abstraction layer does not limit the use of architecture-specific functions. Advanced users should consult the datasheet of their desired device and include any needed libraries. For AVR, the standard avr/io.h library is used; for STM32, the ChibiOS [PAL library](http://chibios.sourceforge.net/docs3/hal/group___p_a_l.html) is used. From cce2420bb24f31ebaee22b4d6e54311ef78668c2 Mon Sep 17 00:00:00 2001 From: Yann Hodique Date: Sun, 15 Mar 2020 21:42:10 -0700 Subject: [PATCH 10/18] [Keymap] fix sigma keymaps build (#8427) handle unicode input properly. --- keyboards/converter/sun_usb/type5/keymaps/sigma/rules.mk | 1 + users/sigma/sigma.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/keyboards/converter/sun_usb/type5/keymaps/sigma/rules.mk b/keyboards/converter/sun_usb/type5/keymaps/sigma/rules.mk index 09a3af829a6..f1de332c0c1 100644 --- a/keyboards/converter/sun_usb/type5/keymaps/sigma/rules.mk +++ b/keyboards/converter/sun_usb/type5/keymaps/sigma/rules.mk @@ -1 +1,2 @@ BOOTLOADER = halfkay +UNICODE_ENABLE = yes diff --git a/users/sigma/sigma.c b/users/sigma/sigma.c index b2bf40d5763..527925a63f6 100644 --- a/users/sigma/sigma.c +++ b/users/sigma/sigma.c @@ -64,6 +64,7 @@ void led_set_keymap(uint8_t usb_led) {} void set_os(uint8_t os) { runtime_userspace_config.os_target = os; +#if defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE) switch (os) { case _OS_MACOS: set_unicode_input_mode(UC_OSX); @@ -75,6 +76,7 @@ void set_os(uint8_t os) { set_unicode_input_mode(UC_WIN); break; } +#endif } void matrix_init_user(void) { From 2a31fbf9a6970ed425c2331f25fb7f92648ffcf1 Mon Sep 17 00:00:00 2001 From: coseyfannitutti <43188488+coseyfannitutti@users.noreply.github.com> Date: Mon, 16 Mar 2020 00:46:48 -0400 Subject: [PATCH 11/18] [Keyboard] Add the Romeo keyboard (#8434) * Add Keyboard - Romeo * Update rules.mk * Update readme.md * Update keyboards/coseyfannitutti/romeo/readme.md Co-Authored-By: Joel Challis * Update keyboards/coseyfannitutti/romeo/romeo.c Co-Authored-By: Joel Challis * Update keyboards/coseyfannitutti/romeo/keymaps/default/keymap.c Co-Authored-By: Ryan * Update keyboards/coseyfannitutti/romeo/keymaps/default/keymap.c Co-Authored-By: Ryan * Update keyboards/coseyfannitutti/romeo/readme.md Co-Authored-By: Ryan * Update keyboards/coseyfannitutti/romeo/rules.mk Co-Authored-By: Ryan * Update keyboards/coseyfannitutti/romeo/usbconfig.h Co-Authored-By: Ryan * Update keyboards/coseyfannitutti/romeo/usbconfig.h Co-Authored-By: Ryan * Update keyboards/coseyfannitutti/romeo/usbconfig.h Co-Authored-By: Ryan Co-authored-by: Joel Challis Co-authored-by: Ryan --- keyboards/coseyfannitutti/romeo/config.h | 250 ++++++++++++ keyboards/coseyfannitutti/romeo/info.json | 21 + .../romeo/keymaps/default/keymap.c | 31 ++ keyboards/coseyfannitutti/romeo/readme.md | 13 + keyboards/coseyfannitutti/romeo/romeo.c | 16 + keyboards/coseyfannitutti/romeo/romeo.h | 76 ++++ keyboards/coseyfannitutti/romeo/rules.mk | 37 ++ keyboards/coseyfannitutti/romeo/usbconfig.h | 386 ++++++++++++++++++ 8 files changed, 830 insertions(+) create mode 100644 keyboards/coseyfannitutti/romeo/config.h create mode 100644 keyboards/coseyfannitutti/romeo/info.json create mode 100644 keyboards/coseyfannitutti/romeo/keymaps/default/keymap.c create mode 100644 keyboards/coseyfannitutti/romeo/readme.md create mode 100644 keyboards/coseyfannitutti/romeo/romeo.c create mode 100644 keyboards/coseyfannitutti/romeo/romeo.h create mode 100644 keyboards/coseyfannitutti/romeo/rules.mk create mode 100644 keyboards/coseyfannitutti/romeo/usbconfig.h diff --git a/keyboards/coseyfannitutti/romeo/config.h b/keyboards/coseyfannitutti/romeo/config.h new file mode 100644 index 00000000000..aa54ce250d6 --- /dev/null +++ b/keyboards/coseyfannitutti/romeo/config.h @@ -0,0 +1,250 @@ +/* +Copyright 2019 coseyfannitutti + +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 . +*/ + +#pragma once + +#include "config_common.h" + +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x4069 +#define DEVICE_VER 0x0001 +#define MANUFACTURER coseyfannitutti +#define PRODUCT ROMEO +#define DESCRIPTION staggered layout 40% keyboard assembled with only through hole components + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 12 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * + */ + +/* A Custom matrix.c is used to poll the port expander C6 shows that the pins are hardwired there */ +/* 0 1 2 3 4 5 6 7 8 9 10 11*/ +#define MATRIX_ROW_PINS { B1, B4, B3, B2 } +#define MATRIX_COL_PINS { C5, C4, C3, D0, C2, D1, C1, C0, D4, B0, D7, D6 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +#define NO_UART 1 + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +// #define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +// #define RGB_DI_PIN E2 +// #ifdef RGB_DI_PIN +// #define RGBLED_NUM 16 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ +// #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +// /*== all animations enable ==*/ +// #define RGBLIGHT_ANIMATIONS +// /*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +// #endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +/* defined by default; to change, uncomment and set to the combination you want */ +// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP H +//#define MAGIC_KEY_HELP_ALT SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER0_ALT GRAVE +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER B +//#define MAGIC_KEY_BOOTLOADER_ALT ESC +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_EEPROM_CLEAR BSPACE +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration +#define BOOTMAGIC_LITE_ROW 0 +#define BOOTMAGIC_LITE_COLUMN 0 +*/ diff --git a/keyboards/coseyfannitutti/romeo/info.json b/keyboards/coseyfannitutti/romeo/info.json new file mode 100644 index 00000000000..9bc38742885 --- /dev/null +++ b/keyboards/coseyfannitutti/romeo/info.json @@ -0,0 +1,21 @@ +{ + "keyboard_name": "ROMEO", + "url": "https://github.com/coseyfannitutti/romeo", + "maintainer": "coseyfannitutti", + "width": 13, + "height": 4, + "layouts": { + "LAYOUT_all": { + "layout": [{"label":"1.5u", "x":0, "y":0, "w":1.5}, {"x":1.5, "y":0}, {"x":2.5, "y":0}, {"x":3.5, "y":0}, {"x":4.5, "y":0}, {"x":5.5, "y":0}, {"x":6.5, "y":0}, {"x":7.5, "y":0}, {"x":8.5, "y":0}, {"x":9.5, "y":0}, {"x":10.5, "y":0}, {"label":"1.5u", "x":11.5, "y":0, "w":1.5}, {"label":"1.75u", "x":0, "y":1, "w":1.75}, {"x":1.75, "y":1}, {"x":2.75, "y":1}, {"x":3.75, "y":1}, {"x":4.75, "y":1}, {"x":5.75, "y":1}, {"x":6.75, "y":1}, {"x":7.75, "y":1}, {"x":8.75, "y":1}, {"x":9.75, "y":1}, {"label":"2.25u", "x":10.75, "y":1, "w":2.25}, {"label":"1.25u", "x":0, "y":2, "w":1.25}, {"x":1.25, "y":2}, {"x":2.25, "y":2}, {"x":3.25, "y":2}, {"x":4.25, "y":2}, {"x":5.25, "y":2}, {"x":6.25, "y":2}, {"x":7.25, "y":2}, {"x":8.25, "y":2}, {"x":9.25, "y":2}, {"x":10.25, "y":2}, {"label":"1.75u", "x":11.25, "y":2, "w":1.75}, {"label":"1.25u", "x":0, "y":3, "w":1.25}, {"label":"1u", "x":1.25, "y":3}, {"label":"1.25u", "x":2.25, "y":3, "w":1.25}, {"label":"2.25u", "x":3.5, "y":3, "w":2.25}, {"label":"1u", "x":5.75, "y":3}, {"label":"2.75u", "x":6.75, "y":3, "w":2.75}, {"label":"1.25u", "x":9.5, "y":3, "w":1.25}, {"label":"1u", "x":10.75, "y":3}, {"label":"1.25u", "x":11.75, "y":3, "w":1.25}] + }, + "LAYOUT_ansi_split_lshift": { + "layout": [{"label":"1.5u", "x":0, "y":0, "w":1.5}, {"x":1.5, "y":0}, {"x":2.5, "y":0}, {"x":3.5, "y":0}, {"x":4.5, "y":0}, {"x":5.5, "y":0}, {"x":6.5, "y":0}, {"x":7.5, "y":0}, {"x":8.5, "y":0}, {"x":9.5, "y":0}, {"x":10.5, "y":0}, {"label":"1.5u", "x":11.5, "y":0, "w":1.5}, {"label":"1.75u", "x":0, "y":1, "w":1.75}, {"x":1.75, "y":1}, {"x":2.75, "y":1}, {"x":3.75, "y":1}, {"x":4.75, "y":1}, {"x":5.75, "y":1}, {"x":6.75, "y":1}, {"x":7.75, "y":1}, {"x":8.75, "y":1}, {"x":9.75, "y":1}, {"label":"2.25u", "x":10.75, "y":1, "w":2.25}, {"label":"1.25u", "x":0, "y":2, "w":1.25}, {"x":1.25, "y":2}, {"x":2.25, "y":2}, {"x":3.25, "y":2}, {"x":4.25, "y":2}, {"x":5.25, "y":2}, {"x":6.25, "y":2}, {"x":7.25, "y":2}, {"x":8.25, "y":2}, {"x":9.25, "y":2}, {"x":10.25, "y":2}, {"label":"1.75u", "x":11.25, "y":2, "w":1.75}, {"label":"1.25u", "x":0, "y":3, "w":1.25}, {"label":"1u", "x":1.25, "y":3}, {"label":"1u", "x":2.25, "y":3}, {"label":"6.25u", "x":3.25, "y":3, "w":6.25}, {"label":"1.25u", "x":9.5, "y":3, "w":1.25}, {"label":"1u", "x":10.75, "y":3}, {"label":"1.25u", "x":11.75, "y":3, "w":1.25}] + }, + "LAYOUT_ansi_split_space": { + "layout": [{"label":"1.5u", "x":0, "y":0, "w":1.5}, {"x":1.5, "y":0}, {"x":2.5, "y":0}, {"x":3.5, "y":0}, {"x":4.5, "y":0}, {"x":5.5, "y":0}, {"x":6.5, "y":0}, {"x":7.5, "y":0}, {"x":8.5, "y":0}, {"x":9.5, "y":0}, {"x":10.5, "y":0}, {"label":"1.5u", "x":11.5, "y":0, "w":1.5}, {"label":"1.75u", "x":0, "y":1, "w":1.75}, {"x":1.75, "y":1}, {"x":2.75, "y":1}, {"x":3.75, "y":1}, {"x":4.75, "y":1}, {"x":5.75, "y":1}, {"x":6.75, "y":1}, {"x":7.75, "y":1}, {"x":8.75, "y":1}, {"x":9.75, "y":1}, {"label":"2.25u", "x":10.75, "y":1, "w":2.25}, {"label":"2.25u", "x":0, "y":2, "w":2.25}, {"x":2.25, "y":2}, {"x":3.25, "y":2}, {"x":4.25, "y":2}, {"x":5.25, "y":2}, {"x":6.25, "y":2}, {"x":7.25, "y":2}, {"x":8.25, "y":2}, {"x":9.25, "y":2}, {"x":10.25, "y":2}, {"label":"1.75u", "x":11.25, "y":2, "w":1.75}, {"label":"1.25u", "x":0, "y":3, "w":1.25}, {"label":"1u", "x":1.25, "y":3}, {"label":"1.25u", "x":2.25, "y":3, "w":1.25}, {"label":"2.25u", "x":3.5, "y":3, "w":2.25}, {"label":"1u", "x":5.75, "y":3}, {"label":"2.75u", "x":6.75, "y":3, "w":2.75}, {"label":"1.25u", "x":9.5, "y":3, "w":1.25}, {"label":"1u", "x":10.75, "y":3}, {"label":"1.25u", "x":11.75, "y":3, "w":1.25}] + }, + "LAYOUT_ansi_40": { + "layout": [{"label":"1.5u", "x":0, "y":0, "w":1.5}, {"x":1.5, "y":0}, {"x":2.5, "y":0}, {"x":3.5, "y":0}, {"x":4.5, "y":0}, {"x":5.5, "y":0}, {"x":6.5, "y":0}, {"x":7.5, "y":0}, {"x":8.5, "y":0}, {"x":9.5, "y":0}, {"x":10.5, "y":0}, {"label":"1.5u", "x":11.5, "y":0, "w":1.5}, {"label":"1.75u", "x":0, "y":1, "w":1.75}, {"x":1.75, "y":1}, {"x":2.75, "y":1}, {"x":3.75, "y":1}, {"x":4.75, "y":1}, {"x":5.75, "y":1}, {"x":6.75, "y":1}, {"x":7.75, "y":1}, {"x":8.75, "y":1}, {"x":9.75, "y":1}, {"label":"2.25u", "x":10.75, "y":1, "w":2.25}, {"label":"2.25u", "x":0, "y":2, "w":2.25}, {"x":2.25, "y":2}, {"x":3.25, "y":2}, {"x":4.25, "y":2}, {"x":5.25, "y":2}, {"x":6.25, "y":2}, {"x":7.25, "y":2}, {"x":8.25, "y":2}, {"x":9.25, "y":2}, {"x":10.25, "y":2}, {"label":"1.75u", "x":11.25, "y":2, "w":1.75}, {"label":"1.25u", "x":0, "y":3, "w":1.25}, {"label":"1u", "x":1.25, "y":3}, {"label":"1u", "x":2.25, "y":3}, {"label":"6.25u", "x":3.25, "y":3, "w":6.25}, {"label":"1.25u", "x":9.5, "y":3, "w":1.25}, {"label":"1u", "x":10.75, "y":3}, {"label":"1.25u", "x":11.75, "y":3, "w":1.25}] + } + } +} \ No newline at end of file diff --git a/keyboards/coseyfannitutti/romeo/keymaps/default/keymap.c b/keyboards/coseyfannitutti/romeo/keymaps/default/keymap.c new file mode 100644 index 00000000000..074d67c1ef5 --- /dev/null +++ b/keyboards/coseyfannitutti/romeo/keymaps/default/keymap.c @@ -0,0 +1,31 @@ +/* Copyright 2019 COSEYFANNITUTTI + * + * 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 . + */ +#include QMK_KEYBOARD_H + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_all( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_QUOT, + KC_LSFT, KC_SLSH, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_RSFT, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, MO(1), KC_RCTL ), + + [1] = LAYOUT_all( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, RESET, + KC_VOLU, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_ENT, + KC_VOLD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MINS, KC_EQL, KC_SLSH, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ) +}; diff --git a/keyboards/coseyfannitutti/romeo/readme.md b/keyboards/coseyfannitutti/romeo/readme.md new file mode 100644 index 00000000000..5afb41b1822 --- /dev/null +++ b/keyboards/coseyfannitutti/romeo/readme.md @@ -0,0 +1,13 @@ +# ROMEO + +A staggered 40% that can be assembled with only through hole components, including usb type-c, and can also be completely covered with most GMK base kits + +* Keyboard Maintainer: [coseyfannitutti](https://github.com/coseyfannitutti) +* Hardware Supported: ROMEO, ATmega328P +* Hardware Availability: [cftkb.com](http://www.cftkb.com), [GitHub](https://github.com/coseyfannitutti/romeo) + +Make example for this keyboard (after setting up your build environment): + + make coseyfannitutti/romeo:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/coseyfannitutti/romeo/romeo.c b/keyboards/coseyfannitutti/romeo/romeo.c new file mode 100644 index 00000000000..696a764070f --- /dev/null +++ b/keyboards/coseyfannitutti/romeo/romeo.c @@ -0,0 +1,16 @@ +/* Copyright 2019 coseyfannitutti + * + * 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 . + */ +#include "romeo.h" diff --git a/keyboards/coseyfannitutti/romeo/romeo.h b/keyboards/coseyfannitutti/romeo/romeo.h new file mode 100644 index 00000000000..d834dbe6fb2 --- /dev/null +++ b/keyboards/coseyfannitutti/romeo/romeo.h @@ -0,0 +1,76 @@ +/* Copyright 2019 coseyfannitutti + * + * 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 . + */ +#pragma once + +#include "quantum.h" + +#define _x_ KC_NO + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT_all( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1B, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, \ + K30, K31, K32, K34, K36, K37, K39, K3A, K3B \ +) { \ +{ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, }, \ +{ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, _x_, K1B, }, \ +{ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, }, \ +{ K30, K31, K32, _x_, K34, _x_, K36, K37, _x_, K39, K3A, K3B, } \ +} + +#define LAYOUT_ansi_40( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1B, \ + K20, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, \ + K30, K31, K32, K36, K39, K3A, K3B \ +) { \ +{ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, }, \ +{ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, _x_, K1B, }, \ +{ K20, _x_, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, }, \ +{ K30, K31, K32, _x_, _x_, _x_, K36, _x_, _x_, K39, K3A, K3B, } \ +} + +#define LAYOUT_ansi_split_lshift( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1B, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, \ + K30, K31, K32, K36, K39, K3A, K3B \ +) { \ +{ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, }, \ +{ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, _x_, K1B, }, \ +{ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, }, \ +{ K30, K31, K32, _x_, _x_, _x_, K36, _x_, _x_, K39, K3A, K3B, } \ +} + +#define LAYOUT_ansi_split_space( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1B, \ + K20, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, \ + K30, K31, K32, K36, K39, K3A, K3B \ +) { \ +{ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, }, \ +{ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, _x_, K1B, }, \ +{ K20, _x_, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, }, \ +{ K30, K31, K32, _x_, K34, _x_, K36, K37, _x_, K39, K3A, K3B, } \ +} diff --git a/keyboards/coseyfannitutti/romeo/rules.mk b/keyboards/coseyfannitutti/romeo/rules.mk new file mode 100644 index 00000000000..cfd0ff64607 --- /dev/null +++ b/keyboards/coseyfannitutti/romeo/rules.mk @@ -0,0 +1,37 @@ +# MCU name +MCU = atmega328p + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# ATmega32A bootloadHID +# ATmega328P USBasp +BOOTLOADER = USBasp + +# disable debug code +OPT_DEFS = -DDEBUG_LEVEL=0 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs diff --git a/keyboards/coseyfannitutti/romeo/usbconfig.h b/keyboards/coseyfannitutti/romeo/usbconfig.h new file mode 100644 index 00000000000..36926d9a7e6 --- /dev/null +++ b/keyboards/coseyfannitutti/romeo/usbconfig.h @@ -0,0 +1,386 @@ +/* Name: usbconfig.h + * Project: V-USB, virtual USB port for Atmel's(r) AVR(r) microcontrollers + * Author: Christian Starkjohann + * Creation Date: 2005-04-01 + * Tabsize: 4 + * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH + * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) + * This Revision: $Id: usbconfig-prototype.h 785 2010-05-30 17:57:07Z cs $ + */ + +#ifndef __usbconfig_h_included__ +#define __usbconfig_h_included__ + +#include "config.h" + +/* +General Description: +This file is an example configuration (with inline documentation) for the USB +driver. It configures V-USB for USB D+ connected to Port D bit 2 (which is +also hardware interrupt 0 on many devices) and USB D- to Port D bit 4. You may +wire the lines to any other port, as long as D+ is also wired to INT0 (or any +other hardware interrupt, as long as it is the highest level interrupt, see +section at the end of this file). +*/ + +/* ---------------------------- Hardware Config ---------------------------- */ + +#define USB_CFG_IOPORTNAME D +/* This is the port where the USB bus is connected. When you configure it to + * "B", the registers PORTB, PINB and DDRB will be used. + */ +#define USB_CFG_DMINUS_BIT 3 +/* This is the bit number in USB_CFG_IOPORT where the USB D- line is connected. + * This may be any bit in the port. + */ +#define USB_CFG_DPLUS_BIT 2 +/* This is the bit number in USB_CFG_IOPORT where the USB D+ line is connected. + * This may be any bit in the port. Please note that D+ must also be connected + * to interrupt pin INT0! [You can also use other interrupts, see section + * "Optional MCU Description" below, or you can connect D- to the interrupt, as + * it is required if you use the USB_COUNT_SOF feature. If you use D- for the + * interrupt, the USB interrupt will also be triggered at Start-Of-Frame + * markers every millisecond.] + */ +#define USB_CFG_CLOCK_KHZ (F_CPU/1000) +/* Clock rate of the AVR in kHz. Legal values are 12000, 12800, 15000, 16000, + * 16500, 18000 and 20000. The 12.8 MHz and 16.5 MHz versions of the code + * require no crystal, they tolerate +/- 1% deviation from the nominal + * frequency. All other rates require a precision of 2000 ppm and thus a + * crystal! + * Since F_CPU should be defined to your actual clock rate anyway, you should + * not need to modify this setting. + */ +#define USB_CFG_CHECK_CRC 0 +/* Define this to 1 if you want that the driver checks integrity of incoming + * data packets (CRC checks). CRC checks cost quite a bit of code size and are + * currently only available for 18 MHz crystal clock. You must choose + * USB_CFG_CLOCK_KHZ = 18000 if you enable this option. + */ + +/* ----------------------- Optional Hardware Config ------------------------ */ + +/* #define USB_CFG_PULLUP_IOPORTNAME D */ +/* If you connect the 1.5k pullup resistor from D- to a port pin instead of + * V+, you can connect and disconnect the device from firmware by calling + * the macros usbDeviceConnect() and usbDeviceDisconnect() (see usbdrv.h). + * This constant defines the port on which the pullup resistor is connected. + */ +/* #define USB_CFG_PULLUP_BIT 4 */ +/* This constant defines the bit number in USB_CFG_PULLUP_IOPORT (defined + * above) where the 1.5k pullup resistor is connected. See description + * above for details. + */ + +/* --------------------------- Functional Range ---------------------------- */ + +#define USB_CFG_HAVE_INTRIN_ENDPOINT 1 +/* Define this to 1 if you want to compile a version with two endpoints: The + * default control endpoint 0 and an interrupt-in endpoint (any other endpoint + * number). + */ +#define USB_CFG_HAVE_INTRIN_ENDPOINT3 1 +/* Define this to 1 if you want to compile a version with three endpoints: The + * default control endpoint 0, an interrupt-in endpoint 3 (or the number + * configured below) and a catch-all default interrupt-in endpoint as above. + * You must also define USB_CFG_HAVE_INTRIN_ENDPOINT to 1 for this feature. + */ +#define USB_CFG_EP3_NUMBER 3 +/* If the so-called endpoint 3 is used, it can now be configured to any other + * endpoint number (except 0) with this macro. Default if undefined is 3. + */ +/* #define USB_INITIAL_DATATOKEN USBPID_DATA1 */ +/* The above macro defines the startup condition for data toggling on the + * interrupt/bulk endpoints 1 and 3. Defaults to USBPID_DATA1. + * Since the token is toggled BEFORE sending any data, the first packet is + * sent with the oposite value of this configuration! + */ +#define USB_CFG_IMPLEMENT_HALT 0 +/* Define this to 1 if you also want to implement the ENDPOINT_HALT feature + * for endpoint 1 (interrupt endpoint). Although you may not need this feature, + * it is required by the standard. We have made it a config option because it + * bloats the code considerably. + */ +#define USB_CFG_SUPPRESS_INTR_CODE 0 +/* Define this to 1 if you want to declare interrupt-in endpoints, but don't + * want to send any data over them. If this macro is defined to 1, functions + * usbSetInterrupt() and usbSetInterrupt3() are omitted. This is useful if + * you need the interrupt-in endpoints in order to comply to an interface + * (e.g. HID), but never want to send any data. This option saves a couple + * of bytes in flash memory and the transmit buffers in RAM. + */ +#define USB_CFG_IS_SELF_POWERED 0 +/* Define this to 1 if the device has its own power supply. Set it to 0 if the + * device is powered from the USB bus. + */ +#define USB_CFG_IMPLEMENT_FN_WRITE 1 +/* Set this to 1 if you want usbFunctionWrite() to be called for control-out + * transfers. Set it to 0 if you don't need it and want to save a couple of + * bytes. + */ +#define USB_CFG_IMPLEMENT_FN_READ 0 +/* Set this to 1 if you need to send control replies which are generated + * "on the fly" when usbFunctionRead() is called. If you only want to send + * data from a static buffer, set it to 0 and return the data from + * usbFunctionSetup(). This saves a couple of bytes. + */ +#define USB_CFG_IMPLEMENT_FN_WRITEOUT 0 +/* Define this to 1 if you want to use interrupt-out (or bulk out) endpoints. + * You must implement the function usbFunctionWriteOut() which receives all + * interrupt/bulk data sent to any endpoint other than 0. The endpoint number + * can be found in 'usbRxToken'. + */ +#define USB_CFG_HAVE_FLOWCONTROL 0 +/* Define this to 1 if you want flowcontrol over USB data. See the definition + * of the macros usbDisableAllRequests() and usbEnableAllRequests() in + * usbdrv.h. + */ +#define USB_CFG_DRIVER_FLASH_PAGE 0 +/* If the device has more than 64 kBytes of flash, define this to the 64 k page + * where the driver's constants (descriptors) are located. Or in other words: + * Define this to 1 for boot loaders on the ATMega128. + */ +#define USB_CFG_LONG_TRANSFERS 0 +/* Define this to 1 if you want to send/receive blocks of more than 254 bytes + * in a single control-in or control-out transfer. Note that the capability + * for long transfers increases the driver size. + */ +/* #define USB_RX_USER_HOOK(data, len) if(usbRxToken == (uchar)USBPID_SETUP) blinkLED(); */ +/* This macro is a hook if you want to do unconventional things. If it is + * defined, it's inserted at the beginning of received message processing. + * If you eat the received message and don't want default processing to + * proceed, do a return after doing your things. One possible application + * (besides debugging) is to flash a status LED on each packet. + */ +/* #define USB_RESET_HOOK(resetStarts) if(!resetStarts){hadUsbReset();} */ +/* This macro is a hook if you need to know when an USB RESET occurs. It has + * one parameter which distinguishes between the start of RESET state and its + * end. + */ +/* #define USB_SET_ADDRESS_HOOK() hadAddressAssigned(); */ +/* This macro (if defined) is executed when a USB SET_ADDRESS request was + * received. + */ +#define USB_COUNT_SOF 0 +/* define this macro to 1 if you need the global variable "usbSofCount" which + * counts SOF packets. This feature requires that the hardware interrupt is + * connected to D- instead of D+. + */ +/* #ifdef __ASSEMBLER__ + * macro myAssemblerMacro + * in YL, TCNT0 + * sts timer0Snapshot, YL + * endm + * #endif + * #define USB_SOF_HOOK myAssemblerMacro + * This macro (if defined) is executed in the assembler module when a + * Start Of Frame condition is detected. It is recommended to define it to + * the name of an assembler macro which is defined here as well so that more + * than one assembler instruction can be used. The macro may use the register + * YL and modify SREG. If it lasts longer than a couple of cycles, USB messages + * immediately after an SOF pulse may be lost and must be retried by the host. + * What can you do with this hook? Since the SOF signal occurs exactly every + * 1 ms (unless the host is in sleep mode), you can use it to tune OSCCAL in + * designs running on the internal RC oscillator. + * Please note that Start Of Frame detection works only if D- is wired to the + * interrupt, not D+. THIS IS DIFFERENT THAN MOST EXAMPLES! + */ +#define USB_CFG_CHECK_DATA_TOGGLING 0 +/* define this macro to 1 if you want to filter out duplicate data packets + * sent by the host. Duplicates occur only as a consequence of communication + * errors, when the host does not receive an ACK. Please note that you need to + * implement the filtering yourself in usbFunctionWriteOut() and + * usbFunctionWrite(). Use the global usbCurrentDataToken and a static variable + * for each control- and out-endpoint to check for duplicate packets. + */ +#define USB_CFG_HAVE_MEASURE_FRAME_LENGTH 0 +/* define this macro to 1 if you want the function usbMeasureFrameLength() + * compiled in. This function can be used to calibrate the AVR's RC oscillator. + */ +#define USB_USE_FAST_CRC 0 +/* The assembler module has two implementations for the CRC algorithm. One is + * faster, the other is smaller. This CRC routine is only used for transmitted + * messages where timing is not critical. The faster routine needs 31 cycles + * per byte while the smaller one needs 61 to 69 cycles. The faster routine + * may be worth the 32 bytes bigger code size if you transmit lots of data and + * run the AVR close to its limit. + */ + +/* -------------------------- Device Description --------------------------- */ + +#define USB_CFG_VENDOR_ID (VENDOR_ID & 0xFF), ((VENDOR_ID >> 8) & 0xFF) +/* USB vendor ID for the device, low byte first. If you have registered your + * own Vendor ID, define it here. Otherwise you may use one of obdev's free + * shared VID/PID pairs. Be sure to read USB-IDs-for-free.txt for rules! + * *** IMPORTANT NOTE *** + * This template uses obdev's shared VID/PID pair for Vendor Class devices + * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand + * the implications! + */ +#define USB_CFG_DEVICE_ID (PRODUCT_ID & 0xFF), ((PRODUCT_ID >> 8) & 0xFF) +/* This is the ID of the product, low byte first. It is interpreted in the + * scope of the vendor ID. If you have registered your own VID with usb.org + * or if you have licensed a PID from somebody else, define it here. Otherwise + * you may use one of obdev's free shared VID/PID pairs. See the file + * USB-IDs-for-free.txt for details! + * *** IMPORTANT NOTE *** + * This template uses obdev's shared VID/PID pair for Vendor Class devices + * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand + * the implications! + */ +#define USB_CFG_DEVICE_VERSION (DEVICE_VER & 0xFF), ((DEVICE_VER >> 8) & 0xFF) +/* Version number of the device: Minor number first, then major number. + */ +#define USB_CFG_VENDOR_NAME 'c','o','s','e','y','f','a','n','n','i','t','u','t','t','i' +#define USB_CFG_VENDOR_NAME_LEN 15 +/* These two values define the vendor name returned by the USB device. The name + * must be given as a list of characters under single quotes. The characters + * are interpreted as Unicode (UTF-16) entities. + * If you don't want a vendor name string, undefine these macros. + * ALWAYS define a vendor name containing your Internet domain name if you use + * obdev's free shared VID/PID pair. See the file USB-IDs-for-free.txt for + * details. + */ +#define USB_CFG_DEVICE_NAME 'R','O','M','E','O' +#define USB_CFG_DEVICE_NAME_LEN 5 +/* Same as above for the device name. If you don't want a device name, undefine + * the macros. See the file USB-IDs-for-free.txt before you assign a name if + * you use a shared VID/PID. + */ +#define USB_CFG_SERIAL_NUMBER '0' +#define USB_CFG_SERIAL_NUMBER_LEN 1 +/* Same as above for the serial number. If you don't want a serial number, + * undefine the macros. + * It may be useful to provide the serial number through other means than at + * compile time. See the section about descriptor properties below for how + * to fine tune control over USB descriptors such as the string descriptor + * for the serial number. + */ +#define USB_CFG_DEVICE_CLASS 0 +#define USB_CFG_DEVICE_SUBCLASS 0 +/* See USB specification if you want to conform to an existing device class. + * Class 0xff is "vendor specific". + */ +#define USB_CFG_INTERFACE_CLASS 3 /* HID */ +#define USB_CFG_INTERFACE_SUBCLASS 1 /* Boot */ +#define USB_CFG_INTERFACE_PROTOCOL 1 /* Keyboard */ +/* See USB specification if you want to conform to an existing device class or + * protocol. The following classes must be set at interface level: + * HID class is 3, no subclass and protocol required (but may be useful!) + * CDC class is 2, use subclass 2 and protocol 1 for ACM + */ +#define USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH 0 +/* Define this to the length of the HID report descriptor, if you implement + * an HID device. Otherwise don't define it or define it to 0. + * If you use this define, you must add a PROGMEM character array named + * "usbHidReportDescriptor" to your code which contains the report descriptor. + * Don't forget to keep the array and this define in sync! + */ + +/* #define USB_PUBLIC static */ +/* Use the define above if you #include usbdrv.c instead of linking against it. + * This technique saves a couple of bytes in flash memory. + */ + +/* ------------------- Fine Control over USB Descriptors ------------------- */ +/* If you don't want to use the driver's default USB descriptors, you can + * provide our own. These can be provided as (1) fixed length static data in + * flash memory, (2) fixed length static data in RAM or (3) dynamically at + * runtime in the function usbFunctionDescriptor(). See usbdrv.h for more + * information about this function. + * Descriptor handling is configured through the descriptor's properties. If + * no properties are defined or if they are 0, the default descriptor is used. + * Possible properties are: + * + USB_PROP_IS_DYNAMIC: The data for the descriptor should be fetched + * at runtime via usbFunctionDescriptor(). If the usbMsgPtr mechanism is + * used, the data is in FLASH by default. Add property USB_PROP_IS_RAM if + * you want RAM pointers. + * + USB_PROP_IS_RAM: The data returned by usbFunctionDescriptor() or found + * in static memory is in RAM, not in flash memory. + * + USB_PROP_LENGTH(len): If the data is in static memory (RAM or flash), + * the driver must know the descriptor's length. The descriptor itself is + * found at the address of a well known identifier (see below). + * List of static descriptor names (must be declared PROGMEM if in flash): + * char usbDescriptorDevice[]; + * char usbDescriptorConfiguration[]; + * char usbDescriptorHidReport[]; + * char usbDescriptorString0[]; + * int usbDescriptorStringVendor[]; + * int usbDescriptorStringDevice[]; + * int usbDescriptorStringSerialNumber[]; + * Other descriptors can't be provided statically, they must be provided + * dynamically at runtime. + * + * Descriptor properties are or-ed or added together, e.g.: + * #define USB_CFG_DESCR_PROPS_DEVICE (USB_PROP_IS_RAM | USB_PROP_LENGTH(18)) + * + * The following descriptors are defined: + * USB_CFG_DESCR_PROPS_DEVICE + * USB_CFG_DESCR_PROPS_CONFIGURATION + * USB_CFG_DESCR_PROPS_STRINGS + * USB_CFG_DESCR_PROPS_STRING_0 + * USB_CFG_DESCR_PROPS_STRING_VENDOR + * USB_CFG_DESCR_PROPS_STRING_PRODUCT + * USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER + * USB_CFG_DESCR_PROPS_HID + * USB_CFG_DESCR_PROPS_HID_REPORT + * USB_CFG_DESCR_PROPS_UNKNOWN (for all descriptors not handled by the driver) + * + * Note about string descriptors: String descriptors are not just strings, they + * are Unicode strings prefixed with a 2 byte header. Example: + * int serialNumberDescriptor[] = { + * USB_STRING_DESCRIPTOR_HEADER(6), + * 'S', 'e', 'r', 'i', 'a', 'l' + * }; + */ + +#define USB_CFG_DESCR_PROPS_DEVICE 0 +#define USB_CFG_DESCR_PROPS_CONFIGURATION USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_CONFIGURATION 0 +#define USB_CFG_DESCR_PROPS_STRINGS 0 +#define USB_CFG_DESCR_PROPS_STRING_0 0 +#define USB_CFG_DESCR_PROPS_STRING_VENDOR 0 +#define USB_CFG_DESCR_PROPS_STRING_PRODUCT 0 +#define USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER 0 +#define USB_CFG_DESCR_PROPS_HID USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_HID 0 +#define USB_CFG_DESCR_PROPS_HID_REPORT USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_HID_REPORT 0 +#define USB_CFG_DESCR_PROPS_UNKNOWN 0 + +#define usbMsgPtr_t unsigned short +/* If usbMsgPtr_t is not defined, it defaults to 'uchar *'. We define it to + * a scalar type here because gcc generates slightly shorter code for scalar + * arithmetics than for pointer arithmetics. Remove this define for backward + * type compatibility or define it to an 8 bit type if you use data in RAM only + * and all RAM is below 256 bytes (tiny memory model in IAR CC). + */ + +/* ----------------------- Optional MCU Description ------------------------ */ + +/* The following configurations have working defaults in usbdrv.h. You + * usually don't need to set them explicitly. Only if you want to run + * the driver on a device which is not yet supported or with a compiler + * which is not fully supported (such as IAR C) or if you use a differnt + * interrupt than INT0, you may have to define some of these. + */ +/* #define USB_INTR_CFG MCUCR */ +/* #define USB_INTR_CFG_SET ((1 << ISC00) | (1 << ISC01)) */ +/* #define USB_INTR_CFG_CLR 0 */ +/* #define USB_INTR_ENABLE GIMSK */ +/* #define USB_INTR_ENABLE_BIT INT0 */ +/* #define USB_INTR_PENDING GIFR */ +/* #define USB_INTR_PENDING_BIT INTF0 */ +/* #define USB_INTR_VECTOR INT0_vect */ + +/* Set INT1 for D- falling edge to count SOF */ +/* #define USB_INTR_CFG EICRA */ +// #define USB_INTR_CFG_SET ((1 << ISC11) | (0 << ISC10)) +// /* #define USB_INTR_CFG_CLR 0 */ +// /* #define USB_INTR_ENABLE EIMSK */ +// #define USB_INTR_ENABLE_BIT INT1 +// /* #define USB_INTR_PENDING EIFR */ +// #define USB_INTR_PENDING_BIT INTF1 +// #define USB_INTR_VECTOR INT1_vect + +#endif /* __usbconfig_h_included__ */ From 9dfebb9d67a211db3ded762b60ee868299dd406e Mon Sep 17 00:00:00 2001 From: Takeshi ISHII <2170248+mtei@users.noreply.github.com> Date: Mon, 16 Mar 2020 18:26:32 +0900 Subject: [PATCH 12/18] Remove unnecessary import of rgblight.h in tmk_core/protocol/*/*.c (#8432) * Remove unnecessary import of rgblight.h in tmk_core/protocol/*/*.c * tmk_core/protocol/chibios/main.c * tmk_core/protocol/lufa/lufa.c see #8380 for tmk_core/protocol/vusb/main.c. * Remove '#include "rgblight.h"' from tmk_core/protocol/vusb/main.c. --- tmk_core/protocol/chibios/main.c | 3 --- tmk_core/protocol/lufa/lufa.c | 4 ---- tmk_core/protocol/vusb/main.c | 3 --- 3 files changed, 10 deletions(-) diff --git a/tmk_core/protocol/chibios/main.c b/tmk_core/protocol/chibios/main.c index 218a79f8ba1..6479fd09df2 100644 --- a/tmk_core/protocol/chibios/main.c +++ b/tmk_core/protocol/chibios/main.c @@ -33,9 +33,6 @@ #include "debug.h" #include "printf.h" -#if defined(RGBLIGHT_ENABLE) -# include "rgblight.h" -#endif #ifdef SLEEP_LED_ENABLE # include "sleep_led.h" #endif diff --git a/tmk_core/protocol/lufa/lufa.c b/tmk_core/protocol/lufa/lufa.c index ca75a91d0e7..d673841fd55 100644 --- a/tmk_core/protocol/lufa/lufa.c +++ b/tmk_core/protocol/lufa/lufa.c @@ -77,10 +77,6 @@ extern keymap_config_t keymap_config; # include "virtser.h" #endif -#if defined(RGBLIGHT_ENABLE) -# include "rgblight.h" -#endif - #ifdef MIDI_ENABLE # include "qmk_midi.h" #endif diff --git a/tmk_core/protocol/vusb/main.c b/tmk_core/protocol/vusb/main.c index 6b3f09bc3e1..469b2ecc5ff 100644 --- a/tmk_core/protocol/vusb/main.c +++ b/tmk_core/protocol/vusb/main.c @@ -21,9 +21,6 @@ #include "uart.h" #include "debug.h" -#if defined(RGBLIGHT_ENABLE) -# include "rgblight.h" -#endif #define UART_BAUD_RATE 115200 From c89012566c9f542b1bff8f3ffd9dded5175cc41f Mon Sep 17 00:00:00 2001 From: QMK Bot Date: Mon, 16 Mar 2020 10:01:22 +0000 Subject: [PATCH 13/18] format code according to conventions [skip ci] --- tmk_core/protocol/vusb/main.c | 1 - 1 file changed, 1 deletion(-) diff --git a/tmk_core/protocol/vusb/main.c b/tmk_core/protocol/vusb/main.c index 469b2ecc5ff..068c4d8f3d6 100644 --- a/tmk_core/protocol/vusb/main.c +++ b/tmk_core/protocol/vusb/main.c @@ -21,7 +21,6 @@ #include "uart.h" #include "debug.h" - #define UART_BAUD_RATE 115200 /* This is from main.c of USBaspLoader */ From 19dbcf38149a2ba9a51935aae36c276a6dbd4b01 Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Mon, 16 Mar 2020 14:27:19 +0000 Subject: [PATCH 14/18] Document 'make all:' (#8439) * Document 'make all:' * add cli docs * Apply suggestions from code review Co-Authored-By: skullydazed Co-authored-by: skullydazed --- docs/cli_commands.md | 6 ++++++ docs/feature_userspace.md | 20 ++++++++++++++++---- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/docs/cli_commands.md b/docs/cli_commands.md index bffa8263e71..eb5362bd295 100644 --- a/docs/cli_commands.md +++ b/docs/cli_commands.md @@ -57,6 +57,12 @@ Must be in keyboard directory with a default keymap, or in keymap directory for qmk compile ``` +**Usage for building all keyboards that support a specific keymap**: + +``` +qmk compile -kb all -km +``` + **Example**: ``` $ qmk config compile.keymap=default diff --git a/docs/feature_userspace.md b/docs/feature_userspace.md index a2657c1f606..ac0a1360d92 100644 --- a/docs/feature_userspace.md +++ b/docs/feature_userspace.md @@ -97,13 +97,25 @@ You'd want to replace the year, name, email and github username with your info. Additionally, this is a good place to document your code, if you wish to share it with others. -# Examples +## Build All Keyboards That Support a Specific Keymap + +Want to check all your keymaps build in a single command? You can run: + + make all: + +For example, + + make all:jack + +This is ideal for when you want ensure everything compiles successfully when preparing a [_Pull request_](https://github.com/qmk/qmk_firmware/pulls). + +## Examples For a brief example, checkout [`/users/_example/`](https://github.com/qmk/qmk_firmware/tree/master/users/drashna). For a more complicated example, checkout [`/users/drashna/`](https://github.com/qmk/qmk_firmware/tree/master/users/drashna)'s userspace. -## Customized Functions +### Customized Functions QMK has a bunch of [functions](custom_quantum_functions.md) that have [`_quantum`, `_kb`, and `_user` versions](custom_quantum_functions.md#a-word-on-core-vs-keyboards-vs-keymap) that you can use. You will pretty much always want to use the user version of these functions. But the problem is that if you use them in your userspace, then you don't have a version that you can use in your keymap. @@ -130,7 +142,7 @@ The `_keymap` part here doesn't matter, it just needs to be something other than You can see a list of this and other common functions in [`template.c`](https://github.com/qmk/qmk_firmware/blob/master/users/drashna/template.c) in [`users/drashna`](https://github.com/qmk/qmk_firmware/tree/master/users/drashna). -## Custom Features +### Custom Features Since the Userspace feature can support a staggering number of boards, you may have boards that you want to enable certain functionality for, but not for others. And you can actually create "features" that you can enable or disable in your own userspace. @@ -166,7 +178,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { ``` -## Consolidated Macros +### Consolidated Macros If you wanted to consolidate macros and other functions into your userspace for all of your keymaps, you can do that. This builds upon the [Customized Functions](#customized-functions) example above. This lets you maintain a bunch of macros that are shared between the different keyboards, and allow for keyboard specific macros, too. From 910c466cfefebdd491c200cdd07cbf1a12ebd51d Mon Sep 17 00:00:00 2001 From: Ryan Date: Tue, 17 Mar 2020 01:30:17 +1100 Subject: [PATCH 15/18] Update Brazilian keymap and add sendstring LUT (#8435) --- quantum/keymap_extras/keymap_br_abnt2.h | 206 +++++++++++++++----- quantum/keymap_extras/sendstring_br_abnt2.h | 80 ++++++++ 2 files changed, 236 insertions(+), 50 deletions(-) create mode 100644 quantum/keymap_extras/sendstring_br_abnt2.h diff --git a/quantum/keymap_extras/keymap_br_abnt2.h b/quantum/keymap_extras/keymap_br_abnt2.h index eecd6f2b0b2..9d83fdf4e36 100644 --- a/quantum/keymap_extras/keymap_br_abnt2.h +++ b/quantum/keymap_extras/keymap_br_abnt2.h @@ -14,61 +14,167 @@ * along with this program. If not, see . */ -#ifndef KEYMAP_BR_ABNT2_H -#define KEYMAP_BR_ABNT2_H +#pragma once #include "keymap.h" -/* Scan codes for the Brazilian ABNT2 keyboard layout */ +// clang-format off -#define BR_CCDL KC_SCLN // Ç same scancode as ;: on US layout -#define BR_SCLN KC_SLSH // ;: same scancode as /? on US layout -#define BR_QUOT KC_GRV // '" same scancode as `~ on US layout -#define BR_TILD KC_QUOT // ~^ dead keys, same scancode as '" on US layout -#define BR_ACUT KC_LBRC // ´` dead keys, same scancode as [{ on US layout -#define BR_LBRC KC_RBRC // [{ same scancode as ]} on US layout -#define BR_RBRC KC_BSLS // ]} same scancode as \| on US layout -#define BR_BSLS KC_NUBS // \| uses the non-US hash scancode (#~, sometimes §±) -#define BR_SLSH KC_INT1 // /? uses the INTL1 scancode +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ' │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │       │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │     │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ ´ │ [ │     │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐    │ + * │      │ A │ S │ D │ F │ G │ H │ J │ K │ L │ Ç │ ~ │ ] │    │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┤ + * │    │ \ │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ ; │ / │      │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬──┴─┬────┤ + * │    │    │    │                        │    │    │    │    │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ +// Row 1 +#define BR_QUOT KC_GRV // ' +#define BR_1 KC_1 // 1 +#define BR_2 KC_2 // 2 +#define BR_3 KC_3 // 3 +#define BR_4 KC_4 // 4 +#define BR_5 KC_5 // 5 +#define BR_6 KC_6 // 6 +#define BR_7 KC_7 // 7 +#define BR_8 KC_8 // 8 +#define BR_9 KC_9 // 9 +#define BR_0 KC_0 // 0 +#define BR_MINS KC_MINS // - +#define BR_EQL KC_EQL // = +// Row 2 +#define BR_Q KC_Q // Q +#define BR_W KC_W // W +#define BR_E KC_E // E +#define BR_R KC_R // R +#define BR_T KC_T // T +#define BR_Y KC_Y // Y +#define BR_U KC_U // U +#define BR_I KC_I // I +#define BR_O KC_O // O +#define BR_P KC_P // P +#define BR_ACUT KC_LBRC // ´ (dead) +#define BR_LBRC KC_RBRC // [ +// Row 3 +#define BR_A KC_A // A +#define BR_S KC_S // S +#define BR_D KC_D // D +#define BR_F KC_F // F +#define BR_G KC_G // G +#define BR_H KC_H // H +#define BR_J KC_J // J +#define BR_K KC_K // K +#define BR_L KC_L // L +#define BR_CCED KC_SCLN // Ç +#define BR_TILD KC_QUOT // ~ (dead) +#define BR_RBRC KC_BSLS // ] +// Row 4 +#define BR_BSLS KC_NUBS // (backslash) +#define BR_Z KC_Z // Z +#define BR_X KC_X // X +#define BR_C KC_C // C +#define BR_V KC_V // V +#define BR_B KC_B // B +#define BR_N KC_N // N +#define BR_M KC_M // M +#define BR_COMM KC_COMM // , +#define BR_DOT KC_DOT // . +#define BR_SCLN KC_SLSH // ; +#define BR_SLSH KC_INT1 // / +// Numpad +#define BR_PDOT KC_PCMM // . +#define BR_PCMM KC_PDOT // , -#define BR_COLN LSFT(BR_SCLN) // shifted : -#define BR_DQT LSFT(BR_QUOT) // shifted " -#define BR_CIRC LSFT(BR_TILD) // shifted ^ (dead key) -#define BR_GRAV LSFT(BR_ACUT) // shifted ` (dead key) -#define BR_LCBR LSFT(BR_LBRC) // shifted { -#define BR_RCBR LSFT(BR_RBRC) // shifted } -#define BR_PIPE LSFT(BR_BSLS) // shifted | -#define BR_QUES LSFT(BR_SLSH) // shifted ? -#define BR_TRMA LSFT(KC_6) // shifted ¨ (dead key - trema accent) +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ " │ ! │ @ │ # │ $ │ % │ ¨ │ & │ * │ ( │ ) │ _ │ + │       │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │     │   │   │   │   │   │   │   │   │   │   │ ` │ { │     │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐    │ + * │      │   │   │   │   │   │   │   │   │   │   │ ^ │ } │    │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┤ + * │    │ | │   │   │   │   │   │   │   │ < │ > │ : │ ? │      │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬──┴─┬────┤ + * │    │    │    │                        │    │    │    │    │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ +// Row 1 +#define BR_DQUO S(BR_QUOT) // " +#define BR_EXLM S(BR_1) // ! +#define BR_AT S(BR_2) // @ +#define BR_HASH S(BR_3) // # +#define BR_DLR S(BR_4) // $ +#define BR_PERC S(BR_5) // % +#define BR_DIAE S(BR_6) // ¨ (dead) +#define BR_AMPR S(BR_7) // & +#define BR_ASTR S(BR_8) // * +#define BR_LPRN S(BR_9) // ( +#define BR_RPRN S(BR_0) // ) +#define BR_UNDS S(BR_MINS) // _ +#define BR_PLUS S(BR_EQL) // + +// Row 2 +#define BR_GRV S(BR_ACUT) // ` (dead) +#define BR_LCBR S(BR_LBRC) // { +// Row 3 +#define BR_CIRC S(BR_TILD) // ^ (dead) +#define BR_RCBR S(BR_RBRC) // } +// Row 4 +#define BR_PIPE S(BR_BSLS) // | +#define BR_LABK S(BR_COMM) // < +#define BR_RABK S(BR_DOT) // > +#define BR_COLN S(BR_SCLN) // : +#define BR_QUES S(BR_SLSH) // ? -// On the ABNT2 the keypad comma and the keypad dot scancodes are switched -// (presumably because in Brazil comma is used as the decimal separator) -#define BR_KPDT KC_KP_COMMA // keypad . -#define BR_KPCM KC_KP_DOT // keypad , +/* AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │   │ ¹ │ ² │ ³ │ £ │ ¢ │ ¬ │   │   │   │   │   │ § │       │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │     │   │   │ ° │   │   │   │   │   │   │   │   │ ª │     │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐    │ + * │      │   │   │   │   │   │   │   │   │   │   │   │ º │    │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┤ + * │    │   │   │   │ ₢ │   │   │   │   │   │   │   │   │      │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬──┴─┬────┤ + * │    │    │    │                        │    │    │    │    │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ +// Row 1 +#define BR_SUP1 ALGR(BR_1) // ¹ +#define BR_SUP2 ALGR(BR_2) // ² +#define BR_SUP3 ALGR(BR_3) // ³ +#define BR_PND ALGR(BR_4) // £ +#define BR_CENT ALGR(BR_5) // ¢ +#define BR_NOT ALGR(BR_6) // ¬ +#define BR_SECT ALGR(BR_EQL) // § +// Row 2 +#define BR_DEG ALGR(BR_E) // ° +#define BR_FORD ALGR(BR_LBRC) // ª +// Row 3 +#define BR_MORD ALGR(BR_RBRC) // º +// Row 4 +#define BR_CRUZ ALGR(BR_C) // ₢ -#define BR_1UP LALT(KC_1) // 1 superscript ¹ alt+1 -#define BR_2UP LALT(KC_2) // 2 superscript ² alt+2 -#define BR_3UP LALT(KC_3) // 3 superscript ³ alt+3 -#define BR_PND LALT(KC_4) // Pound sign £ alt+4 -#define BR_CENT LALT(KC_5) // Cent sign ¢ alt+5 -#define BR_NOT LALT(KC_6) // Not sign ¬ alt+6 -#define BR_SECT LALT(KC_EQL) // Section sign § alt+= -#define BR_FORD LALT(BR_LBRC) // Feminine Ordinal Sign ª alt+[ -#define BR_MORD LALT(BR_RBRC) // Masculine Ordinal Sign º alt+] -#define BR_DGRE LALT(BR_SLSH) // Degree sign ° alt+/ +// DEPRECATED +#define BR_CCDL BR_CCED +#define BR_DQT BR_DQUO +#define BR_TRMA BR_DIAE +#define BR_GRAV BR_GRV +#define BR_KPDT BR_PDOT +#define BR_KPCM BR_PCMM +#define BR_1UP BR_SUP1 +#define BR_2UP BR_SUP2 +#define BR_3UP BR_SUP3 +#define BR_ASLS BR_SLSH +#define BR_AQST BR_QUES -#define BR_EURO LALT(KC_E) // Euro sign € alt+e -#define BR_NDTD LALT(BR_TILD) // Non-dead key tilde ~ alt+~ -#define BR_NDAC LALT(BR_ACUT) // Non-dead key acute accent ´ alt+´ -#define BR_NDGV LALT(BR_QUOT) // Non-dead key grave accent ` alt+' -#define BR_NDCR LALT(BR_CIRC) // Non-dead key circumflex accent ^ alt+^ (alt+shift+~) -#define BR_NDTR LALT(BR_TRMA) // Non-dead key trema accent ¨ alt+¨ (alt+shift+6) - -// For 101-key keyboard layouts, the ABNT2 layout allows -// the slash and question mark to be typed using alt+q and alt+w. -// The shortcuts are provided here for completeness' sake, -// but it's recommended to use BR_SLSH and BR_QUES instead -#define BR_ASLS LALT(KC_Q) -#define BR_AQST LALT(KC_W) - -#endif +// Not present on Windows 10? +#define BR_NDTD ALGR(BR_TILD) // ~ +#define BR_NDAC ALGR(BR_ACUT) // ´ +#define BR_NDGV ALGR(BR_QUOT) // ` +#define BR_NDCR ALGR(BR_CIRC) // ^ +#define BR_NDTR ALGR(BR_DIAE) // ¨ diff --git a/quantum/keymap_extras/sendstring_br_abnt2.h b/quantum/keymap_extras/sendstring_br_abnt2.h new file mode 100644 index 00000000000..f2946e54b86 --- /dev/null +++ b/quantum/keymap_extras/sendstring_br_abnt2.h @@ -0,0 +1,80 @@ +/* Copyright 2020 + * + * 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 . + */ + +// Sendstring lookup tables for Brazilian (ABNT2) layouts + +#pragma once + +#include "keymap_br_abnt2.h" +#include "quantum.h" + +// clang-format off + +const uint8_t ascii_to_shift_lut[16] PROGMEM = { + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + + KCLUT_ENTRY(0, 1, 1, 1, 1, 1, 1, 0), + KCLUT_ENTRY(1, 1, 1, 1, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 1, 0, 1, 0, 1, 1), + KCLUT_ENTRY(1, 1, 1, 1, 1, 1, 1, 1), + KCLUT_ENTRY(1, 1, 1, 1, 1, 1, 1, 1), + KCLUT_ENTRY(1, 1, 1, 1, 1, 1, 1, 1), + KCLUT_ENTRY(1, 1, 1, 0, 0, 0, 1, 1), + KCLUT_ENTRY(1, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 1, 1, 1, 0, 0) +}; + +const uint8_t ascii_to_keycode_lut[128] PROGMEM = { + // NUL SOH STX ETX EOT ENQ ACK BEL + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + // BS TAB LF VT FF CR SO SI + KC_BSPC, KC_TAB, KC_ENT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + // DLE DC1 DC2 DC3 DC4 NAK SYN ETB + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + // CAN EM SUB ESC FS GS RS US + XXXXXXX, XXXXXXX, XXXXXXX, KC_ESC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + + // ! " # $ % & ' + KC_SPC, BR_1, BR_QUOT, BR_3, BR_4, BR_5, BR_7, BR_QUOT, + // ( ) * + , - . / + BR_9, BR_0, BR_8, BR_EQL, BR_COMM, BR_MINS, BR_DOT, BR_SLSH, + // 0 1 2 3 4 5 6 7 + BR_0, BR_1, BR_2, BR_3, BR_4, BR_5, BR_6, BR_7, + // 8 9 : ; < = > ? + BR_8, BR_9, BR_SCLN, BR_SCLN, BR_COMM, BR_EQL, BR_DOT, BR_SLSH, + // @ A B C D E F G + BR_2, BR_A, BR_B, BR_C, BR_D, BR_E, BR_F, BR_G, + // H I J K L M N O + BR_H, BR_I, BR_J, BR_K, BR_L, BR_M, BR_N, BR_O, + // P Q R S T U V W + BR_P, BR_Q, BR_R, BR_S, BR_T, BR_U, BR_V, BR_W, + // X Y Z [ \ ] ^ _ + BR_X, BR_Y, BR_Z, BR_LBRC, BR_BSLS, BR_RBRC, BR_TILD, BR_MINS, + // ` a b c d e f g + BR_ACUT, BR_A, BR_B, BR_C, BR_D, BR_E, BR_F, BR_G, + // h i j k l m n o + BR_H, BR_I, BR_J, BR_K, BR_L, BR_M, BR_N, BR_O, + // p q r s t u v w + BR_P, BR_Q, BR_R, BR_S, BR_T, BR_U, BR_V, BR_W, + // x y z { | } ~ DEL + BR_X, BR_Y, BR_Z, BR_LBRC, BR_BSLS, BR_RBRC, BR_TILD, KC_DEL +}; From 652f4492d3f02f330fc0b4a1476c07821f3c0cd9 Mon Sep 17 00:00:00 2001 From: Ryan Date: Tue, 17 Mar 2020 01:30:57 +1100 Subject: [PATCH 16/18] Update French keymap and sendstring LUT (#8436) --- quantum/keymap_extras/keymap_french.h | 215 ++++++++++++++-------- quantum/keymap_extras/sendstring_french.h | 26 +-- 2 files changed, 156 insertions(+), 85 deletions(-) diff --git a/quantum/keymap_extras/keymap_french.h b/quantum/keymap_extras/keymap_french.h index 2d6881e20ea..7256c50022a 100644 --- a/quantum/keymap_extras/keymap_french.h +++ b/quantum/keymap_extras/keymap_french.h @@ -13,82 +13,153 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#ifndef KEYMAP_FRENCH_H -#define KEYMAP_FRENCH_H + +#pragma once #include "keymap.h" -// Normal characters -#define FR_SUP2 KC_GRV -#define FR_AMP KC_1 -#define FR_EACU KC_2 -#define FR_QUOT KC_3 -#define FR_APOS KC_4 -#define FR_LPRN KC_5 -#define FR_MINS KC_6 -#define FR_EGRV KC_7 -#define FR_UNDS KC_8 -#define FR_CCED KC_9 -#define FR_AGRV KC_0 -#define FR_RPRN KC_MINS -#define FR_EQL KC_EQL +// clang-format off -#define FR_A KC_Q -#define FR_Z KC_W -#define FR_CIRC KC_LBRC -#define FR_DLR KC_RBRC +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ² │ & │ é │ " │ ' │ ( │ - │ è │ _ │ ç │ à │ ) │ = │       │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │     │ A │ Z │ E │ R │ T │ Y │ U │ I │ O │ P │ ^ │ $ │     │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐    │ + * │      │ Q │ S │ D │ F │ G │ H │ J │ K │ L │ M │ ù │ * │    │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │    │ < │ W │ X │ C │ V │ B │ N │ , │ ; │ : │ ! │          │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │    │    │    │                        │    │    │    │    │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ +// Row 1 +#define FR_SUP2 KC_GRV // ² +#define FR_AMPR KC_1 // & +#define FR_EACU KC_2 // é +#define FR_DQUO KC_3 // " +#define FR_QUOT KC_4 // ' +#define FR_LPRN KC_5 // ( +#define FR_MINS KC_6 // - +#define FR_EGRV KC_7 // è +#define FR_UNDS KC_8 // _ +#define FR_CCED KC_9 // ç +#define FR_AGRV KC_0 // à +#define FR_RPRN KC_MINS // ) +#define FR_EQL KC_EQL // = +// Row 2 +#define FR_A KC_Q // A +#define FR_Z KC_W // Z +#define FR_E KC_E // E +#define FR_R KC_R // R +#define FR_T KC_T // T +#define FR_Y KC_Y // Y +#define FR_U KC_U // U +#define FR_I KC_I // I +#define FR_O KC_O // O +#define FR_P KC_P // P +#define FR_CIRC KC_LBRC // ^ (dead) +#define FR_DLR KC_RBRC // $ +// Row 3 +#define FR_Q KC_A // Q +#define FR_S KC_S // S +#define FR_D KC_D // D +#define FR_F KC_F // F +#define FR_G KC_G // G +#define FR_H KC_H // H +#define FR_J KC_J // J +#define FR_K KC_K // K +#define FR_L KC_L // L +#define FR_M KC_SCLN // M +#define FR_UGRV KC_QUOT // ù +#define FR_ASTR KC_NUHS // * +// Row 4 +#define FR_LABK KC_NUBS // < +#define FR_W KC_Z // W +#define FR_X KC_X // X +#define FR_C KC_C // C +#define FR_V KC_V // V +#define FR_B KC_B // B +#define FR_N KC_N // N +#define FR_COMM KC_M // , +#define FR_SCLN KC_COMM // ; +#define FR_COLN KC_DOT // : +#define FR_EXLM KC_SLSH // ! -#define FR_Q KC_A -#define FR_M KC_SCLN -#define FR_UGRV KC_QUOT -#define FR_ASTR KC_NUHS +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │   │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ ° │ + │       │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │     │   │   │   │   │   │   │   │   │   │   │ ¨ │ £ │     │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐    │ + * │      │   │   │   │   │   │   │   │   │   │   │ % │ µ │    │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │    │ > │   │   │   │   │   │   │ ? │ . │ / │ § │          │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │    │    │    │                        │    │    │    │    │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ +// Row 1 +#define FR_1 S(FR_AMPR) // 1 +#define FR_2 S(FR_EACU) // 2 +#define FR_3 S(FR_DQUO) // 3 +#define FR_4 S(FR_QUOT) // 4 +#define FR_5 S(FR_LPRN) // 5 +#define FR_6 S(FR_MINS) // 6 +#define FR_7 S(FR_EGRV) // 7 +#define FR_8 S(FR_UNDS) // 8 +#define FR_9 S(FR_CCED) // 9 +#define FR_0 S(FR_AGRV) // 0 +#define FR_DEG S(FR_RPRN) // ° +#define FR_PLUS S(FR_EQL) // + +// Row 2 +#define FR_DIAE S(FR_CIRC) // ¨ (dead) +#define FR_PND S(FR_DLR) // £ +// Row 3 +#define FR_PERC S(FR_UGRV) // % +#define FR_MICR S(FR_ASTR) // µ +// Row 4 +#define FR_RABK S(FR_LABK) // > +#define FR_QUES S(FR_COMM) // ? +#define FR_DOT S(FR_SCLN) // . +#define FR_SLSH S(FR_COLN) // / +#define FR_SECT S(FR_EXLM) // § -#define FR_LESS KC_NUBS -#define FR_W KC_Z -#define FR_COMM KC_M -#define FR_SCLN KC_COMM -#define FR_COLN KC_DOT -#define FR_EXLM KC_SLSH +/* AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │   │   │ ~ │ # │ { │ [ │ | │ ` │ \ │   │ @ │ ] │ } │       │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │     │   │   │ € │   │   │   │   │   │   │   │   │ ¤ │     │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐    │ + * │      │   │   │   │   │   │   │   │   │   │   │   │   │    │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │    │   │   │   │   │   │   │   │   │   │   │   │          │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │    │    │    │                        │    │    │    │    │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ +// Row 1 +#define FR_TILD ALGR(FR_EACU) // ~ (dead) +#define FR_HASH ALGR(FR_DQUO) // # +#define FR_LCBR ALGR(FR_QUOT) // { +#define FR_LBRC ALGR(FR_LPRN) // [ +#define FR_PIPE ALGR(FR_MINS) // | +#define FR_GRV ALGR(FR_EGRV) // ` (dead) +#define FR_BSLS ALGR(FR_UNDS) // (backslash) +#define FR_AT ALGR(FR_AGRV) // @ +#define FR_RBRC ALGR(FR_RPRN) // ] +#define FR_RCBR ALGR(FR_EQL) // } +// Row 2 +#define FR_EURO ALGR(KC_E) // € +#define FR_CURR ALGR(FR_DLR) // ¤ -// Shifted characters -#define FR_1 LSFT(KC_1) -#define FR_2 LSFT(KC_2) -#define FR_3 LSFT(KC_3) -#define FR_4 LSFT(KC_4) -#define FR_5 LSFT(KC_5) -#define FR_6 LSFT(KC_6) -#define FR_7 LSFT(KC_7) -#define FR_8 LSFT(KC_8) -#define FR_9 LSFT(KC_9) -#define FR_0 LSFT(KC_0) -#define FR_OVRR LSFT(FR_RPRN) -#define FR_PLUS LSFT(FR_EQL) - -#define FR_UMLT LSFT(FR_CIRC) -#define FR_PND LSFT(FR_DLR) -#define FR_PERC LSFT(FR_UGRV) -#define FR_MU LSFT(FR_ASTR) - -#define FR_GRTR LSFT(FR_LESS) -#define FR_QUES LSFT(FR_COMM) -#define FR_DOT LSFT(FR_SCLN) -#define FR_SLSH LSFT(FR_COLN) -#define FR_SECT LSFT(FR_EXLM) - -// Alt Gr-ed characters -#define FR_TILD ALGR(KC_2) -#define FR_HASH ALGR(KC_3) -#define FR_LCBR ALGR(KC_4) -#define FR_LBRC ALGR(KC_5) -#define FR_PIPE ALGR(KC_6) -#define FR_GRV ALGR(KC_7) -#define FR_BSLS ALGR(KC_8) -#define FR_CCIRC ALGR(KC_9) -#define FR_AT ALGR(KC_0) -#define FR_RBRC ALGR(FR_RPRN) -#define FR_RCBR ALGR(FR_EQL) - -#define FR_EURO ALGR(KC_E) -#define FR_BULT ALGR(FR_DLR) - -#endif +// DEPRECATED +#define FR_AMP FR_AMPR +#define FR_APOS FR_QUOT +#define FR_LESS FR_LABK +#define FR_OVRR FR_DEG +#define FR_UMLT FR_DIAE +#define FR_MU FR_MICR +#define FR_GRTR FR_RABK +#define FR_CCIRC FR_CIRC +#define FR_BULT FR_CURR diff --git a/quantum/keymap_extras/sendstring_french.h b/quantum/keymap_extras/sendstring_french.h index 04b65ee919d..a02f114b4ea 100644 --- a/quantum/keymap_extras/sendstring_french.h +++ b/quantum/keymap_extras/sendstring_french.h @@ -40,7 +40,7 @@ const uint8_t ascii_to_shift_lut[16] PROGMEM = { KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), - KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0) }; const uint8_t ascii_to_altgr_lut[16] PROGMEM = { @@ -60,7 +60,7 @@ const uint8_t ascii_to_altgr_lut[16] PROGMEM = { KCLUT_ENTRY(1, 0, 0, 0, 0, 0, 0, 0), KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), - KCLUT_ENTRY(0, 0, 0, 1, 1, 1, 1, 0), + KCLUT_ENTRY(0, 0, 0, 1, 1, 1, 1, 0) }; const uint8_t ascii_to_keycode_lut[128] PROGMEM = { @@ -74,27 +74,27 @@ const uint8_t ascii_to_keycode_lut[128] PROGMEM = { XXXXXXX, XXXXXXX, XXXXXXX, KC_ESC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, // ! " # $ % & ' - KC_SPC, FR_EXLM, FR_QUOT, FR_QUOT, FR_DLR, FR_UGRV, FR_AMP, FR_APOS, + KC_SPC, FR_EXLM, FR_QUOT, FR_DQUO, FR_DLR, FR_UGRV, FR_AMP, FR_QUOT, // ( ) * + , - . / FR_LPRN, FR_RPRN, FR_ASTR, FR_EQL, FR_COMM, FR_MINS, FR_SCLN, FR_COLN, // 0 1 2 3 4 5 6 7 - FR_AGRV, FR_AMP, FR_EACU, FR_QUOT, FR_APOS, FR_LPRN, FR_MINS, FR_EGRV, + FR_AGRV, FR_AMPR, FR_EACU, FR_DQUO, FR_QUOT, FR_LPRN, FR_MINS, FR_EGRV, // 8 9 : ; < = > ? - FR_CCED, FR_AGRV, FR_COLN, FR_SCLN, FR_LESS, FR_EQL, FR_LESS, FR_COMM, + FR_CCED, FR_AGRV, FR_COLN, FR_SCLN, FR_LABK, FR_EQL, FR_LABK, FR_COMM, // @ A B C D E F G - FR_AGRV, FR_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, + FR_AGRV, FR_A, FR_B, FR_C, FR_D, FR_E, FR_F, FR_G, // H I J K L M N O - KC_H, KC_I, KC_J, KC_K, KC_L, FR_M, KC_N, KC_O, + FR_H, FR_I, FR_J, FR_K, FR_L, FR_M, FR_N, FR_O, // P Q R S T U V W - KC_P, FR_Q, KC_R, KC_S, KC_T, KC_U, KC_V, FR_W, + FR_P, FR_Q, FR_R, FR_S, FR_T, FR_U, FR_V, FR_W, // X Y Z [ \ ] ^ _ - KC_X, KC_Y, FR_Z, FR_LPRN, FR_UNDS, FR_RPRN, FR_CCED, FR_UNDS, + FR_X, FR_Y, FR_Z, FR_LPRN, FR_UNDS, FR_RPRN, FR_CCED, FR_UNDS, // ` a b c d e f g - FR_EGRV, FR_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, + FR_EGRV, FR_A, FR_B, FR_C, FR_D, FR_E, FR_F, FR_G, // h i j k l m n o - KC_H, KC_I, KC_J, KC_K, KC_L, FR_M, KC_N, KC_O, + FR_H, FR_I, FR_J, FR_K, FR_L, FR_M, FR_N, FR_O, // p q r s t u v w - KC_P, FR_Q, KC_R, KC_S, KC_T, KC_U, KC_V, FR_W, + FR_P, FR_Q, FR_R, FR_S, FR_T, FR_U, FR_V, FR_W, // x y z { | } ~ DEL - KC_X, KC_Y, FR_Z, FR_APOS, FR_MINS, FR_EQL, FR_EACU, KC_DEL + FR_X, FR_Y, FR_Z, FR_QUOT, FR_MINS, FR_EQL, FR_EACU, KC_DEL }; From 7fe4097792e779cc4c74fc6152740fcf91682c15 Mon Sep 17 00:00:00 2001 From: Ryan Date: Tue, 17 Mar 2020 01:31:48 +1100 Subject: [PATCH 17/18] Update German keymap and sendstring LUT (#8437) --- quantum/keymap_extras/keymap_german.h | 231 +++++++++++++--------- quantum/keymap_extras/sendstring_german.h | 8 +- 2 files changed, 147 insertions(+), 92 deletions(-) diff --git a/quantum/keymap_extras/keymap_german.h b/quantum/keymap_extras/keymap_german.h index b41b11d6aee..59198dd1be5 100644 --- a/quantum/keymap_extras/keymap_german.h +++ b/quantum/keymap_extras/keymap_german.h @@ -14,98 +14,153 @@ * along with this program. If not, see . */ -#ifndef KEYMAP_GERMAN -#define KEYMAP_GERMAN +#pragma once #include "keymap.h" -// normal characters -#define DE_Z KC_Y -#define DE_Y KC_Z +// clang-format off -#define DE_A KC_A -#define DE_B KC_B -#define DE_C KC_C -#define DE_D KC_D -#define DE_E KC_E -#define DE_F KC_F -#define DE_G KC_G -#define DE_H KC_H -#define DE_I KC_I -#define DE_J KC_J -#define DE_K KC_K -#define DE_L KC_L -#define DE_M KC_M -#define DE_N KC_N -#define DE_O KC_O -#define DE_P KC_P -#define DE_Q KC_Q -#define DE_R KC_R -#define DE_S KC_S -#define DE_T KC_T -#define DE_U KC_U -#define DE_V KC_V -#define DE_W KC_W -#define DE_X KC_X +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ^ │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ ß │ ´ │       │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │     │ Q │ W │ E │ R │ T │ Z │ U │ I │ O │ P │ Ü │ + │     │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐    │ + * │      │ A │ S │ D │ F │ G │ H │ J │ K │ L │ Ö │ Ä │ # │    │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │    │ < │ Y │ X │ C │ V │ B │ N │ M │ , │ . │ - │          │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │    │    │    │                        │    │    │    │    │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ +// Row 1 +#define DE_CIRC KC_GRV // ^ (dead) +#define DE_1 KC_1 // 1 +#define DE_2 KC_2 // 2 +#define DE_3 KC_3 // 3 +#define DE_4 KC_4 // 4 +#define DE_5 KC_5 // 5 +#define DE_6 KC_6 // 6 +#define DE_7 KC_7 // 7 +#define DE_8 KC_8 // 8 +#define DE_9 KC_9 // 9 +#define DE_0 KC_0 // 0 +#define DE_SS KC_MINS // ß +#define DE_ACUT KC_EQL // ´ (dead) +// Row 2 +#define DE_Q KC_Q // Q +#define DE_W KC_W // W +#define DE_E KC_E // E +#define DE_R KC_R // R +#define DE_T KC_T // T +#define DE_Z KC_Y // Z +#define DE_U KC_U // U +#define DE_I KC_I // I +#define DE_O KC_O // O +#define DE_P KC_P // P +#define DE_UDIA KC_LBRC // Ü +#define DE_PLUS KC_RBRC // + +// Row 3 +#define DE_A KC_A // A +#define DE_S KC_S // S +#define DE_D KC_D // D +#define DE_F KC_F // F +#define DE_G KC_G // G +#define DE_H KC_H // H +#define DE_J KC_J // J +#define DE_K KC_K // K +#define DE_L KC_L // L +#define DE_ODIA KC_SCLN // Ö +#define DE_ADIA KC_QUOT // Ä +#define DE_HASH KC_NUHS // # +// Row 4 +#define DE_LABK KC_NUBS // < +#define DE_Y KC_Z // Y +#define DE_X KC_X // X +#define DE_C KC_C // C +#define DE_V KC_V // V +#define DE_B KC_B // B +#define DE_N KC_N // N +#define DE_M KC_M // M +#define DE_COMM KC_COMM // , +#define DE_DOT KC_DOT // . +#define DE_MINS KC_SLSH // - -#define DE_0 KC_0 -#define DE_1 KC_1 -#define DE_2 KC_2 -#define DE_3 KC_3 -#define DE_4 KC_4 -#define DE_5 KC_5 -#define DE_6 KC_6 -#define DE_7 KC_7 -#define DE_8 KC_8 -#define DE_9 KC_9 +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ° │ ! │ " │ § │ $ │ % │ & │ / │ ( │ ) │ = │ ? │ ` │       │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │     │   │   │   │   │   │   │   │   │   │   │   │ * │     │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐    │ + * │      │   │   │   │   │   │   │   │   │   │   │   │ ' │    │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │    │ > │   │   │   │   │   │   │   │ ; │ : │ _ │          │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │    │    │    │                        │    │    │    │    │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ +// Row 1 +#define DE_DEG S(DE_CIRC) // ° +#define DE_EXLM S(DE_1) // ! +#define DE_DQUO S(DE_2) // " +#define DE_SECT S(DE_3) // § +#define DE_DLR S(DE_4) // $ +#define DE_PERC S(DE_5) // % +#define DE_AMPR S(DE_6) // & +#define DE_SLSH S(DE_7) // / +#define DE_LPRN S(DE_8) // ( +#define DE_RPRN S(DE_9) // ) +#define DE_EQL S(DE_0) // = +#define DE_QUES S(DE_SS) // ? +#define DE_GRV S(DE_ACUT) // ` (dead) +// Row 2 +#define DE_ASTR S(DE_PLUS) // * +// Row 3 +#define DE_QUOT S(DE_HASH) // ' +// Row 4 +#define DE_RABK S(DE_LABK) // > +#define DE_SCLN S(DE_COMM) // ; +#define DE_COLN S(DE_DOT) // : +#define DE_UNDS S(DE_MINS) // _ -#define DE_DOT KC_DOT -#define DE_COMM KC_COMM +/* AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │   │   │ ² │ ³ │   │   │   │ { │ [ │ ] │ } │ \ │   │       │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │     │ @ │   │ € │   │   │   │   │   │   │   │   │ ~ │     │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐    │ + * │      │   │   │   │   │   │   │   │   │   │   │   │   │    │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │    │ | │   │   │   │   │   │   │ µ │   │   │   │          │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │    │    │    │                        │    │    │    │    │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ +// Row 1 +#define DE_SUP2 ALGR(DE_2) // ² +#define DE_SUP3 ALGR(DE_3) // ³ +#define DE_LCBR ALGR(DE_7) // { +#define DE_LBRC ALGR(DE_8) // [ +#define DE_RBRC ALGR(DE_9) // ] +#define DE_RCBR ALGR(DE_0) // } +#define DE_BSLS ALGR(DE_SS) // (backslash) +// Row 2 +#define DE_AT ALGR(DE_Q) // @ +#define DE_EURO ALGR(DE_E) // € +#define DE_TILD ALGR(DE_PLUS) // ~ +// Row 4 +#define DE_PIPE ALGR(DE_LABK) // | +#define DE_MICR ALGR(DE_M) // µ -#define DE_SS KC_MINS -#define DE_AE KC_QUOT -#define DE_UE KC_LBRC -#define DE_OE KC_SCLN - -#define DE_CIRC KC_GRAVE // accent circumflex ^ and ring ° -#define DE_ACUT KC_EQL // accent acute ´ and grave ` -#define DE_PLUS KC_RBRC // + and * and ~ -#define DE_HASH KC_BSLS // # and ' -#define DE_LESS KC_NUBS // < and > and | -#define DE_MINS KC_SLSH // - and _ - -// shifted characters -#define DE_RING LSFT(DE_CIRC) // ° -#define DE_EXLM LSFT(KC_1) // ! -#define DE_DQOT LSFT(KC_2) // " -#define DE_PARA LSFT(KC_3) // § -#define DE_DLR LSFT(KC_4) // $ -#define DE_PERC LSFT(KC_5) // % -#define DE_AMPR LSFT(KC_6) // & -#define DE_SLSH LSFT(KC_7) // / -#define DE_LPRN LSFT(KC_8) // ( -#define DE_RPRN LSFT(KC_9) // ) -#define DE_EQL LSFT(KC_0) // = -#define DE_QST LSFT(DE_SS) // ? -#define DE_GRV LSFT(DE_ACUT) // ` -#define DE_ASTR LSFT(DE_PLUS) // * -#define DE_QUOT LSFT(DE_HASH) // ' -#define DE_MORE LSFT(DE_LESS) // > -#define DE_COLN LSFT(KC_DOT) // : -#define DE_SCLN LSFT(KC_COMM) // ; -#define DE_UNDS LSFT(DE_MINS) // _ - -// Alt Gr-ed characters -#define DE_SQ2 ALGR(KC_2) // ² -#define DE_SQ3 ALGR(KC_3) // ³ -#define DE_LCBR ALGR(KC_7) // { -#define DE_LBRC ALGR(KC_8) // [ -#define DE_RBRC ALGR(KC_9) // ] -#define DE_RCBR ALGR(KC_0) // } -#define DE_BSLS ALGR(DE_SS) // backslash -#define DE_AT ALGR(KC_Q) // @ -#define DE_EURO ALGR(KC_E) // € -#define DE_TILD ALGR(DE_PLUS) // ~ -#define DE_PIPE ALGR(DE_LESS) // | - -#endif +// DEPRECATED +#define DE_UE DE_UDIA +#define DE_OE DE_ODIA +#define DE_AE DE_ADIA +#define DE_LESS DE_LABK +#define DE_RING DE_DEG +#define DE_DQOT DE_DQUO +#define DE_PARA DE_SECT +#define DE_QST DE_QUES +#define DE_MORE DE_RABK +#define DE_SQ2 DE_SUP2 +#define DE_SQ3 DE_SUP3 diff --git a/quantum/keymap_extras/sendstring_german.h b/quantum/keymap_extras/sendstring_german.h index 1bbdcce2ca8..3445a0e5fb7 100644 --- a/quantum/keymap_extras/sendstring_german.h +++ b/quantum/keymap_extras/sendstring_german.h @@ -40,7 +40,7 @@ const uint8_t ascii_to_shift_lut[16] PROGMEM = { KCLUT_ENTRY(1, 0, 0, 0, 0, 0, 0, 0), KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), - KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0) }; const uint8_t ascii_to_altgr_lut[16] PROGMEM = { @@ -60,7 +60,7 @@ const uint8_t ascii_to_altgr_lut[16] PROGMEM = { KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), - KCLUT_ENTRY(0, 0, 0, 1, 1, 1, 1, 0), + KCLUT_ENTRY(0, 0, 0, 1, 1, 1, 1, 0) }; const uint8_t ascii_to_keycode_lut[128] PROGMEM = { @@ -80,7 +80,7 @@ const uint8_t ascii_to_keycode_lut[128] PROGMEM = { // 0 1 2 3 4 5 6 7 DE_0, DE_1, DE_2, DE_3, DE_4, DE_5, DE_6, DE_7, // 8 9 : ; < = > ? - DE_8, DE_9, DE_DOT, DE_COMM, DE_LESS, DE_0, DE_LESS, DE_SS, + DE_8, DE_9, DE_DOT, DE_COMM, DE_LABK, DE_0, DE_LABK, DE_SS, // @ A B C D E F G DE_Q, DE_A, DE_B, DE_C, DE_D, DE_E, DE_F, DE_G, // H I J K L M N O @@ -96,5 +96,5 @@ const uint8_t ascii_to_keycode_lut[128] PROGMEM = { // p q r s t u v w DE_P, DE_Q, DE_R, DE_S, DE_T, DE_U, DE_V, DE_W, // x y z { | } ~ DEL - DE_X, DE_Y, DE_Z, DE_7, DE_LESS, DE_0, DE_PLUS, KC_DEL + DE_X, DE_Y, DE_Z, DE_7, DE_LABK, DE_0, DE_PLUS, KC_DEL }; From 7aff643031eec0b940b85d9f2a0d7a27fd6d4fa7 Mon Sep 17 00:00:00 2001 From: Ryan Date: Tue, 17 Mar 2020 01:32:48 +1100 Subject: [PATCH 18/18] Update Italian keymap and add sendstring LUT (#8438) --- quantum/keymap_extras/keymap_italian.h | 247 +++++++++++++-------- quantum/keymap_extras/sendstring_italian.h | 100 +++++++++ 2 files changed, 259 insertions(+), 88 deletions(-) create mode 100644 quantum/keymap_extras/sendstring_italian.h diff --git a/quantum/keymap_extras/keymap_italian.h b/quantum/keymap_extras/keymap_italian.h index 063700aa0b0..71c2b2e33ac 100644 --- a/quantum/keymap_extras/keymap_italian.h +++ b/quantum/keymap_extras/keymap_italian.h @@ -14,100 +14,171 @@ * along with this program. If not, see . */ -#ifndef KEYMAP_ITALIAN -#define KEYMAP_ITALIAN +#pragma once #include "keymap.h" -// normal characters -#define IT_A KC_A -#define IT_B KC_B -#define IT_C KC_C -#define IT_D KC_D -#define IT_E KC_E -#define IT_F KC_F -#define IT_G KC_G -#define IT_H KC_H -#define IT_I KC_I -#define IT_J KC_J -#define IT_K KC_K -#define IT_L KC_L -#define IT_M KC_M -#define IT_N KC_N -#define IT_O KC_O -#define IT_P KC_P -#define IT_Q KC_Q -#define IT_R KC_R -#define IT_S KC_S -#define IT_T KC_T -#define IT_U KC_U -#define IT_V KC_V -#define IT_W KC_W -#define IT_X KC_X -#define IT_Y KC_Y -#define IT_Z KC_Z +// clang-format off -#define IT_0 KC_0 -#define IT_1 KC_1 -#define IT_2 KC_2 -#define IT_3 KC_3 -#define IT_4 KC_4 -#define IT_5 KC_5 -#define IT_6 KC_6 -#define IT_7 KC_7 -#define IT_8 KC_8 -#define IT_9 KC_9 +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ \ │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ ' │ ì │       │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │     │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ è │ + │     │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐    │ + * │      │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ò │ à │ ù │    │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │    │ < │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ - │          │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │    │    │    │                        │    │    │    │    │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ +// Row 1 +#define IT_BSLS KC_GRV // (backslash) +#define IT_1 KC_1 // 1 +#define IT_2 KC_2 // 2 +#define IT_3 KC_3 // 3 +#define IT_4 KC_4 // 4 +#define IT_5 KC_5 // 5 +#define IT_6 KC_6 // 6 +#define IT_7 KC_7 // 7 +#define IT_8 KC_8 // 8 +#define IT_9 KC_9 // 9 +#define IT_0 KC_0 // 0 +#define IT_QUOT KC_MINS // ' +#define IT_IGRV KC_EQL // ì +// Row 2 +#define IT_Q KC_Q // Q +#define IT_W KC_W // W +#define IT_E KC_E // E +#define IT_R KC_R // R +#define IT_T KC_T // T +#define IT_Y KC_Y // Y +#define IT_U KC_U // U +#define IT_I KC_I // I +#define IT_O KC_O // O +#define IT_P KC_P // P +#define IT_EGRV KC_LBRC // è +#define IT_PLUS KC_RBRC // + +// Row 3 +#define IT_A KC_A // A +#define IT_S KC_S // S +#define IT_D KC_D // D +#define IT_F KC_F // F +#define IT_G KC_G // G +#define IT_H KC_H // H +#define IT_J KC_J // J +#define IT_K KC_K // K +#define IT_L KC_L // L +#define IT_OGRV KC_SCLN // ò +#define IT_AGRV KC_QUOT // à +#define IT_UGRV KC_NUHS // ù +// Row 4 +#define IT_LABK KC_NUBS // < +#define IT_Z KC_Z // Z +#define IT_X KC_X // X +#define IT_C KC_C // C +#define IT_B KC_B // B +#define IT_V KC_V // V +#define IT_N KC_N // N +#define IT_M KC_M // M +#define IT_COMM KC_COMM // , +#define IT_DOT KC_DOT // . +#define IT_MINS KC_SLSH // - -#define IT_DOT KC_DOT -#define IT_COMM KC_COMM +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ | │ ! │ " │ £ │ $ │ % │ & │ / │ ( │ ) │ = │ ? │ ^ │       │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │     │   │   │   │   │   │   │   │   │   │   │ é │ * │     │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐    │ + * │      │   │   │   │   │   │   │   │   │   │ ç │ ° │ § │    │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │    │ > │   │   │   │   │   │   │   │ ; │ : │ _ │          │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │    │    │    │                        │    │    │    │    │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ +// Row 1 +#define IT_PIPE S(IT_BSLS) // | +#define IT_EXLM S(IT_1) // ! +#define IT_DQUO S(IT_2) // " +#define IT_PND S(IT_3) // £ +#define IT_DLR S(IT_4) // $ +#define IT_PERC S(IT_5) // % +#define IT_AMPR S(IT_6) // & +#define IT_SLSH S(IT_7) // / +#define IT_LPRN S(IT_8) // ( +#define IT_RPRN S(IT_9) // ) +#define IT_EQL S(IT_0) // = +#define IT_QUES S(IT_QUOT) // ? +#define IT_CIRC S(IT_IGRV) // ^ +// Row 2 +#define IT_EACU S(IT_EGRV) // é +#define IT_ASTR S(IT_PLUS) // * +// Row 3 +#define IT_CCED S(IT_OGRV) // ç +#define IT_DEG S(IT_AGRV) // ° +#define IT_SECT S(IT_UGRV) // § +// Row 4 +#define IT_RABK S(IT_LABK) // > +#define IT_COLN S(IT_DOT) // : +#define IT_SCLN S(IT_COMM) // ; +#define IT_UNDS S(IT_MINS) // _ -#define IT_EACC KC_LBRC // è, é, [, { -#define IT_PLUS KC_RBRC // +, *, ], } -#define IT_OACC KC_SCLN // ò, ç, @, -#define IT_AACC KC_QUOT // à, °, #, -#define IT_UACC KC_BSLS // ù, §, , -#define IT_IACC KC_EQL // ì, ^, , +/* AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │   │   │   │   │   │   │   │   │   │   │   │   │   │       │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │     │   │   │ € │   │   │   │   │   │   │   │ [ │ ] │     │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐    │ + * │      │   │   │   │   │   │   │   │   │   │ @ │ # │   │    │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │    │   │   │   │   │   │   │   │   │   │   │   │          │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │    │    │    │                        │    │    │    │    │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ +// Row 2 +#define IT_EURO ALGR(IT_E) // € +#define IT_LBRC ALGR(IT_EGRV) // [ +#define IT_RBRC ALGR(IT_PLUS) // ] +// Row 3 +#define IT_AT ALGR(IT_OGRV) // @ +#define IT_HASH ALGR(IT_AGRV) // # -#define IT_APOS KC_MINS // ', ?, , +/* Shift+AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │   │   │   │   │   │   │   │   │   │   │   │   │   │       │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │     │   │   │   │   │   │   │   │   │   │   │ { │ } │     │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐    │ + * │      │   │   │   │   │   │   │   │   │   │   │   │   │    │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │    │   │   │   │   │   │   │   │   │   │   │   │          │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │    │    │    │                        │    │    │    │    │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ +// Row 2 +#define IT_LCBR S(ALGR(IT_EGRV)) // { +#define IT_RCBR S(ALGR(IT_PLUS)) // } -#define IT_BKSL KC_GRAVE // backslash \, | +// DEPRECATED +#define IT_BKSL IT_BSLS +#define IT_QUOT IT_APOS +#define IT_IACC IT_IGRV +#define IT_EACC IT_EGRV +#define IT_OACC IT_OGRV +#define IT_AACC IT_AGRV +#define IT_UACC IT_UGRV +#define IT_LESS IT_LABK +#define IT_DQOT IT_DQUO +#define IT_STRL IT_PND +#define IT_QST IT_QUES +#define IT_CRC IT_CIRC +#define IT_MORE IT_RABK +#define IT_SHRP IT_HASH -#define IT_ACUT // accent acute ´ and grave ` - -#define IT_LESS KC_NUBS // < and > and | -#define IT_MINS KC_SLSH // - and _ - -// shifted characters -#define IT_DEGR LSFT(IT_AACC) // ° -#define IT_EXLM LSFT(KC_1) // ! -#define IT_DQOT LSFT(KC_2) // " -#define IT_STRL LSFT(KC_3) // £ -#define IT_DLR LSFT(KC_4) // $ -#define IT_PERC LSFT(KC_5) // % -#define IT_AMPR LSFT(KC_6) // & -#define IT_SLSH LSFT(KC_7) // / -#define IT_LPRN LSFT(KC_8) // ( -#define IT_RPRN LSFT(KC_9) // ) -#define IT_EQL LSFT(KC_0) // = -#define IT_QST LSFT(IT_APOS) // ? -#define IT_CRC LSFT(IT_IACC) // ^ -#define IT_ASTR LSFT(IT_PLUS) // * -#define IT_MORE LSFT(IT_LESS) // > -#define IT_COLN LSFT(IT_DOT) // : -#define IT_SCLN LSFT(IT_COMM) // ; -#define IT_UNDS LSFT(IT_MINS) // _ - -// Alt Gr-ed characters -#define IT_LCBR ALGR(KC_7) // { -#define IT_LBRC ALGR(IT_EACC) // [ -#define IT_RBRC ALGR(IT_PLUS) // ] -#define IT_RCBR ALGR(KC_0) // } -#define IT_AT ALGR(IT_OACC) // @ -#define IT_EURO ALGR(KC_E) // € -#define IT_PIPE LSFT(IT_BSLS) // | -#define IT_SHRP ALGR(IT_AACC) // # - -// Deprecated -#define IT_X_PLUS X_RBRACKET // # - -#endif +#define IT_X_PLUS X_RBRACKET +#define IT_ACUT diff --git a/quantum/keymap_extras/sendstring_italian.h b/quantum/keymap_extras/sendstring_italian.h new file mode 100644 index 00000000000..dad4902d34d --- /dev/null +++ b/quantum/keymap_extras/sendstring_italian.h @@ -0,0 +1,100 @@ +/* Copyright 2019 + * + * 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 . + */ + +// Sendstring lookup tables for Italian layouts + +#pragma once + +#include "keymap_italian.h" +#include "quantum.h" + +// clang-format off + +const uint8_t ascii_to_shift_lut[16] PROGMEM = { + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + + KCLUT_ENTRY(0, 1, 1, 0, 1, 1, 1, 0), + KCLUT_ENTRY(1, 1, 1, 0, 0, 0, 0, 1), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 1, 1, 0, 1, 1, 1), + KCLUT_ENTRY(0, 1, 1, 1, 1, 1, 1, 1), + KCLUT_ENTRY(1, 1, 1, 1, 1, 1, 1, 1), + KCLUT_ENTRY(1, 1, 1, 1, 1, 1, 1, 1), + KCLUT_ENTRY(1, 1, 1, 0, 0, 0, 1, 1), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 1, 1, 1, 0, 0) +}; + +const uint8_t ascii_to_altgr_lut[16] PROGMEM = { + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + + KCLUT_ENTRY(0, 0, 0, 1, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(1, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 1, 0, 1, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 1, 0, 1, 0, 0) +}; + +const uint8_t ascii_to_keycode_lut[128] PROGMEM = { + // NUL SOH STX ETX EOT ENQ ACK BEL + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + // BS TAB LF VT FF CR SO SI + KC_BSPC, KC_TAB, KC_ENT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + // DLE DC1 DC2 DC3 DC4 NAK SYN ETB + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + // CAN EM SUB ESC FS GS RS US + XXXXXXX, XXXXXXX, XXXXXXX, KC_ESC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + + // ! " # $ % & ' + KC_SPC, IT_1, IT_2, IT_AGRV, IT_4, IT_5, IT_6, IT_QUOT, + // ( ) * + , - . / + IT_8, IT_9, IT_PLUS, IT_PLUS, IT_COMM, IT_MINS, IT_DOT, IT_7, + // 0 1 2 3 4 5 6 7 + IT_0, IT_1, IT_2, IT_3, IT_4, IT_5, IT_6, IT_7, + // 8 9 : ; < = > ? + IT_8, IT_9, IT_DOT, IT_COMM, IT_LABK, IT_0, IT_LABK, IT_QUOT, + // @ A B C D E F G + IT_OGRV, IT_A, IT_B, IT_C, IT_D, IT_E, IT_F, IT_G, + // H I J K L M N O + IT_H, IT_I, IT_J, IT_K, IT_L, IT_M, IT_N, IT_O, + // P Q R S T U V W + IT_P, IT_Q, IT_R, IT_S, IT_T, IT_U, IT_V, IT_W, + // X Y Z [ \ ] ^ _ + IT_X, IT_Y, IT_Z, IT_EGRV, IT_BSLS, IT_PLUS, IT_IGRV, IT_MINS, + // ` a b c d e f g + XXXXXXX, IT_A, IT_B, IT_C, IT_D, IT_E, IT_F, IT_G, + // h i j k l m n o + IT_H, IT_I, IT_J, IT_K, IT_L, IT_M, IT_N, IT_O, + // p q r s t u v w + IT_P, IT_Q, IT_R, IT_S, IT_T, IT_U, IT_V, IT_W, + // x y z { | } ~ DEL + IT_X, IT_Y, IT_Z, IT_EGRV, IT_BSLS, IT_PLUS, XXXXXXX, KC_DEL +};