mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-08-19 07:45:00 +00:00
Compare commits
16 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
fe1a055391 | ||
![]() |
c18b51e68e | ||
![]() |
dc68418660 | ||
![]() |
499d7c8ce6 | ||
![]() |
60b020acab | ||
![]() |
b5be96f8bb | ||
![]() |
7aa21cc287 | ||
![]() |
d597af9e1e | ||
![]() |
03ed819717 | ||
![]() |
141535c9db | ||
![]() |
a92947fcdb | ||
![]() |
cde5237a88 | ||
![]() |
dc79792ab4 | ||
![]() |
e6a9f700de | ||
![]() |
0fdd37ee19 | ||
![]() |
40e8d60ecd |
@@ -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
|
||||
|
287
docs/cli.md
287
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 <branch_name>`
|
||||
|
||||
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 <https://config.qmk.fm>, compile keymaps in the repo, or compile the keyboard in the current working directory.
|
||||
|
||||
**Usage for Configurator Exports**:
|
||||
|
||||
```
|
||||
qmk compile <configuratorExport.json>
|
||||
```
|
||||
|
||||
**Usage for Keymaps**:
|
||||
|
||||
```
|
||||
qmk compile -kb <keyboard_name> -km <keymap_name>
|
||||
```
|
||||
|
||||
**Usage in Keyboard Directory**:
|
||||
|
||||
Must be in keyboard directory with a default keymap, or in keymap directory for keyboard, or supply one with `--keymap <keymap_name>`
|
||||
```
|
||||
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 <keyboard_name>
|
||||
```
|
||||
|
||||
**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 <bootloader>`. Visit the [Flashing Firmware](flashing.md) guide for more details of the available bootloaders.
|
||||
|
||||
**Usage for Configurator Exports**:
|
||||
|
||||
```
|
||||
qmk flash <configuratorExport.json> -bl <bootloader>
|
||||
```
|
||||
|
||||
**Usage for Keymaps**:
|
||||
|
||||
```
|
||||
qmk flash -kb <keyboard_name> -km <keymap_name> -bl <bootloader>
|
||||
```
|
||||
|
||||
**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] <filename>
|
||||
```
|
||||
|
||||
**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
|
||||
```
|
||||
|
247
docs/cli_commands.md
Normal file
247
docs/cli_commands.md
Normal file
@@ -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 <branch_name>`
|
||||
|
||||
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 <https://config.qmk.fm>, compile keymaps in the repo, or compile the keyboard in the current working directory.
|
||||
|
||||
**Usage for Configurator Exports**:
|
||||
|
||||
```
|
||||
qmk compile <configuratorExport.json>
|
||||
```
|
||||
|
||||
**Usage for Keymaps**:
|
||||
|
||||
```
|
||||
qmk compile -kb <keyboard_name> -km <keymap_name>
|
||||
```
|
||||
|
||||
**Usage in Keyboard Directory**:
|
||||
|
||||
Must be in keyboard directory with a default keymap, or in keymap directory for keyboard, or supply one with `--keymap <keymap_name>`
|
||||
```
|
||||
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 <keyboard_name>
|
||||
```
|
||||
|
||||
**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 <bootloader>`. Visit the [Flashing Firmware](flashing.md) guide for more details of the available bootloaders.
|
||||
|
||||
**Usage for Configurator Exports**:
|
||||
|
||||
```
|
||||
qmk flash <configuratorExport.json> -bl <bootloader>
|
||||
```
|
||||
|
||||
**Usage for Keymaps**:
|
||||
|
||||
```
|
||||
qmk flash -kb <keyboard_name> -km <keymap_name> -bl <bootloader>
|
||||
```
|
||||
|
||||
**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] <filename>
|
||||
```
|
||||
|
||||
**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
|
||||
```
|
@@ -261,12 +261,24 @@ void oled_task(void);
|
||||
// Called at the start of oled_task, weak function overridable by the user
|
||||
void oled_task_user(void);
|
||||
|
||||
// Scrolls the entire display right
|
||||
// Set the specific 8 lines rows of the screen to scroll.
|
||||
// 0 is the default for start, and 7 for end, which is the entire
|
||||
// height of the screen. For 128x32 screens, rows 4-7 are not used.
|
||||
void oled_scroll_set_area(uint8_t start_line, uint8_t end_line);
|
||||
|
||||
// Sets scroll speed, 0-7, fastest to slowest. Default is three.
|
||||
// Does not take effect until scrolling is either started or restarted
|
||||
// the ssd1306 supports 8 speeds with the delay
|
||||
// listed below betwen each frame of the scrolling effect
|
||||
// 0=2, 1=3, 2=4, 3=5, 4=25, 5=64, 6=128, 7=256
|
||||
void oled_scroll_set_speed(uint8_t speed);
|
||||
|
||||
// Begin scrolling the entire display right
|
||||
// Returns true if the screen was scrolling or starts scrolling
|
||||
// NOTE: display contents cannot be changed while scrolling
|
||||
bool oled_scroll_right(void);
|
||||
|
||||
// Scrolls the entire display left
|
||||
// Begin scrolling the entire display left
|
||||
// Returns true if the screen was scrolling or starts scrolling
|
||||
// NOTE: display contents cannot be changed while scrolling
|
||||
bool oled_scroll_left(void);
|
||||
|
@@ -51,7 +51,7 @@ On the display tab click 'Open stroke display'. With Plover disabled you should
|
||||
|
||||
## Learning Stenography
|
||||
|
||||
* [Learn Plover!](https://sites.google.com/site/ploverdoc/)
|
||||
* [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
|
||||
|
@@ -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
|
||||
|
@@ -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',
|
||||
|
@@ -17,7 +17,7 @@ Note that this set-up has been tested on Ubuntu 16.04 only for the moment.
|
||||
|
||||
# Prerequisites
|
||||
## Build Environment
|
||||
Before starting, you must have followed the [Getting Started](news_getting_started.md) section of the Tutorial. In particular, you must have been able to build the firmware with [the `qmk compile` command](news_building_firmware#build-your-firmware).
|
||||
Before starting, you must have followed the [Getting Started](newbs_getting_started.md) section of the Tutorial. In particular, you must have been able to build the firmware with [the `qmk compile` command](newbs_building_firmware.md#build-your-firmware).
|
||||
|
||||
## Java
|
||||
Eclipse is a Java application, so you will need to install Java 8 or more recent to be able to run it. You may choose between the JRE or the JDK, the latter being useful if you intend to do Java development.
|
||||
|
@@ -1,324 +0,0 @@
|
||||
/*
|
||||
pins_arduino.h - Pin definition functions for Arduino
|
||||
Part of Arduino - http://www.arduino.cc/
|
||||
|
||||
Copyright (c) 2007 David A. Mellis
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library 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
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General
|
||||
Public License along with this library; if not, write to the
|
||||
Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
Boston, MA 02111-1307 USA
|
||||
|
||||
$Id: wiring.h 249 2007-02-03 16:52:51Z mellis $
|
||||
*/
|
||||
|
||||
#ifndef Pins_Arduino_h
|
||||
#define Pins_Arduino_h
|
||||
|
||||
#include <avr/pgmspace.h>
|
||||
|
||||
// Workaround for wrong definitions in "iom32u4.h".
|
||||
// This should be fixed in the AVR toolchain.
|
||||
#undef UHCON
|
||||
#undef UHINT
|
||||
#undef UHIEN
|
||||
#undef UHADDR
|
||||
#undef UHFNUM
|
||||
#undef UHFNUML
|
||||
#undef UHFNUMH
|
||||
#undef UHFLEN
|
||||
#undef UPINRQX
|
||||
#undef UPINTX
|
||||
#undef UPNUM
|
||||
#undef UPRST
|
||||
#undef UPCONX
|
||||
#undef UPCFG0X
|
||||
#undef UPCFG1X
|
||||
#undef UPSTAX
|
||||
#undef UPCFG2X
|
||||
#undef UPIENX
|
||||
#undef UPDATX
|
||||
#undef TCCR2A
|
||||
#undef WGM20
|
||||
#undef WGM21
|
||||
#undef COM2B0
|
||||
#undef COM2B1
|
||||
#undef COM2A0
|
||||
#undef COM2A1
|
||||
#undef TCCR2B
|
||||
#undef CS20
|
||||
#undef CS21
|
||||
#undef CS22
|
||||
#undef WGM22
|
||||
#undef FOC2B
|
||||
#undef FOC2A
|
||||
#undef TCNT2
|
||||
#undef TCNT2_0
|
||||
#undef TCNT2_1
|
||||
#undef TCNT2_2
|
||||
#undef TCNT2_3
|
||||
#undef TCNT2_4
|
||||
#undef TCNT2_5
|
||||
#undef TCNT2_6
|
||||
#undef TCNT2_7
|
||||
#undef OCR2A
|
||||
#undef OCR2_0
|
||||
#undef OCR2_1
|
||||
#undef OCR2_2
|
||||
#undef OCR2_3
|
||||
#undef OCR2_4
|
||||
#undef OCR2_5
|
||||
#undef OCR2_6
|
||||
#undef OCR2_7
|
||||
#undef OCR2B
|
||||
#undef OCR2_0
|
||||
#undef OCR2_1
|
||||
#undef OCR2_2
|
||||
#undef OCR2_3
|
||||
#undef OCR2_4
|
||||
#undef OCR2_5
|
||||
#undef OCR2_6
|
||||
#undef OCR2_7
|
||||
|
||||
#define NUM_DIGITAL_PINS 30
|
||||
#define NUM_ANALOG_INPUTS 12
|
||||
|
||||
#define TX_RX_LED_INIT DDRD |= (1 << 5), DDRB |= (1 << 0)
|
||||
#define TXLED0 PORTD |= (1 << 5)
|
||||
#define TXLED1 PORTD &= ~(1 << 5)
|
||||
#define RXLED0 PORTB |= (1 << 0)
|
||||
#define RXLED1 PORTB &= ~(1 << 0)
|
||||
|
||||
static const uint8_t SDA = 2;
|
||||
static const uint8_t SCL = 3;
|
||||
#define LED_BUILTIN 13
|
||||
|
||||
// Map SPI port to 'new' pins D14..D17
|
||||
static const uint8_t SS = 17;
|
||||
static const uint8_t MOSI = 16;
|
||||
static const uint8_t MISO = 14;
|
||||
static const uint8_t SCK = 15;
|
||||
|
||||
// Mapping of analog pins as digital I/O
|
||||
// A6-A11 share with digital pins
|
||||
static const uint8_t ADC0 = 18;
|
||||
static const uint8_t ADC1 = 19;
|
||||
static const uint8_t ADC2 = 20;
|
||||
static const uint8_t ADC3 = 21;
|
||||
static const uint8_t ADC4 = 22;
|
||||
static const uint8_t ADC5 = 23;
|
||||
static const uint8_t ADC6 = 24; // D4
|
||||
static const uint8_t ADC7 = 25; // D6
|
||||
static const uint8_t ADC8 = 26; // D8
|
||||
static const uint8_t ADC9 = 27; // D9
|
||||
static const uint8_t ADC10 = 28; // D10
|
||||
static const uint8_t ADC11 = 29; // D12
|
||||
|
||||
#define digitalPinToPCICR(p) ((((p) >= 8 && (p) <= 11) || ((p) >= 14 && (p) <= 17) || ((p) >= A8 && (p) <= A10)) ? (&PCICR) : ((uint8_t *)0))
|
||||
#define digitalPinToPCICRbit(p) 0
|
||||
#define digitalPinToPCMSK(p) ((((p) >= 8 && (p) <= 11) || ((p) >= 14 && (p) <= 17) || ((p) >= A8 && (p) <= A10)) ? (&PCMSK0) : ((uint8_t *)0))
|
||||
#define digitalPinToPCMSKbit(p) (((p) >= 8 && (p) <= 11) ? (p)-4 : ((p) == 14 ? 3 : ((p) == 15 ? 1 : ((p) == 16 ? 2 : ((p) == 17 ? 0 : (p - A8 + 4))))))
|
||||
|
||||
// __AVR_ATmega32U4__ has an unusual mapping of pins to channels
|
||||
extern const uint8_t PROGMEM analog_pin_to_channel_PGM[];
|
||||
#define analogPinToChannel(P) (pgm_read_byte(analog_pin_to_channel_PGM + (P)))
|
||||
|
||||
#define digitalPinToInterrupt(p) ((p) == 0 ? 2 : ((p) == 1 ? 3 : ((p) == 2 ? 1 : ((p) == 3 ? 0 : ((p) == 7 ? 4 : NOT_AN_INTERRUPT)))))
|
||||
|
||||
#ifdef ARDUINO_MAIN
|
||||
|
||||
// On the Arduino board, digital pins are also used
|
||||
// for the analog output (software PWM). Analog input
|
||||
// pins are a separate set.
|
||||
|
||||
// ATMEL ATMEGA32U4 / ARDUINO LEONARDO
|
||||
//
|
||||
// D0 PD2 RXD1/INT2
|
||||
// D1 PD3 TXD1/INT3
|
||||
// D2 PD1 SDA SDA/INT1
|
||||
// D3# PD0 PWM8/SCL OC0B/SCL/INT0
|
||||
// D4 A6 PD4 ADC8
|
||||
// D5# PC6 ??? OC3A/#OC4A
|
||||
// D6# A7 PD7 FastPWM #OC4D/ADC10
|
||||
// D7 PE6 INT6/AIN0
|
||||
//
|
||||
// D8 A8 PB4 ADC11/PCINT4
|
||||
// D9# A9 PB5 PWM16 OC1A/#OC4B/ADC12/PCINT5
|
||||
// D10# A10 PB6 PWM16 OC1B/0c4B/ADC13/PCINT6
|
||||
// D11# PB7 PWM8/16 0C0A/OC1C/#RTS/PCINT7
|
||||
// D12 A11 PD6 T1/#OC4D/ADC9
|
||||
// D13# PC7 PWM10 CLK0/OC4A
|
||||
//
|
||||
// A0 D18 PF7 ADC7
|
||||
// A1 D19 PF6 ADC6
|
||||
// A2 D20 PF5 ADC5
|
||||
// A3 D21 PF4 ADC4
|
||||
// A4 D22 PF1 ADC1
|
||||
// A5 D23 PF0 ADC0
|
||||
//
|
||||
// New pins D14..D17 to map SPI port to digital pins
|
||||
//
|
||||
// MISO D14 PB3 MISO,PCINT3
|
||||
// SCK D15 PB1 SCK,PCINT1
|
||||
// MOSI D16 PB2 MOSI,PCINT2
|
||||
// SS D17 PB0 RXLED,SS/PCINT0
|
||||
//
|
||||
// Connected LEDs on board for TX and RX
|
||||
// TXLED D24 PD5 XCK1
|
||||
// RXLED D17 PB0
|
||||
// HWB PE2 HWB
|
||||
|
||||
// these arrays map port names (e.g. port B) to the
|
||||
// appropriate addresses for various functions (e.g. reading
|
||||
// and writing)
|
||||
const uint16_t PROGMEM port_to_mode_PGM[] = {
|
||||
NOT_A_PORT, NOT_A_PORT, (uint16_t)&DDRB, (uint16_t)&DDRC, (uint16_t)&DDRD, (uint16_t)&DDRE, (uint16_t)&DDRF,
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM port_to_output_PGM[] = {
|
||||
NOT_A_PORT, NOT_A_PORT, (uint16_t)&PORTB, (uint16_t)&PORTC, (uint16_t)&PORTD, (uint16_t)&PORTE, (uint16_t)&PORTF,
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM port_to_input_PGM[] = {
|
||||
NOT_A_PORT, NOT_A_PORT, (uint16_t)&PINB, (uint16_t)&PINC, (uint16_t)&PIND, (uint16_t)&PINE, (uint16_t)&PINF,
|
||||
};
|
||||
|
||||
const uint8_t PROGMEM digital_pin_to_port_PGM[] = {
|
||||
PD, // D0 - PD2
|
||||
PD, // D1 - PD3
|
||||
PD, // D2 - PD1
|
||||
PD, // D3 - PD0
|
||||
PD, // D4 - PD4
|
||||
PC, // D5 - PC6
|
||||
PD, // D6 - PD7
|
||||
PE, // D7 - PE6
|
||||
|
||||
PB, // D8 - PB4
|
||||
PB, // D9 - PB5
|
||||
PB, // D10 - PB6
|
||||
PB, // D11 - PB7
|
||||
PD, // D12 - PD6
|
||||
PC, // D13 - PC7
|
||||
|
||||
PB, // D14 - MISO - PB3
|
||||
PB, // D15 - SCK - PB1
|
||||
PB, // D16 - MOSI - PB2
|
||||
PB, // D17 - SS - PB0
|
||||
|
||||
PF, // D18 - A0 - PF7
|
||||
PF, // D19 - A1 - PF6
|
||||
PF, // D20 - A2 - PF5
|
||||
PF, // D21 - A3 - PF4
|
||||
PF, // D22 - A4 - PF1
|
||||
PF, // D23 - A5 - PF0
|
||||
|
||||
PD, // D24 - PD5
|
||||
PD, // D25 / D6 - A7 - PD7
|
||||
PB, // D26 / D8 - A8 - PB4
|
||||
PB, // D27 / D9 - A9 - PB5
|
||||
PB, // D28 / D10 - A10 - PB6
|
||||
PD, // D29 / D12 - A11 - PD6
|
||||
};
|
||||
|
||||
const uint8_t PROGMEM digital_pin_to_bit_mask_PGM[] = {
|
||||
_BV(2), // D0 - PD2
|
||||
_BV(3), // D1 - PD3
|
||||
_BV(1), // D2 - PD1
|
||||
_BV(0), // D3 - PD0
|
||||
_BV(4), // D4 - PD4
|
||||
_BV(6), // D5 - PC6
|
||||
_BV(7), // D6 - PD7
|
||||
_BV(6), // D7 - PE6
|
||||
|
||||
_BV(4), // D8 - PB4
|
||||
_BV(5), // D9 - PB5
|
||||
_BV(6), // D10 - PB6
|
||||
_BV(7), // D11 - PB7
|
||||
_BV(6), // D12 - PD6
|
||||
_BV(7), // D13 - PC7
|
||||
|
||||
_BV(3), // D14 - MISO - PB3
|
||||
_BV(1), // D15 - SCK - PB1
|
||||
_BV(2), // D16 - MOSI - PB2
|
||||
_BV(0), // D17 - SS - PB0
|
||||
|
||||
_BV(7), // D18 - A0 - PF7
|
||||
_BV(6), // D19 - A1 - PF6
|
||||
_BV(5), // D20 - A2 - PF5
|
||||
_BV(4), // D21 - A3 - PF4
|
||||
_BV(1), // D22 - A4 - PF1
|
||||
_BV(0), // D23 - A5 - PF0
|
||||
|
||||
_BV(5), // D24 - PD5
|
||||
_BV(7), // D25 / D6 - A7 - PD7
|
||||
_BV(4), // D26 / D8 - A8 - PB4
|
||||
_BV(5), // D27 / D9 - A9 - PB5
|
||||
_BV(6), // D28 / D10 - A10 - PB6
|
||||
_BV(6), // D29 / D12 - A11 - PD6
|
||||
};
|
||||
|
||||
const uint8_t PROGMEM digital_pin_to_timer_PGM[] = {
|
||||
NOT_ON_TIMER, NOT_ON_TIMER, NOT_ON_TIMER, TIMER0B, /* 3 */
|
||||
NOT_ON_TIMER, TIMER3A, /* 5 */
|
||||
TIMER4D, /* 6 */
|
||||
NOT_ON_TIMER,
|
||||
|
||||
NOT_ON_TIMER, TIMER1A, /* 9 */
|
||||
TIMER1B, /* 10 */
|
||||
TIMER0A, /* 11 */
|
||||
|
||||
NOT_ON_TIMER, TIMER4A, /* 13 */
|
||||
|
||||
NOT_ON_TIMER, NOT_ON_TIMER, NOT_ON_TIMER, NOT_ON_TIMER, NOT_ON_TIMER, NOT_ON_TIMER,
|
||||
|
||||
NOT_ON_TIMER, NOT_ON_TIMER, NOT_ON_TIMER, NOT_ON_TIMER, NOT_ON_TIMER, NOT_ON_TIMER, NOT_ON_TIMER, NOT_ON_TIMER, NOT_ON_TIMER, NOT_ON_TIMER,
|
||||
};
|
||||
|
||||
const uint8_t PROGMEM analog_pin_to_channel_PGM[] = {
|
||||
7, // A0 PF7 ADC7
|
||||
6, // A1 PF6 ADC6
|
||||
5, // A2 PF5 ADC5
|
||||
4, // A3 PF4 ADC4
|
||||
1, // A4 PF1 ADC1
|
||||
0, // A5 PF0 ADC0
|
||||
8, // A6 D4 PD4 ADC8
|
||||
10, // A7 D6 PD7 ADC10
|
||||
11, // A8 D8 PB4 ADC11
|
||||
12, // A9 D9 PB5 ADC12
|
||||
13, // A10 D10 PB6 ADC13
|
||||
9 // A11 D12 PD6 ADC9
|
||||
};
|
||||
|
||||
#endif /* ARDUINO_MAIN */
|
||||
|
||||
// These serial port names are intended to allow libraries and architecture-neutral
|
||||
// sketches to automatically default to the correct port name for a particular type
|
||||
// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN,
|
||||
// the first hardware serial port whose RX/TX pins are not dedicated to another use.
|
||||
//
|
||||
// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor
|
||||
//
|
||||
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
|
||||
//
|
||||
// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
|
||||
//
|
||||
// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins.
|
||||
//
|
||||
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
|
||||
// pins are NOT connected to anything by default.
|
||||
#define SERIAL_PORT_MONITOR Serial
|
||||
#define SERIAL_PORT_USBVIRTUAL Serial
|
||||
#define SERIAL_PORT_HARDWARE Serial1
|
||||
#define SERIAL_PORT_HARDWARE_OPEN Serial1
|
||||
|
||||
#endif /* Pins_Arduino_h */
|
@@ -108,6 +108,9 @@ bool oled_active = false;
|
||||
bool oled_scrolling = false;
|
||||
uint8_t oled_rotation = 0;
|
||||
uint8_t oled_rotation_width = 0;
|
||||
uint8_t oled_scroll_speed = 0; // this holds the speed after being remapped to ssd1306 internal values
|
||||
uint8_t oled_scroll_start = 0;
|
||||
uint8_t oled_scroll_end = 7;
|
||||
#if OLED_TIMEOUT > 0
|
||||
uint32_t oled_timeout;
|
||||
#endif
|
||||
@@ -515,12 +518,37 @@ bool oled_off(void) {
|
||||
return !oled_active;
|
||||
}
|
||||
|
||||
// Set the specific 8 lines rows of the screen to scroll.
|
||||
// 0 is the default for start, and 7 for end, which is the entire
|
||||
// height of the screen. For 128x32 screens, rows 4-7 are not used.
|
||||
void oled_scroll_set_area(uint8_t start_line, uint8_t end_line) {
|
||||
oled_scroll_start = start_line;
|
||||
oled_scroll_end = end_line;
|
||||
}
|
||||
|
||||
void oled_scroll_set_speed(uint8_t speed) {
|
||||
// Sets the speed for scrolling... does not take effect
|
||||
// until scrolling is either started or restarted
|
||||
// the ssd1306 supports 8 speeds
|
||||
// FrameRate2 speed = 7
|
||||
// FrameRate3 speed = 4
|
||||
// FrameRate4 speed = 5
|
||||
// FrameRate5 speed = 0
|
||||
// FrameRate25 speed = 6
|
||||
// FrameRate64 speed = 1
|
||||
// FrameRate128 speed = 2
|
||||
// FrameRate256 speed = 3
|
||||
// for ease of use these are remaped here to be in order
|
||||
static const uint8_t scroll_remap[8] = {7, 4, 5, 0, 6, 1, 2, 3};
|
||||
oled_scroll_speed = scroll_remap[speed];
|
||||
}
|
||||
|
||||
bool oled_scroll_right(void) {
|
||||
// Dont enable scrolling if we need to update the display
|
||||
// This prevents scrolling of bad data from starting the scroll too early after init
|
||||
if (!oled_dirty && !oled_scrolling) {
|
||||
static const uint8_t PROGMEM display_scroll_right[] = {I2C_CMD, SCROLL_RIGHT, 0x00, 0x00, 0x00, 0x0F, 0x00, 0xFF, ACTIVATE_SCROLL};
|
||||
if (I2C_TRANSMIT_P(display_scroll_right) != I2C_STATUS_SUCCESS) {
|
||||
uint8_t display_scroll_right[] = {I2C_CMD, SCROLL_RIGHT, 0x00, oled_scroll_start, oled_scroll_speed, oled_scroll_end, 0x00, 0xFF, ACTIVATE_SCROLL};
|
||||
if (I2C_TRANSMIT(display_scroll_right) != I2C_STATUS_SUCCESS) {
|
||||
print("oled_scroll_right cmd failed\n");
|
||||
return oled_scrolling;
|
||||
}
|
||||
@@ -533,8 +561,8 @@ bool oled_scroll_left(void) {
|
||||
// Dont enable scrolling if we need to update the display
|
||||
// This prevents scrolling of bad data from starting the scroll too early after init
|
||||
if (!oled_dirty && !oled_scrolling) {
|
||||
static const uint8_t PROGMEM display_scroll_left[] = {I2C_CMD, SCROLL_LEFT, 0x00, 0x00, 0x00, 0x0F, 0x00, 0xFF, ACTIVATE_SCROLL};
|
||||
if (I2C_TRANSMIT_P(display_scroll_left) != I2C_STATUS_SUCCESS) {
|
||||
uint8_t display_scroll_left[] = {I2C_CMD, SCROLL_LEFT, 0x00, oled_scroll_start, oled_scroll_speed, oled_scroll_end, 0x00, 0xFF, ACTIVATE_SCROLL};
|
||||
if (I2C_TRANSMIT(display_scroll_left) != I2C_STATUS_SUCCESS) {
|
||||
print("oled_scroll_left cmd failed\n");
|
||||
return oled_scrolling;
|
||||
}
|
||||
|
@@ -246,6 +246,18 @@ void oled_task(void);
|
||||
// Called at the start of oled_task, weak function overridable by the user
|
||||
void oled_task_user(void);
|
||||
|
||||
// Set the specific 8 lines rows of the screen to scroll.
|
||||
// 0 is the default for start, and 7 for end, which is the entire
|
||||
// height of the screen. For 128x32 screens, rows 4-7 are not used.
|
||||
void oled_scroll_set_area(uint8_t start_line, uint8_t end_line);
|
||||
|
||||
// Sets scroll speed, 0-7, fastest to slowest. Default is three.
|
||||
// Does not take effect until scrolling is either started or restarted
|
||||
// the ssd1306 supports 8 speeds with the delay
|
||||
// listed below betwen each frame of the scrolling effect
|
||||
// 0=2, 1=3, 2=4, 3=5, 4=25, 5=64, 6=128, 7=256
|
||||
void oled_scroll_set_speed(uint8_t speed);
|
||||
|
||||
// Scrolls the entire display right
|
||||
// Returns true if the screen was scrolling or starts scrolling
|
||||
// NOTE: display contents cannot be changed while scrolling
|
||||
|
@@ -30,7 +30,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#include "util.h"
|
||||
#include "matrix.h"
|
||||
#include "split_util.h"
|
||||
#include "pro_micro.h"
|
||||
#include "quantum.h"
|
||||
|
||||
#ifdef USE_MATRIX_I2C
|
||||
# include "i2c.h"
|
||||
@@ -102,9 +102,10 @@ void matrix_init(void)
|
||||
unselect_rows();
|
||||
init_cols();
|
||||
|
||||
TX_RX_LED_INIT;
|
||||
TXLED0;
|
||||
RXLED0;
|
||||
setPinOutput(B0);
|
||||
setPinOutput(D5);
|
||||
writePinHigh(B0);
|
||||
writePinHigh(D5);
|
||||
|
||||
// initialize matrix state: all keys off
|
||||
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
|
||||
@@ -189,10 +190,10 @@ int serial_transaction(int master_changed) {
|
||||
int ret=serial_update_buffers();
|
||||
#endif
|
||||
if (ret ) {
|
||||
if(ret==2) RXLED1;
|
||||
if(ret==2) writePinLow(B0);
|
||||
return 1;
|
||||
}
|
||||
RXLED0;
|
||||
writePinHigh(B0);
|
||||
memcpy(&matrix[slaveOffset],
|
||||
(void *)serial_slave_buffer, SERIAL_SLAVE_BUFFER_LENGTH);
|
||||
return 0;
|
||||
@@ -241,7 +242,7 @@ uint8_t matrix_master_scan(void) {
|
||||
if( serial_transaction(mchanged) ) {
|
||||
#endif
|
||||
// turn on the indicator led when halves are disconnected
|
||||
TXLED1;
|
||||
writePinLow(D5);
|
||||
|
||||
error_count++;
|
||||
|
||||
@@ -254,7 +255,7 @@ uint8_t matrix_master_scan(void) {
|
||||
}
|
||||
} else {
|
||||
// turn off the indicator led on no error
|
||||
TXLED0;
|
||||
writePinHigh(D5);
|
||||
error_count = 0;
|
||||
}
|
||||
matrix_scan_quantum();
|
||||
|
@@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#pragma once
|
||||
|
||||
#define TAPPING_TERM 300
|
||||
#define TAPPING_TERM 200
|
||||
|
||||
#define MASTER_LEFT
|
||||
|
||||
|
@@ -30,7 +30,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#include "util.h"
|
||||
#include "matrix.h"
|
||||
#include "split_util.h"
|
||||
#include "pro_micro.h"
|
||||
#include "quantum.h"
|
||||
|
||||
#ifdef USE_MATRIX_I2C
|
||||
# include "i2c.h"
|
||||
@@ -96,37 +96,38 @@ uint8_t matrix_cols(void)
|
||||
void tx_rx_leds_init(void)
|
||||
{
|
||||
#ifndef NO_DEBUG_LEDS
|
||||
TX_RX_LED_INIT;
|
||||
TXLED0;
|
||||
RXLED0;
|
||||
setPinOutput(B0);
|
||||
setPinOutput(D5);
|
||||
writePinHigh(B0);
|
||||
writePinHigh(D5);
|
||||
#endif
|
||||
}
|
||||
|
||||
void tx_led_on(void)
|
||||
{
|
||||
#ifndef NO_DEBUG_LEDS
|
||||
TXLED1;
|
||||
writePinLow(D5);
|
||||
#endif
|
||||
}
|
||||
|
||||
void tx_led_off(void)
|
||||
{
|
||||
#ifndef NO_DEBUG_LEDS
|
||||
TXLED0;
|
||||
writePinHigh(D5);
|
||||
#endif
|
||||
}
|
||||
|
||||
void rx_led_on(void)
|
||||
{
|
||||
#ifndef NO_DEBUG_LEDS
|
||||
RXLED1;
|
||||
writePinLow(B0);
|
||||
#endif
|
||||
}
|
||||
|
||||
void rx_led_off(void)
|
||||
{
|
||||
#ifndef NO_DEBUG_LEDS
|
||||
RXLED0;
|
||||
writePinHigh(B0);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@@ -3,8 +3,8 @@
|
||||
#include "config_common.h"
|
||||
|
||||
/* USB Device descriptor parameter */
|
||||
#define VENDOR_ID 0xFEED
|
||||
#define PRODUCT_ID 0xD070
|
||||
#define VENDOR_ID 0x4250 // BP for Backprop
|
||||
#define PRODUCT_ID 0x4D4C // ML for Multi
|
||||
#define DEVICE_VER 0x0001
|
||||
#define MANUFACTURER Backprop Studio
|
||||
#define PRODUCT Doro67 Multi PCB
|
||||
|
76
keyboards/doro67/multi/keymaps/via/keymap.c
Normal file
76
keyboards/doro67/multi/keymaps/via/keymap.c
Normal file
@@ -0,0 +1,76 @@
|
||||
/* Copyright 2019 ShadeDream
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/* Default layer
|
||||
* ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┬───┐
|
||||
* │Esc│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │Bspace │Ins│
|
||||
* ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┼───┤
|
||||
* │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │Del│
|
||||
* ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤
|
||||
* │ Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ Enter │PgU│
|
||||
* ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤
|
||||
* │ LShift │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │RShift│ ↑ │PgD│
|
||||
* ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬─┬───┼───┼───┤
|
||||
* │LCtl│LGui│LAlt│ Space │RAlt│ Fn │ │ ← │ ↓ │ → │
|
||||
* └────┴────┴────┴────────────────────────┴────┴────┘ └───┴───┴───┘
|
||||
*/
|
||||
[0] = LAYOUT_65_ansi_blocker(
|
||||
KC_ESC, 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_BSPC, KC_INS,
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL,
|
||||
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP,
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN,
|
||||
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT
|
||||
),
|
||||
|
||||
/* Fn layer
|
||||
* ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┬───┐
|
||||
* │ ` │F1 │F2 │F3 │F4 │F5 │F6 │F7 │F8 │F9 │F10│F11│F12│ │ │
|
||||
* ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┼───┤
|
||||
* │BLTog│BLS│BL-│BL+│Rst│ │ │ │ │ │ │ │ │ │ │
|
||||
* ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤
|
||||
* │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
|
||||
* ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤
|
||||
* │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
|
||||
* ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬─┬───┼───┼───┤
|
||||
* │ │ │ │ │ │ │ │ │ │ │
|
||||
* └────┴────┴────┴────────────────────────┴────┴────┘ └───┴───┴───┘
|
||||
*/
|
||||
[1] = LAYOUT_65_ansi_blocker(
|
||||
KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______,
|
||||
BL_TOGG, BL_STEP, BL_DEC, BL_INC, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
),
|
||||
|
||||
[2] = LAYOUT_65_ansi_blocker(
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
),
|
||||
|
||||
[3] = LAYOUT_65_ansi_blocker(
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
),
|
||||
};
|
43
keyboards/doro67/multi/keymaps/via/readme.md
Normal file
43
keyboards/doro67/multi/keymaps/via/readme.md
Normal file
@@ -0,0 +1,43 @@
|
||||
# Default Doro67 ANSI layout.
|
||||
|
||||
**THIS IS THE DEFAULT ANSI KEYMAP (AVAILABILITY: CHINA + INTERNATIONAL GB)**
|
||||
The "multi" directory includes keymaps for the multi-layout PCB, which supports ANSI, ISO, and multi (split backspace & non-blocker).
|
||||
The keymap you choose from the "multi" directory must correspond to the integrated plate option you chose.
|
||||
|
||||
The multi-layout PCB and RGB pcb were the only two options available to NON-china buyers.
|
||||
If you purchased an RGB PCB, please see the 'rgb' directory.
|
||||
|
||||
This is the default ANSI layout that comes flashed on the Doro67 multi PCB with
|
||||
the exception of adding backtick as it was not mapped.
|
||||
|
||||
Default layer:
|
||||
|
||||
```
|
||||
┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┬───┐
|
||||
│Esc│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │Bspace │Ins│
|
||||
├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┼───┤
|
||||
│ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │Del│
|
||||
├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤
|
||||
│ Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ Enter │PgU│
|
||||
├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤
|
||||
│ LShift │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │RShift│ ↑ │PgD│
|
||||
├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬─┬───┼───┼───┤
|
||||
│LCtl│LGui│LAlt│ Space │RAlt│ Fn │ │ ← │ ↓ │ → │
|
||||
└────┴────┴────┴────────────────────────┴────┴────┘ └───┴───┴───┘
|
||||
```
|
||||
|
||||
Fn layer:
|
||||
|
||||
```
|
||||
┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┬───┐
|
||||
│ ` │F1 │F2 │F3 │F4 │F5 │F6 │F7 │F8 │F9 │F10│F11│F12│ │ │
|
||||
├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┼───┤
|
||||
│BLTog│BLS│BL-│BL+│Rst│ │ │ │ │ │ │ │ │ │ │
|
||||
├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤
|
||||
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │
|
||||
├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤
|
||||
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │
|
||||
├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬─┬───┼───┼───┤
|
||||
│ │ │ │ │ │ │ │ │ │ │
|
||||
└────┴────┴────┴────────────────────────┴────┴────┘ └───┴───┴───┘
|
||||
```
|
2
keyboards/doro67/multi/keymaps/via/rules.mk
Normal file
2
keyboards/doro67/multi/keymaps/via/rules.mk
Normal file
@@ -0,0 +1,2 @@
|
||||
VIA_ENABLE = yes
|
||||
LTO_ENABLE = yes
|
@@ -3,8 +3,8 @@
|
||||
#include "config_common.h"
|
||||
|
||||
/* USB Device descriptor parameter */
|
||||
#define VENDOR_ID 0xFEED
|
||||
#define PRODUCT_ID 0x0000
|
||||
#define VENDOR_ID 0x4250 // BP for Backprop
|
||||
#define PRODUCT_ID 0x5245 // RE for Regular
|
||||
#define DEVICE_VER 0x0001
|
||||
#define MANUFACTURER Backprop Studio
|
||||
#define PRODUCT Doro67 Regular PCB
|
||||
@@ -28,4 +28,3 @@
|
||||
#define MATRIX_COL_PINS { B0, B1, B2, B3, D4, D6, D7, B4, B5, B6, C6, C7, F5, F6, F7 }
|
||||
|
||||
#define DIODE_DIRECTION COL2ROW
|
||||
|
||||
|
76
keyboards/doro67/regular/keymaps/via/keymap.c
Normal file
76
keyboards/doro67/regular/keymaps/via/keymap.c
Normal file
@@ -0,0 +1,76 @@
|
||||
/* Copyright 2019 MechMerlin
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/* Default layer
|
||||
* ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┬───┐
|
||||
* │Esc│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │Bspace │Ins│
|
||||
* ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┼───┤
|
||||
* │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │Del│
|
||||
* ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤
|
||||
* │ Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ Enter │PgU│
|
||||
* ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤
|
||||
* │ LShift │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │RShift│ ↑ │PgD│
|
||||
* ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬─┬───┼───┼───┤
|
||||
* │LCtl│LGui│LAlt│ Space │RAlt│ Fn │ │ ← │ ↓ │ → │
|
||||
* └────┴────┴────┴────────────────────────┴────┴────┘ └───┴───┴───┘
|
||||
*/
|
||||
[0] = LAYOUT_65_ansi_blocker(
|
||||
KC_ESC, 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_BSPC, KC_INS,
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL,
|
||||
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP,
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN,
|
||||
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT
|
||||
),
|
||||
|
||||
/* Fn layer
|
||||
* ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┬───┐
|
||||
* │ ` │F1 │F2 │F3 │F4 │F5 │F6 │F7 │F8 │F9 │F10│F11│F12│ │ │
|
||||
* ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┼───┤
|
||||
* │ │ │ │ │Rst│ │ │ │ │ │ │ │ │ │ │
|
||||
* ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤
|
||||
* │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
|
||||
* ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤
|
||||
* │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
|
||||
* ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬─┬───┼───┼───┤
|
||||
* │ │ │ │ │ │ │ │ │ │ │
|
||||
* └────┴────┴────┴────────────────────────┴────┴────┘ └───┴───┴───┘
|
||||
*/
|
||||
[1] = LAYOUT_65_ansi_blocker(
|
||||
KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______,
|
||||
_______, _______, _______, _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
),
|
||||
|
||||
[2] = LAYOUT_65_ansi_blocker(
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
),
|
||||
|
||||
[3] = LAYOUT_65_ansi_blocker(
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
),
|
||||
};
|
5
keyboards/doro67/regular/keymaps/via/readme.md
Normal file
5
keyboards/doro67/regular/keymaps/via/readme.md
Normal file
@@ -0,0 +1,5 @@
|
||||
# The default keymap for doro67
|
||||
|
||||
**THIS IS THE DEFAULT KEYMAP DIRECTORY (AVAILABILITY: CHINA GB ONLY)**
|
||||
If you are a non-china buyer, you probably have the multi PCB or rgb PCB.
|
||||
Please look at the "multi" and "rgb" readme files.
|
2
keyboards/doro67/regular/keymaps/via/rules.mk
Normal file
2
keyboards/doro67/regular/keymaps/via/rules.mk
Normal file
@@ -0,0 +1,2 @@
|
||||
VIA_ENABLE = yes
|
||||
LTO_ENABLE = yes
|
@@ -20,8 +20,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#include "config_common.h"
|
||||
|
||||
/* USB Device descriptor parameter */
|
||||
#define VENDOR_ID 0xFEED
|
||||
#define PRODUCT_ID 0x0000
|
||||
#define VENDOR_ID 0x4250 // BP for Backprop
|
||||
#define PRODUCT_ID 0x5247 // RG for RGB
|
||||
#define DEVICE_VER 0x0001
|
||||
#define MANUFACTURER Backprop Studio
|
||||
#define PRODUCT Doro67 RGB PCB
|
||||
|
77
keyboards/doro67/rgb/keymaps/via/keymap.c
Normal file
77
keyboards/doro67/rgb/keymaps/via/keymap.c
Normal file
@@ -0,0 +1,77 @@
|
||||
/* Copyright 2019 MechMerlin
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/* Default layer
|
||||
* ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┬───┐
|
||||
* │Esc│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │Bspace │Ins│
|
||||
* ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┼───┤
|
||||
* │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │Del│
|
||||
* ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤
|
||||
* │ Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ Enter │PgU│
|
||||
* ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤
|
||||
* │ LShift │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │RShift│ ↑ │PgD│
|
||||
* ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬─┬───┼───┼───┤
|
||||
* │LCtl│LGui│LAlt│ Space │RAlt│ Fn │ │ ← │ ↓ │ → │
|
||||
* └────┴────┴────┴────────────────────────┴────┴────┘ └───┴───┴───┘
|
||||
*/
|
||||
[0] = LAYOUT_65_ansi_blocker(
|
||||
KC_ESC, 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_BSPC, KC_INS,
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL,
|
||||
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP,
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN,
|
||||
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT
|
||||
),
|
||||
|
||||
/* Fn layer
|
||||
* ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┬───┐
|
||||
* │ ` │F1 │F2 │F3 │F4 │F5 │F6 │F7 │F8 │F9 │F10│F11│F12│ │ │
|
||||
* ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┼───┤
|
||||
* │BEST │URL│ │ │Rst│ │ │ │ │ │ │ │ │ │ │
|
||||
* ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤
|
||||
* │ RGB │Mo+│Hu+│Sa+│Va+│Sp+│ │ │ │ │ │ │ │ │
|
||||
* ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤
|
||||
* │ │Mo-│Hu-│Sa-│Va-│Sp-│ │ │ │ │ │ │ │ │
|
||||
* ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬─┬───┼───┼───┤
|
||||
* │ │ │ │ │ │ │ │ │ │ │
|
||||
* └────┴────┴────┴────────────────────────┴────┴────┘ └───┴───┴───┘
|
||||
*/
|
||||
[1] = LAYOUT_65_ansi_blocker(
|
||||
KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______,
|
||||
_______, _______, _______, _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, RGB_RMOD,RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
),
|
||||
|
||||
[2] = LAYOUT_65_ansi_blocker(
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
),
|
||||
|
||||
[3] = LAYOUT_65_ansi_blocker(
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
),
|
||||
};
|
||||
|
7
keyboards/doro67/rgb/keymaps/via/readme.md
Normal file
7
keyboards/doro67/rgb/keymaps/via/readme.md
Normal file
@@ -0,0 +1,7 @@
|
||||
# The default keymap for rgb
|
||||
|
||||
**RGB PCB (AVAILABILITY: CHINA + INTERNATIONAL GB)**
|
||||
The "rgb" directory includes the keymap for the RGB PCB.
|
||||
|
||||
The multi-layout PCB and RGB pcb were the only two options available to NON-china buyers.
|
||||
If you purchased a non-rgb PCB, please see the 'multi' directory.
|
2
keyboards/doro67/rgb/keymaps/via/rules.mk
Normal file
2
keyboards/doro67/rgb/keymaps/via/rules.mk
Normal file
@@ -0,0 +1,2 @@
|
||||
VIA_ENABLE = yes
|
||||
LTO_ENABLE = yes
|
@@ -29,24 +29,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#include "util.h"
|
||||
#include "matrix.h"
|
||||
#include "split_util.h"
|
||||
#include "quantum.h"
|
||||
|
||||
#include "serial.h"
|
||||
|
||||
// from pro_micro.h
|
||||
#define TX_RX_LED_INIT DDRD |= (1<<5), DDRB |= (1<<0)
|
||||
|
||||
#ifndef DISABLE_PROMICRO_LEDs
|
||||
#define TXLED0 PORTD |= (1<<5)
|
||||
#define TXLED1 PORTD &= ~(1<<5)
|
||||
#define RXLED0 PORTB |= (1<<0)
|
||||
#define RXLED1 PORTB &= ~(1<<0)
|
||||
#else
|
||||
#define TXLED0
|
||||
#define TXLED1
|
||||
#define RXLED0
|
||||
#define RXLED1
|
||||
#endif
|
||||
|
||||
#ifndef DEBOUNCE
|
||||
# define DEBOUNCE 5
|
||||
#endif
|
||||
@@ -108,11 +94,12 @@ void matrix_init(void) {
|
||||
unselect_rows();
|
||||
init_cols();
|
||||
|
||||
TX_RX_LED_INIT;
|
||||
setPinOutput(B0);
|
||||
setPinOutput(D5);
|
||||
|
||||
#ifdef DISABLE_PROMICRO_LEDs
|
||||
PORTD |= (1<<5);
|
||||
PORTB |= (1<<0);
|
||||
writePinHigh(B0);
|
||||
writePinHigh(D5);
|
||||
#endif
|
||||
|
||||
// initialize matrix state: all keys off
|
||||
@@ -158,10 +145,14 @@ int serial_transaction(void) {
|
||||
int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0;
|
||||
int ret=serial_update_buffers();
|
||||
if (ret ) {
|
||||
if(ret==2)RXLED1;
|
||||
#ifndef DISABLE_PROMICRO_LEDs
|
||||
if(ret==2) writePinLow(B0);
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
RXLED0;
|
||||
#ifndef DISABLE_PROMICRO_LEDs
|
||||
writePinHigh(B0);
|
||||
#endif
|
||||
for (int i = 0; i < ROWS_PER_HAND; ++i) {
|
||||
matrix[slaveOffset+i] = serial_slave_buffer[i];
|
||||
}
|
||||
@@ -197,8 +188,10 @@ uint8_t matrix_master_scan(void) {
|
||||
}
|
||||
|
||||
if( serial_transaction() ) {
|
||||
#ifndef DISABLE_PROMICRO_LEDs
|
||||
// turn on the indicator led when halves are disconnected
|
||||
TXLED1;
|
||||
writePinLow(D5);
|
||||
#endif
|
||||
|
||||
error_count++;
|
||||
|
||||
@@ -210,8 +203,10 @@ uint8_t matrix_master_scan(void) {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
#ifndef DISABLE_PROMICRO_LEDs
|
||||
// turn off the indicator led on no error
|
||||
TXLED0;
|
||||
writePinHigh(D5);
|
||||
#endif
|
||||
error_count = 0;
|
||||
}
|
||||
matrix_scan_quantum();
|
||||
|
@@ -29,8 +29,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#include "util.h"
|
||||
#include "matrix.h"
|
||||
#include "split_util.h"
|
||||
#include "pro_micro.h"
|
||||
#include "config.h"
|
||||
#include "quantum.h"
|
||||
|
||||
#ifdef USE_I2C
|
||||
# include "i2c.h"
|
||||
@@ -100,7 +100,8 @@ void matrix_init(void)
|
||||
unselect_rows();
|
||||
init_cols();
|
||||
|
||||
TX_RX_LED_INIT;
|
||||
setPinOutput(B0);
|
||||
setPinOutput(D5);
|
||||
|
||||
// initialize matrix state: all keys off
|
||||
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
|
||||
@@ -201,7 +202,7 @@ uint8_t matrix_scan(void)
|
||||
if( serial_transaction() ) {
|
||||
#endif
|
||||
// turn on the indicator led when halves are disconnected
|
||||
TXLED1;
|
||||
writePinLow(D5);
|
||||
|
||||
error_count++;
|
||||
|
||||
@@ -214,7 +215,7 @@ uint8_t matrix_scan(void)
|
||||
}
|
||||
} else {
|
||||
// turn off the indicator led on no error
|
||||
TXLED0;
|
||||
writePinHigh(D5);
|
||||
error_count = 0;
|
||||
}
|
||||
matrix_scan_quantum();
|
||||
|
@@ -29,7 +29,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#include "util.h"
|
||||
#include "matrix.h"
|
||||
#include "split_util.h"
|
||||
#include "pro_micro.h"
|
||||
#include "quantum.h"
|
||||
|
||||
#ifdef USE_MATRIX_I2C
|
||||
# include "i2c.h"
|
||||
@@ -99,9 +99,10 @@ void matrix_init(void)
|
||||
unselect_rows();
|
||||
init_cols();
|
||||
|
||||
TX_RX_LED_INIT;
|
||||
TXLED0;
|
||||
RXLED0;
|
||||
setPinOutput(B0);
|
||||
setPinOutput(D5);
|
||||
writePinHigh(B0);
|
||||
writePinHigh(D5);
|
||||
|
||||
// initialize matrix state: all keys off
|
||||
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
|
||||
@@ -180,10 +181,10 @@ int serial_transaction(void) {
|
||||
int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0;
|
||||
int ret=serial_update_buffers();
|
||||
if (ret ) {
|
||||
if(ret==2)RXLED1;
|
||||
if(ret==2) writePinLow(B0);
|
||||
return 1;
|
||||
}
|
||||
RXLED0;
|
||||
writePinHigh(B0);
|
||||
for (int i = 0; i < ROWS_PER_HAND; ++i) {
|
||||
matrix[slaveOffset+i] = serial_slave_buffer[i];
|
||||
}
|
||||
@@ -235,7 +236,7 @@ uint8_t matrix_master_scan(void) {
|
||||
if( serial_transaction() ) {
|
||||
#endif
|
||||
// turn on the indicator led when halves are disconnected
|
||||
TXLED1;
|
||||
writePinLow(D5);
|
||||
|
||||
error_count++;
|
||||
|
||||
@@ -248,7 +249,7 @@ uint8_t matrix_master_scan(void) {
|
||||
}
|
||||
} else {
|
||||
// turn off the indicator led on no error
|
||||
TXLED0;
|
||||
writePinHigh(D5);
|
||||
error_count = 0;
|
||||
}
|
||||
matrix_scan_quantum();
|
||||
|
@@ -29,8 +29,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#include "util.h"
|
||||
#include "matrix.h"
|
||||
#include "split_util.h"
|
||||
#include "pro_micro.h"
|
||||
#include "config.h"
|
||||
#include "quantum.h"
|
||||
|
||||
#ifdef USE_MATRIX_I2C
|
||||
# include "i2c.h"
|
||||
@@ -100,7 +100,8 @@ void matrix_init(void)
|
||||
unselect_rows();
|
||||
init_cols();
|
||||
|
||||
TX_RX_LED_INIT;
|
||||
setPinOutput(B0);
|
||||
setPinOutput(D5);
|
||||
|
||||
// initialize matrix state: all keys off
|
||||
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
|
||||
@@ -201,7 +202,7 @@ uint8_t matrix_scan(void)
|
||||
if( serial_transaction() ) {
|
||||
#endif
|
||||
// turn on the indicator led when halves are disconnected
|
||||
TXLED1;
|
||||
writePinLow(D5);
|
||||
|
||||
error_count++;
|
||||
|
||||
@@ -214,7 +215,7 @@ uint8_t matrix_scan(void)
|
||||
}
|
||||
} else {
|
||||
// turn off the indicator led on no error
|
||||
TXLED0;
|
||||
writePinHigh(D5);
|
||||
error_count = 0;
|
||||
}
|
||||
matrix_scan_quantum();
|
||||
|
@@ -30,7 +30,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#include "util.h"
|
||||
#include "matrix.h"
|
||||
#include "split_util.h"
|
||||
#include "pro_micro.h"
|
||||
#include "quantum.h"
|
||||
|
||||
#ifdef USE_MATRIX_I2C
|
||||
# include "i2c.h"
|
||||
@@ -100,9 +100,10 @@ void matrix_init(void)
|
||||
unselect_rows();
|
||||
init_cols();
|
||||
|
||||
TX_RX_LED_INIT;
|
||||
TXLED0;
|
||||
RXLED0;
|
||||
setPinOutput(B0);
|
||||
setPinOutput(D5);
|
||||
writePinHigh(B0);
|
||||
writePinHigh(D5);
|
||||
|
||||
// initialize matrix state: all keys off
|
||||
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
|
||||
@@ -185,10 +186,10 @@ int serial_transaction(int master_changed) {
|
||||
int ret=serial_update_buffers();
|
||||
#endif
|
||||
if (ret ) {
|
||||
if(ret==2) RXLED1;
|
||||
if(ret==2) writePinLow(B0);
|
||||
return 1;
|
||||
}
|
||||
RXLED0;
|
||||
writePinHigh(B0);
|
||||
memcpy(&matrix[slaveOffset],
|
||||
(void *)serial_slave_buffer, sizeof(serial_slave_buffer));
|
||||
return 0;
|
||||
@@ -239,7 +240,7 @@ uint8_t matrix_master_scan(void) {
|
||||
if( serial_transaction(mchanged) ) {
|
||||
#endif
|
||||
// turn on the indicator led when halves are disconnected
|
||||
TXLED1;
|
||||
writePinLow(D5);
|
||||
|
||||
error_count++;
|
||||
|
||||
@@ -252,7 +253,7 @@ uint8_t matrix_master_scan(void) {
|
||||
}
|
||||
} else {
|
||||
// turn off the indicator led on no error
|
||||
TXLED0;
|
||||
writePinHigh(D5);
|
||||
error_count = 0;
|
||||
}
|
||||
matrix_scan_quantum();
|
||||
|
@@ -9,7 +9,7 @@ MCU = atmega32u4
|
||||
# QMK DFU qmk-dfu
|
||||
# ATmega32A bootloadHID
|
||||
# ATmega328P USBasp
|
||||
BOOTLOADER = atmel-dfu
|
||||
BOOTLOADER = caterina
|
||||
|
||||
# Build Options
|
||||
# change yes to no to disable
|
||||
|
@@ -16,7 +16,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#define TAPPING_TERM 300
|
||||
#define TAPPING_TERM 200
|
||||
|
||||
#ifdef OLED_DRIVER_ENABLE
|
||||
#define OLED_DISPLAY_128X64
|
||||
|
@@ -1,84 +0,0 @@
|
||||
/* Copyright 2020 ninjonas
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include "ninjonas.h"
|
||||
|
||||
#ifdef ENCODER_ENABLE
|
||||
void encoder_update_user(uint8_t index, bool clockwise) {
|
||||
if (index == 0) {
|
||||
switch (get_highest_layer(layer_state)) {
|
||||
case _LOWER:
|
||||
if (clockwise) {
|
||||
tap_code16(SGUI(KC_TAB));
|
||||
} else {
|
||||
tap_code16(LGUI(KC_TAB));
|
||||
}
|
||||
break;
|
||||
case _RAISE:
|
||||
if (clockwise) {
|
||||
tap_code(KC_PGUP);
|
||||
} else {
|
||||
tap_code(KC_PGDN);
|
||||
}
|
||||
break;
|
||||
case _ADJUST:
|
||||
if (clockwise) {
|
||||
rgblight_increase_hue();
|
||||
} else {
|
||||
rgblight_decrease_hue();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (clockwise) {
|
||||
tap_code(KC_BRIU);
|
||||
} else {
|
||||
tap_code(KC_BRID);
|
||||
}
|
||||
break;
|
||||
}
|
||||
} else if (index == 1) {
|
||||
switch (get_highest_layer(layer_state)) {
|
||||
case _LOWER:
|
||||
if (clockwise) {
|
||||
tap_code(KC_UP);
|
||||
} else {
|
||||
tap_code(KC_DOWN);
|
||||
}
|
||||
break;
|
||||
case _RAISE:
|
||||
if (clockwise) {
|
||||
tap_code16(LCTL(KC_TAB));
|
||||
} else {
|
||||
tap_code16(LCTL(LSFT(KC_TAB)));
|
||||
}
|
||||
break;
|
||||
case _ADJUST:
|
||||
if (clockwise) {
|
||||
rgblight_increase_val();
|
||||
} else {
|
||||
rgblight_decrease_val();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (clockwise) {
|
||||
tap_code(KC_VOLU);
|
||||
} else {
|
||||
tap_code(KC_VOLD);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
@@ -24,7 +24,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
// |--------+-----——-+——------+-——-----+——------+——-----| |------—+——------+——------+——------+——------+--------|
|
||||
_____________________QWERTY_L2______________________, _____________________QWERTY_R2______________________,
|
||||
// |--------+-----——-+——------+-——-----+——------+——-----+———-----------. ,——————————————+------—+——------+——------+——------+——------+--------|
|
||||
_____________________QWERTY_L3______________________,XXXXXXX,KC_LALT, T_CPNU,XXXXXXX,_____________________QWERTY_R3______________________,
|
||||
_____________________QWERTY_L3______________________,XXXXXXX,KC_LALT, T_CPAP,XXXXXXX,_____________________QWERTY_R3______________________,
|
||||
// `--------------------------+--------+--------+-------+-------+------| |------+-------+-------+--------+--------+--------+--------+--------'
|
||||
_____________MOD_LEFT_____________,T_LBRC, T_RBRC,________MOD_RIGHT________,KC_MUTE
|
||||
// `----------------------------------------' `----------------------------------------'
|
||||
@@ -36,7 +36,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
// |--------+-----——-+——------+-——-----+——------+——-----| |------—+——------+——------+——------+——------+--------|
|
||||
_____________________DVORAK_L2______________________, _____________________DVORAK_R2______________________,
|
||||
// |--------+-----——-+——------+-——-----+——------+——-----+———-----------. ,——————————————+------—+——------+——------+——------+——------+--------|
|
||||
_____________________DVORAK_L3______________________,XXXXXXX,KC_LALT, T_CPNU,XXXXXXX,_____________________DVORAK_R3______________________,
|
||||
_____________________DVORAK_L3______________________,XXXXXXX,KC_LALT, T_CPAP,XXXXXXX,_____________________DVORAK_R3______________________,
|
||||
// `--------------------------+--------+--------+-------+-------+------| |------+-------+-------+--------+--------+--------+--------+--------'
|
||||
_____________MOD_LEFT_____________,T_LBRC, T_RBRC,________MOD_RIGHT________,KC_MUTE
|
||||
// `----------------------------------------' `----------------------------------------'
|
||||
@@ -48,7 +48,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
// |--------+-----——-+——------+-——-----+——------+——-----| |------—+——------+——------+——------+——------+--------|
|
||||
_____________________COLEMAK_L2_____________________, _____________________COLEMAK_R2_____________________,
|
||||
// |--------+-----——-+——------+-——-----+——------+——-----+———-----------. ,——————————————+------—+——------+——------+——------+——------+--------|
|
||||
_____________________COLEMAK_L3_____________________,XXXXXXX,KC_LALT, T_CPNU,XXXXXXX,_____________________COLEMAK_R3_____________________,
|
||||
_____________________COLEMAK_L3_____________________,XXXXXXX,KC_LALT, T_CPAP,XXXXXXX,_____________________COLEMAK_R3_____________________,
|
||||
// `--------------------------+--------+--------+-------+-------+------| |------+-------+-------+--------+--------+--------+--------+--------'
|
||||
_____________MOD_LEFT_____________,T_LBRC, T_RBRC,________MOD_RIGHT________,KC_MUTE
|
||||
// `----------------------------------------' `----------------------------------------'
|
||||
|
@@ -105,8 +105,12 @@ void oled_white_space(void){
|
||||
oled_write_P(PSTR(" "), false);
|
||||
}
|
||||
|
||||
void oled_slash_separator(void){
|
||||
oled_write_P(PSTR(" / "), false);
|
||||
}
|
||||
|
||||
void render_layout_state(void) {
|
||||
oled_write_P(PSTR("\nLayout: "), false);
|
||||
oled_write_P(PSTR("Layout: "), false);
|
||||
switch (biton32(default_layer_state)) {
|
||||
case _COLEMAK:
|
||||
oled_write_P(PSTR("Colemak"), false);
|
||||
@@ -121,6 +125,37 @@ void render_layout_state(void) {
|
||||
oled_write_ln_P(PSTR("Undefined"), false);
|
||||
}
|
||||
}
|
||||
#ifdef ENCODER_ENABLE
|
||||
static void render_encoder_state(void) {
|
||||
oled_write_P(PSTR("\nEnc: "), false);
|
||||
bool lower = layer_state_is(_LOWER) & !layer_state_is(_ADJUST);
|
||||
bool raise = layer_state_is(_RAISE) & !layer_state_is(_ADJUST);
|
||||
bool adjust = layer_state_is(_ADJUST);
|
||||
|
||||
if(lower){
|
||||
oled_write_P(PSTR("APPSW"), left_encoder_rotated);
|
||||
oled_slash_separator();
|
||||
oled_write_P(PSTR("UPDN"), right_encoder_rotated);
|
||||
} else if(raise){
|
||||
oled_write_P(PSTR("PGUD"), left_encoder_rotated);
|
||||
oled_slash_separator();
|
||||
oled_write_P(PSTR("TABSW"), right_encoder_rotated);
|
||||
} else if(adjust){
|
||||
oled_write_P(PSTR("RHUE"), left_encoder_rotated);
|
||||
oled_slash_separator();
|
||||
oled_write_P(PSTR("RBRI"), right_encoder_rotated);
|
||||
} else {
|
||||
oled_write_P(PSTR("BRI"), left_encoder_rotated);
|
||||
oled_slash_separator();
|
||||
oled_write_P(PSTR("VOL"), right_encoder_rotated);
|
||||
}
|
||||
|
||||
if (timer_elapsed(encoder_rotated_timer) > 200) {
|
||||
left_encoder_rotated = false;
|
||||
right_encoder_rotated = false;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static void render_layer_state(void) {
|
||||
oled_write_P(PSTR("\nLayer:"), false);
|
||||
@@ -156,6 +191,9 @@ void render_mod_state(uint8_t modifiers) {
|
||||
static void render_status(void) {
|
||||
render_qmk_logo();
|
||||
render_layout_state();
|
||||
#ifdef ENCODER_ENABLE
|
||||
render_encoder_state();
|
||||
#endif
|
||||
render_layer_state();
|
||||
render_mod_state(get_mods()|get_oneshot_mods());
|
||||
}
|
||||
|
@@ -3,5 +3,4 @@ ENCODER_ENABLE = yes # Enables the use of one or more encoders
|
||||
RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
|
||||
LINK_TIME_OPTIMIZATION_ENABLE = yes
|
||||
|
||||
SRC += encoder.c \
|
||||
oled.c
|
||||
SRC += oled.c
|
@@ -125,7 +125,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
XXXXXXX, XXXXXXX, _____________MOUSE_1______________, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||
XXXXXXX, XXXXXXX, _____________MOUSE_2______________, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||
__________________________________, __________________________________
|
||||
__________________________________, _______, _______, _______, K_CPRF
|
||||
),
|
||||
|
||||
/* ADJUST
|
||||
|
@@ -1 +1,2 @@
|
||||
OLED_DRIVER_ENABLE = yes
|
||||
LINK_TIME_OPTIMIZATION_ENABLE = yes
|
@@ -30,7 +30,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#include "util.h"
|
||||
#include "matrix.h"
|
||||
#include "split_util.h"
|
||||
#include "pro_micro.h"
|
||||
#include "quantum.h"
|
||||
|
||||
#ifdef USE_MATRIX_I2C
|
||||
# include "i2c.h"
|
||||
@@ -101,9 +101,10 @@ void matrix_init(void)
|
||||
unselect_rows();
|
||||
init_cols();
|
||||
|
||||
TX_RX_LED_INIT;
|
||||
TXLED0;
|
||||
RXLED0;
|
||||
setPinOutput(B0);
|
||||
setPinOutput(D5);
|
||||
writePinHigh(B0);
|
||||
writePinHigh(D5);
|
||||
|
||||
// initialize matrix state: all keys off
|
||||
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
|
||||
@@ -188,10 +189,10 @@ int serial_transaction(int master_changed) {
|
||||
int ret=serial_update_buffers();
|
||||
#endif
|
||||
if (ret ) {
|
||||
if(ret==2) RXLED1;
|
||||
if(ret==2) writePinLow(B0);
|
||||
return 1;
|
||||
}
|
||||
RXLED0;
|
||||
writePinHigh(B0);
|
||||
memcpy(&matrix[slaveOffset],
|
||||
(void *)serial_slave_buffer, SERIAL_SLAVE_BUFFER_LENGTH);
|
||||
return 0;
|
||||
@@ -240,7 +241,7 @@ uint8_t matrix_master_scan(void) {
|
||||
if( serial_transaction(mchanged) ) {
|
||||
#endif
|
||||
// turn on the indicator led when halves are disconnected
|
||||
TXLED1;
|
||||
writePinLow(D5);
|
||||
|
||||
error_count++;
|
||||
|
||||
@@ -253,7 +254,7 @@ uint8_t matrix_master_scan(void) {
|
||||
}
|
||||
} else {
|
||||
// turn off the indicator led on no error
|
||||
TXLED0;
|
||||
writePinHigh(D5);
|
||||
error_count = 0;
|
||||
}
|
||||
matrix_scan_quantum();
|
||||
|
@@ -27,5 +27,5 @@
|
||||
#define USE_SERIAL_PD2
|
||||
|
||||
#define TAPPING_FORCE_HOLD
|
||||
#define TAPPING_TERM 300
|
||||
#define TAPPING_TERM 200
|
||||
#define RETRO_TAPPPING
|
@@ -31,7 +31,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
//|---------+---------+---------+---------+---------+---------+---------| |---------+---------+---------+---------+---------+---------+---------|
|
||||
_____________________QWERTY_L3______________________, LT_RAI, LT_LOW, _____________________QWERTY_R3______________________,
|
||||
//|---------+---------+---------+---------+---------+---------+---------| |---------+---------+---------+---------+---------+---------+---------|
|
||||
________MOD_LEFT_________, K_LAPP, K_RAPP, ________MOD_RIGHT________
|
||||
________MOD_LEFT_________, XXXXXXX, XXXXXXX, ________MOD_RIGHT________
|
||||
//`---------------------------------------' `---------------------------------------'
|
||||
),
|
||||
|
||||
@@ -43,7 +43,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
//|---------+---------+---------+---------+---------+---------+---------| |---------+---------+---------+---------+---------+---------+---------|
|
||||
_____________________DVORAK_L3______________________, LT_RAI, LT_LOW, _____________________DVORAK_R3______________________,
|
||||
//|---------+---------+---------+---------+---------+---------+---------| |---------+---------+---------+---------+---------+---------+---------|
|
||||
________MOD_LEFT_________, K_LAPP, K_RAPP, ________MOD_RIGHT________
|
||||
________MOD_LEFT_________, XXXXXXX, XXXXXXX, ________MOD_RIGHT________
|
||||
//`---------------------------------------' `---------------------------------------'
|
||||
),
|
||||
|
||||
@@ -55,7 +55,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
//|---------+---------+---------+---------+---------+---------+---------| |---------+---------+---------+---------+---------+---------+---------|
|
||||
_____________________COLEMAK_L3_____________________, LT_RAI, LT_LOW, _____________________COLEMAK_R3_____________________,
|
||||
//|---------+---------+---------+---------+---------+---------+---------| |---------+---------+---------+---------+---------+---------+---------|
|
||||
________MOD_LEFT_________, K_LAPP, K_RAPP, ________MOD_RIGHT________
|
||||
________MOD_LEFT_________, XXXXXXX, XXXXXXX, ________MOD_RIGHT________
|
||||
//`---------------------------------------' `---------------------------------------'
|
||||
),
|
||||
|
||||
|
127
keyboards/xd75/keymaps/neothefox/keymap.c
Normal file
127
keyboards/xd75/keymaps/neothefox/keymap.c
Normal file
@@ -0,0 +1,127 @@
|
||||
/* Copyright 2017 Wunder
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
// Layer shorthand
|
||||
#define LOWER MO(_LOWER)
|
||||
#define RAISE MO(_RAISE)
|
||||
#define SYSTEM MO(_SYSTEM)
|
||||
#define MPASTE LSFT(KC_INSERT)
|
||||
|
||||
enum xd75_layers {
|
||||
_QWERTY,
|
||||
_LOWER,
|
||||
_RAISE,
|
||||
_SYSTEM
|
||||
};
|
||||
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
/* QWERTY
|
||||
* .--------------------------------------------------------------------------------------------------------------------------------------.
|
||||
* | ESC | 1 | 2 | 3 | 4 | 5 | - | ` | = | 6 | 7 | 8 | 9 | 0 | BACKSP |
|
||||
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
|
||||
* | TAB | Q | W | E | R | T | [ | \ | ] | Y | U | I | O | P | ' |
|
||||
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------|
|
||||
* | CAP LK | A | S | D | F | G | INSERT | HOME | PG UP | H | J | K | L | ; | ENTER |
|
||||
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------|
|
||||
* | LSHIFT | Z | X | C | V | B | DEL | END | PG DN | N | M | , | . | / | RSHIFT |
|
||||
* |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+-----------------+--------+--------|
|
||||
* | LCTRL | GUI | MENU | ALT | LOWER | SPACE | SPACE | SPACE | SPACE | SPACE | RAISE | LEFT | DOWN | UP | RIGHT |
|
||||
* '--------------------------------------------------------------------------------------------------------------------------------------'
|
||||
*/
|
||||
|
||||
[_QWERTY] = LAYOUT_ortho_5x15( /* QWERTY */
|
||||
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_MINS, KC_GRV, KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC,
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, KC_BSLS, KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_QUOT,
|
||||
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_INS, KC_HOME, KC_PGUP, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT,
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_DEL, KC_END, KC_PGDN, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
|
||||
KC_LCTL, KC_LGUI, KC_MENU, KC_LALT, LOWER, KC_SPC, KC_SPC, KC_SPC, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT
|
||||
),
|
||||
|
||||
/* SYSTEM
|
||||
* .--------------------------------------------------------------------------------------------------------------------------------------.
|
||||
* | RESET | DEBUG | | | | | | | | | | | | | |
|
||||
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
|
||||
* | | | | | | |RGB_TOG |RGB_VAI |RGB VAD | | | PASTE | PR SCR | SCR LK | PAUSE |
|
||||
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
|
||||
* | | | | | | |RGB_MOD |RGB_SAI |RGB_HUI | | | | | | |
|
||||
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
|
||||
* | | | | | | | |RGB_SAD |RGB_HUD | | | | | | |
|
||||
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
|
||||
* | | | | | | | | | | | | | | | |
|
||||
* '--------------------------------------------------------------------------------------------------------------------------------------'
|
||||
*/
|
||||
|
||||
[_SYSTEM] = LAYOUT_ortho_5x15( /* FUNCTION */
|
||||
RESET, DEBUG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, RGB_TOG, RGB_VAI, RGB_VAD, _______, _______, MPASTE, KC_PSCR, KC_SLCK, KC_PAUSE,
|
||||
_______, _______, _______, _______, _______, _______, RGB_MOD, RGB_SAI, RGB_HUI, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, RGB_SAD, RGB_HUD, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
),
|
||||
|
||||
/* LOWER
|
||||
* .--------------------------------------------------------------------------------------------------------------------------------------.
|
||||
* | | | | | | | | | | | | | | | |
|
||||
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
|
||||
* | ~ | ! | @ | # | $ | % | | | | ^ | & | * | ( | ) | ' |
|
||||
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------|
|
||||
* | DELETE | F1 | F2 | F3 | F4 | F5 | | | | F6 | _ | + | { | } | | |
|
||||
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------|
|
||||
* | | F7 | F8 | F9 | F10 | F11 | | | | F12 | ISO ~ | ISO | | Home | End | |
|
||||
* |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+-----------------+--------+--------|
|
||||
* | | | | | | | | | | | | Next | Vol- | Vol+ | Play |
|
||||
* '--------------------------------------------------------------------------------------------------------------------------------------'
|
||||
*/
|
||||
|
||||
[_LOWER] = LAYOUT_ortho_5x15( /* LOWER */
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, _______, _______, _______, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC,
|
||||
KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, _______, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE,
|
||||
_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, _______, _______, KC_F12,S(KC_NUHS),S(KC_NUBS),KC_HOME,KC_END, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY
|
||||
),
|
||||
|
||||
/* RAISE
|
||||
* .--------------------------------------------------------------------------------------------------------------------------------------.
|
||||
* | | | | | | | | | | | | | | | |
|
||||
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
|
||||
* | ` | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | ' |
|
||||
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------|
|
||||
* | | F1 | F2 | F3 | F4 | F5 | | | | F6 | - | = | [ | ] | \ |
|
||||
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------|
|
||||
* | | F7 | F8 | F9 | F10 | F11 | | | | F12 | ISO # | ISO / | Pg Up | Pg Dn | |
|
||||
* |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+-----------------+--------+--------|
|
||||
* | | | | | | | | | | | | Next | Vol- | Vol+ | Play |
|
||||
* '--------------------------------------------------------------------------------------------------------------------------------------'
|
||||
*/
|
||||
|
||||
[_RAISE] = LAYOUT_ortho_5x15( /* QWERTY */
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, _______, _______, _______, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC,
|
||||
_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, _______, KC_F6, KC_MINUS,KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS,
|
||||
_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, _______, _______, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY
|
||||
)
|
||||
};
|
||||
|
||||
// SYSTEM layer toggle
|
||||
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||
return update_tri_layer_state(state, _LOWER, _RAISE, _SYSTEM);
|
||||
}
|
||||
|
1
keyboards/xd75/keymaps/neothefox/readme.md
Normal file
1
keyboards/xd75/keymaps/neothefox/readme.md
Normal file
@@ -0,0 +1 @@
|
||||
# A OLKB-like layout for XD75
|
@@ -30,7 +30,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#include "util.h"
|
||||
#include "matrix.h"
|
||||
#include "split_util.h"
|
||||
#include "pro_micro.h"
|
||||
#include "quantum.h"
|
||||
|
||||
#ifdef USE_MATRIX_I2C
|
||||
# include "i2c.h"
|
||||
@@ -102,9 +102,10 @@ void matrix_init(void)
|
||||
unselect_rows();
|
||||
init_cols();
|
||||
|
||||
TX_RX_LED_INIT;
|
||||
TXLED0;
|
||||
RXLED0;
|
||||
setPinOutput(B0);
|
||||
setPinOutput(D5);
|
||||
writePinHigh(D5);
|
||||
writePinHigh(B0);
|
||||
|
||||
// initialize matrix state: all keys off
|
||||
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
|
||||
@@ -189,10 +190,10 @@ int serial_transaction(int master_changed) {
|
||||
int ret=serial_update_buffers();
|
||||
#endif
|
||||
if (ret ) {
|
||||
if(ret==2) RXLED1;
|
||||
if(ret==2) writePinLow(B0);
|
||||
return 1;
|
||||
}
|
||||
RXLED0;
|
||||
writePinHigh(B0);
|
||||
memcpy(&matrix[slaveOffset],
|
||||
(void *)serial_slave_buffer, SERIAL_SLAVE_BUFFER_LENGTH);
|
||||
return 0;
|
||||
@@ -241,7 +242,7 @@ uint8_t matrix_master_scan(void) {
|
||||
if( serial_transaction(mchanged) ) {
|
||||
#endif
|
||||
// turn on the indicator led when halves are disconnected
|
||||
TXLED1;
|
||||
writePinLow(D5);
|
||||
|
||||
error_count++;
|
||||
|
||||
@@ -254,7 +255,7 @@ uint8_t matrix_master_scan(void) {
|
||||
}
|
||||
} else {
|
||||
// turn off the indicator led on no error
|
||||
TXLED0;
|
||||
writePinHigh(D5);
|
||||
error_count = 0;
|
||||
}
|
||||
matrix_scan_quantum();
|
||||
|
@@ -30,7 +30,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#include "util.h"
|
||||
#include "matrix.h"
|
||||
#include "split_util.h"
|
||||
#include "pro_micro.h"
|
||||
#include "quantum.h"
|
||||
|
||||
#ifdef USE_MATRIX_I2C
|
||||
# include "i2c.h"
|
||||
@@ -102,9 +102,10 @@ void matrix_init(void)
|
||||
unselect_rows();
|
||||
init_cols();
|
||||
|
||||
TX_RX_LED_INIT;
|
||||
TXLED0;
|
||||
RXLED0;
|
||||
setPinOutput(B0);
|
||||
setPinOutput(D5);
|
||||
writePinHigh(D5);
|
||||
writePinHigh(B0);
|
||||
|
||||
// initialize matrix state: all keys off
|
||||
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
|
||||
@@ -189,10 +190,10 @@ int serial_transaction(int master_changed) {
|
||||
int ret=serial_update_buffers();
|
||||
#endif
|
||||
if (ret ) {
|
||||
if(ret==2) RXLED1;
|
||||
if(ret==2) writePinLow(B0);
|
||||
return 1;
|
||||
}
|
||||
RXLED0;
|
||||
writePinHigh(B0);
|
||||
memcpy(&matrix[slaveOffset],
|
||||
(void *)serial_slave_buffer, sizeof(serial_slave_buffer));
|
||||
return 0;
|
||||
@@ -240,7 +241,7 @@ uint8_t matrix_master_scan(void) {
|
||||
if( serial_transaction(mchanged) ) {
|
||||
#endif
|
||||
// turn on the indicator led when halves are disconnected
|
||||
TXLED1;
|
||||
writePinLow(D5);
|
||||
|
||||
error_count++;
|
||||
|
||||
@@ -253,7 +254,7 @@ uint8_t matrix_master_scan(void) {
|
||||
}
|
||||
} else {
|
||||
// turn off the indicator led on no error
|
||||
TXLED0;
|
||||
writePinHigh(D5);
|
||||
error_count = 0;
|
||||
}
|
||||
matrix_scan_quantum();
|
||||
|
@@ -30,7 +30,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#include "util.h"
|
||||
#include "matrix.h"
|
||||
#include "split_util.h"
|
||||
#include "pro_micro.h"
|
||||
#include "quantum.h"
|
||||
|
||||
#ifdef USE_MATRIX_I2C
|
||||
# include "i2c.h"
|
||||
@@ -102,9 +102,10 @@ void matrix_init(void)
|
||||
unselect_rows();
|
||||
init_cols();
|
||||
|
||||
TX_RX_LED_INIT;
|
||||
TXLED0;
|
||||
RXLED0;
|
||||
setPinOutput(B0);
|
||||
setPinOutput(D5);
|
||||
writePinHigh(B0);
|
||||
writePinHigh(D5);
|
||||
|
||||
// initialize matrix state: all keys off
|
||||
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
|
||||
@@ -189,10 +190,10 @@ int serial_transaction(int master_changed) {
|
||||
int ret=serial_update_buffers();
|
||||
#endif
|
||||
if (ret ) {
|
||||
if(ret==2) RXLED1;
|
||||
if(ret==2) writePinLow(B0);
|
||||
return 1;
|
||||
}
|
||||
RXLED0;
|
||||
writePinHigh(B0);
|
||||
memcpy(&matrix[slaveOffset],
|
||||
(void *)serial_slave_buffer, sizeof(serial_slave_buffer));
|
||||
return 0;
|
||||
@@ -240,7 +241,7 @@ uint8_t matrix_master_scan(void) {
|
||||
if( serial_transaction(mchanged) ) {
|
||||
#endif
|
||||
// turn on the indicator led when halves are disconnected
|
||||
TXLED1;
|
||||
writePinLow(D5);
|
||||
|
||||
error_count++;
|
||||
|
||||
@@ -253,7 +254,7 @@ uint8_t matrix_master_scan(void) {
|
||||
}
|
||||
} else {
|
||||
// turn off the indicator led on no error
|
||||
TXLED0;
|
||||
writePinHigh(D5);
|
||||
error_count = 0;
|
||||
}
|
||||
matrix_scan_quantum();
|
||||
|
@@ -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
|
||||
// └───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┘
|
||||
),
|
||||
|
||||
|
@@ -32,7 +32,7 @@
|
||||
|
||||
// This is the default EEPROM max address to use for dynamic keymaps.
|
||||
// The default is the ATmega32u4 EEPROM max address.
|
||||
// Explicitly override it if the keyboard uses a microcontroller with
|
||||
// Explicitly override it if the keyboard uses a microcontroller with
|
||||
// more EEPROM *and* it makes sense to increase it.
|
||||
#ifndef DYNAMIC_KEYMAP_EEPROM_MAX_ADDR
|
||||
# define DYNAMIC_KEYMAP_EEPROM_MAX_ADDR 1023
|
||||
@@ -210,9 +210,9 @@ void dynamic_keymap_macro_send(uint8_t id) {
|
||||
++p;
|
||||
}
|
||||
|
||||
// Send the macro string one or two chars at a time
|
||||
// by making temporary 1 or 2 char strings
|
||||
char data[3] = {0, 0, 0};
|
||||
// Send the macro string one or three chars at a time
|
||||
// by making temporary 1 or 3 char strings
|
||||
char data[4] = {0, 0, 0, 0};
|
||||
// We already checked there was a null at the end of
|
||||
// the buffer, so this cannot go past the end
|
||||
while (1) {
|
||||
@@ -223,10 +223,12 @@ void dynamic_keymap_macro_send(uint8_t id) {
|
||||
break;
|
||||
}
|
||||
// If the char is magic (tap, down, up),
|
||||
// add the next char (key to use) and send a 2 char string.
|
||||
// add the next char (key to use) and send a 3 char string.
|
||||
if (data[0] == SS_TAP_CODE || data[0] == SS_DOWN_CODE || data[0] == SS_UP_CODE) {
|
||||
data[1] = eeprom_read_byte(p++);
|
||||
if (data[1] == 0) {
|
||||
data[1] = data[0];
|
||||
data[0] = SS_QMK_PREFIX;
|
||||
data[2] = eeprom_read_byte(p++);
|
||||
if (data[2] == 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
151
quantum/keymap_extras/keymap_portuguese.h
Normal file
151
quantum/keymap_extras/keymap_portuguese.h
Normal file
@@ -0,0 +1,151 @@
|
||||
/* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "keymap.h"
|
||||
|
||||
// clang-format off
|
||||
|
||||
/*
|
||||
* ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐
|
||||
* │ \ │ 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 PT_BSLS KC_GRV // (backslash)
|
||||
#define PT_1 KC_1 // 1
|
||||
#define PT_2 KC_2 // 2
|
||||
#define PT_3 KC_3 // 3
|
||||
#define PT_4 KC_4 // 4
|
||||
#define PT_5 KC_5 // 5
|
||||
#define PT_6 KC_6 // 6
|
||||
#define PT_7 KC_7 // 7
|
||||
#define PT_8 KC_8 // 8
|
||||
#define PT_9 KC_9 // 9
|
||||
#define PT_0 KC_0 // 0
|
||||
#define PT_QUOT KC_MINS // '
|
||||
#define PT_LDAQ KC_EQL // «
|
||||
// Row 2
|
||||
#define PT_Q KC_Q // Q
|
||||
#define PT_W KC_W // W
|
||||
#define PT_E KC_E // E
|
||||
#define PT_R KC_R // R
|
||||
#define PT_T KC_T // T
|
||||
#define PT_Y KC_Y // Y
|
||||
#define PT_U KC_U // U
|
||||
#define PT_I KC_I // I
|
||||
#define PT_O KC_O // O
|
||||
#define PT_P KC_P // P
|
||||
#define PT_PLUS KC_LBRC // +
|
||||
#define PT_ACUT KC_RBRC // ´ (dead)
|
||||
// Row 3
|
||||
#define PT_A KC_A // A
|
||||
#define PT_S KC_S // S
|
||||
#define PT_D KC_D // D
|
||||
#define PT_F KC_F // F
|
||||
#define PT_G KC_G // G
|
||||
#define PT_H KC_H // H
|
||||
#define PT_J KC_J // J
|
||||
#define PT_K KC_K // K
|
||||
#define PT_L KC_L // L
|
||||
#define PT_CCED KC_SCLN // Ç
|
||||
#define PT_MORD KC_QUOT // º
|
||||
#define PT_TILD KC_NUHS // ~ (dead)
|
||||
// Row 4
|
||||
#define PT_LABK KC_NUBS // <
|
||||
#define PT_Z KC_Z // Z
|
||||
#define PT_X KC_X // X
|
||||
#define PT_C KC_C // C
|
||||
#define PT_V KC_V // V
|
||||
#define PT_B KC_B // B
|
||||
#define PT_N KC_N // N
|
||||
#define PT_M KC_M // M
|
||||
#define PT_COMM KC_COMM // ,
|
||||
#define PT_DOT KC_DOT // .
|
||||
#define PT_MINS KC_SLSH // -
|
||||
|
||||
/* Shifted symbols
|
||||
* ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐
|
||||
* │ | │ ! │ " │ # │ $ │ % │ & │ / │ ( │ ) │ = │ ? │ » │ │
|
||||
* ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤
|
||||
* │ │ │ │ │ │ │ │ │ │ │ │ * │ ` │ │
|
||||
* ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │
|
||||
* │ │ │ │ │ │ │ │ │ │ │ │ ª │ ^ │ │
|
||||
* ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤
|
||||
* │ │ > │ │ │ │ │ │ │ │ ; │ : │ _ │ │
|
||||
* ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤
|
||||
* │ │ │ │ │ │ │ │ │
|
||||
* └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘
|
||||
*/
|
||||
// Row 1
|
||||
#define PT_PIPE S(PT_BSLS) // |
|
||||
#define PT_EXLM S(PT_1) // !
|
||||
#define PT_DQUO S(PT_2) // "
|
||||
#define PT_HASH S(PT_3) // #
|
||||
#define PT_DLR S(PT_4) // $
|
||||
#define PT_PERC S(PT_5) // %
|
||||
#define PT_AMPR S(PT_6) // &
|
||||
#define PT_SLSH S(PT_7) // /
|
||||
#define PT_LPRN S(PT_8) // (
|
||||
#define PT_RPRN S(PT_9) // )
|
||||
#define PT_EQL S(PT_0) // =
|
||||
#define PT_QUES S(PT_QUOT) // ?
|
||||
#define PT_RDAQ S(PT_LDAQ) // »
|
||||
// Row 2
|
||||
#define PT_ASTR S(PT_PLUS) // *
|
||||
#define PT_GRV S(PT_ACUT) // ` (dead)
|
||||
// Row 3
|
||||
#define PT_FORD S(PT_MORD) // ª
|
||||
#define PT_CIRC S(PT_TILD) // ^ (dead)
|
||||
// Row 4
|
||||
#define PT_RABK S(PT_LABK) // >
|
||||
#define PT_SCLN S(PT_COMM) // ;
|
||||
#define PT_COLN S(PT_DOT) // :
|
||||
#define PT_UNDS S(PT_MINS) // _
|
||||
|
||||
/* AltGr symbols
|
||||
* ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐
|
||||
* │ │ │ @ │ £ │ § │ │ │ { │ [ │ ] │ } │ │ │ │
|
||||
* ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤
|
||||
* │ │ │ │ € │ │ │ │ │ │ │ │ ¨ │ │ │
|
||||
* ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │
|
||||
* │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
|
||||
* ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤
|
||||
* │ │ │ │ │ │ │ │ │ │ │ │ │ │
|
||||
* ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤
|
||||
* │ │ │ │ │ │ │ │ │
|
||||
* └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘
|
||||
*/
|
||||
// Row 1
|
||||
#define PT_AT ALGR(PT_2) // @
|
||||
#define PT_PND ALGR(PT_3) // £
|
||||
#define PT_SECT ALGR(PT_4) // §
|
||||
#define PT_LCBR ALGR(PT_7) // {
|
||||
#define PT_LBRC ALGR(PT_8) // [
|
||||
#define PT_RBRC ALGR(PT_9) // ]
|
||||
#define PT_RCBR ALGR(PT_0) // }
|
||||
// Row 2
|
||||
#define PT_DIAE ALGR(PT_PLUS) // ¨ (dead)
|
||||
#define PT_EURO ALGR(PT_E) // €
|
100
quantum/keymap_extras/sendstring_portuguese.h
Normal file
100
quantum/keymap_extras/sendstring_portuguese.h
Normal file
@@ -0,0 +1,100 @@
|
||||
/* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
// Sendstring lookup tables for Portuguese layouts
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "keymap_portuguese.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, 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, 0, 1, 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, 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, PT_1, PT_2, PT_3, PT_4, PT_5, PT_6, PT_QUOT,
|
||||
// ( ) * + , - . /
|
||||
PT_8, PT_9, PT_PLUS, PT_PLUS, PT_COMM, PT_MINS, PT_DOT, PT_7,
|
||||
// 0 1 2 3 4 5 6 7
|
||||
PT_0, PT_1, PT_2, PT_3, PT_4, PT_5, PT_6, PT_7,
|
||||
// 8 9 : ; < = > ?
|
||||
PT_8, PT_9, PT_DOT, PT_COMM, PT_LABK, PT_0, PT_LABK, PT_QUOT,
|
||||
// @ A B C D E F G
|
||||
PT_2, PT_A, PT_B, PT_C, PT_D, PT_E, PT_F, PT_G,
|
||||
// H I J K L M N O
|
||||
PT_H, PT_I, PT_J, PT_K, PT_L, PT_M, PT_N, PT_O,
|
||||
// P Q R S T U V W
|
||||
PT_P, PT_Q, PT_R, PT_S, PT_T, PT_U, PT_V, PT_W,
|
||||
// X Y Z [ \ ] ^ _
|
||||
PT_X, PT_Y, PT_Z, PT_8, PT_BSLS, PT_9, PT_TILD, PT_MINS,
|
||||
// ` a b c d e f g
|
||||
PT_ACUT, PT_A, PT_B, PT_C, PT_D, PT_E, PT_F, PT_G,
|
||||
// h i j k l m n o
|
||||
PT_H, PT_I, PT_J, PT_K, PT_L, PT_M, PT_N, PT_O,
|
||||
// p q r s t u v w
|
||||
PT_P, PT_Q, PT_R, PT_S, PT_T, PT_U, PT_V, PT_W,
|
||||
// x y z { | } ~ DEL
|
||||
PT_X, PT_Y, PT_Z, PT_7, PT_BSLS, PT_0, PT_TILD, KC_DEL
|
||||
};
|
@@ -23,8 +23,6 @@ See: https://docs.qmk.fm/#/feature_userspace
|
||||
|K_LOCK | MacOS shortcut to execute lock command Cmd + CTRL + Q |
|
||||
|K_CSCN | MacOS shortcut to copy a portion of the screen to the clipboard |
|
||||
|K_MDSH | MacOS shortcut to get em-dash `–` |
|
||||
|K_RAPP | MacOS shortcut to switch apps to the right |
|
||||
|K_LAPP | MacOS shortcut to switch apps to the left |
|
||||
|K_CPRF | Cmd + Shift + M. Used for switching Google Chrome profiles |
|
||||
|
||||
### [Layers](ninjonas.h)
|
||||
@@ -32,17 +30,12 @@ See: https://docs.qmk.fm/#/feature_userspace
|
||||
|---|---|
|
||||
|LT_LOW | Tap for ENTER, hold for RAISE |
|
||||
|LT_RAI | Tap for SPACE, hold for LOWER |
|
||||
|LT_LOW + LT_RAI | Hold for ADJUST |
|
||||
|LM_LOW | Dedicated key to momentarily toggle to use LOWER layer |
|
||||
|LM_RAI | Dedicated key to momentarily toggle to use RAISE layer |
|
||||
|LG_LOW | Press to toggle LOWER layer |
|
||||
|LG_RAI | Press to toggle RAISE layer |
|
||||
|
||||
### [Mod-Taps](ninjonas.h)
|
||||
|Code | Description |
|
||||
|---|---|
|
||||
|MT_DEL | Tap for Delete, hold for Cmd + ALT + SHIFT |
|
||||
|MT_EQL | Tap for =, hold for ALT + SHIFT |
|
||||
|MT_DEL | Tap for Delete, hold for ALT + SHIFT |
|
||||
|MT_EQL | Tap for =, SHIFT |
|
||||
|
||||
### [Layout Blocks](ninjonas.h)
|
||||
Predefined keyboard layout templates to speed up configuring split keyboards
|
||||
@@ -72,7 +65,6 @@ Predefined keyboard layout templates to speed up configuring split keyboards
|
||||
|M_SHFT | Sends Cmd + alt + shift to a keycode to activate [ShiftIt](https://github.com/fikovnik/ShiftIt) |
|
||||
|M_CODE | Opens [Visual Studio Code](https://code.visualstudio.com/) on current directory |
|
||||
|M_TERM | Launches Spotlight and calls Terminal |
|
||||
|M_COPA | Single key copy/paste |
|
||||
|M_XXX1 to M_XXX5 | Reserved for secret macros see [Secrets](#secrets) |
|
||||
|
||||
### [Tap-Dance](tap_dances.h)
|
||||
@@ -84,11 +76,18 @@ Predefined keyboard layout templates to speed up configuring split keyboards
|
||||
|T_TAB | Tap once for TAB, double for CTRL + TAB |
|
||||
|T_GRV | Tap once for GRV, double for Cmd + GRV |
|
||||
|T_GUI | Tap once for Cmd, double to open spotlight |
|
||||
|T_W | Tap for W, double tap for Cmd + W |
|
||||
|T_Q | Tap for Q, double tap for Cmd + Q |
|
||||
|T_CPNU | Tap for Cmd + V, hold for Cmd + C, double tap for NUMPAD layer |
|
||||
|T_CPAP | Tap for Cmd + V, hold for Cmd + C, double tap to open [Line](https://line.me/en/) app, triple tap for itunes. |
|
||||
|T_Y | Tap for Y, double tap for NUMPAD layer |
|
||||
|
||||
### [Combos](combos.h)
|
||||
|Code | Description |
|
||||
|---|---|
|
||||
|EQ_QUIT | Press E + Q will trigger Cmd + Q |
|
||||
|RW_CLOSE | Press R + W will trigger Cmd + W|
|
||||
|ET_TAB | Press E + T will trigger Cmd + T|
|
||||
|ZC_COPY | Press Z + C will trigger Cmd + C|
|
||||
|XV_PASTE | Press X + V will trigger Cmd + V|
|
||||
|
||||
### Secrets
|
||||
There's times where you have macros you don't want to share like emails, an address you need but you always forget, passwords 😱, & and private strings. Based off [drashna's secret macros](https://github.com/qmk/qmk_firmware/blob/master/users/drashna/readme_secrets.md), it's now possible to do this. All you need to do is create a `secrets.c` file. Below is an example of how this is used.
|
||||
|
||||
|
55
users/ninjonas/combos.c
Normal file
55
users/ninjonas/combos.c
Normal file
@@ -0,0 +1,55 @@
|
||||
#include "ninjonas.h"
|
||||
|
||||
#ifdef COMBO_ENABLE
|
||||
enum combo_events {
|
||||
EQ_QUIT,
|
||||
RW_CLOSE,
|
||||
QT_TAB,
|
||||
ZC_COPY,
|
||||
XV_PASTE
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM quit_combo[] = {KC_E, KC_Q, COMBO_END};
|
||||
const uint16_t PROGMEM close_combo[] = {KC_R, KC_W, COMBO_END};
|
||||
const uint16_t PROGMEM tab_combo[] = {KC_Q, KC_T, COMBO_END};
|
||||
const uint16_t PROGMEM copy_combo[] = {KC_Z, KC_C, COMBO_END};
|
||||
const uint16_t PROGMEM paste_combo[] = {KC_X, KC_V, COMBO_END};
|
||||
|
||||
combo_t key_combos[COMBO_COUNT] = {
|
||||
[EQ_QUIT] = COMBO_ACTION(quit_combo),
|
||||
[RW_CLOSE] = COMBO_ACTION(close_combo),
|
||||
[QT_TAB] = COMBO_ACTION(tab_combo),
|
||||
[ZC_COPY] = COMBO_ACTION(copy_combo),
|
||||
[XV_PASTE] = COMBO_ACTION(paste_combo),
|
||||
};
|
||||
|
||||
void process_combo_event(uint8_t combo_index, bool pressed) {
|
||||
switch(combo_index) {
|
||||
case EQ_QUIT:
|
||||
if (pressed) {
|
||||
tap_code16(LGUI(KC_Q));
|
||||
}
|
||||
break;
|
||||
case RW_CLOSE:
|
||||
if (pressed) {
|
||||
tap_code16(LGUI(KC_W));
|
||||
}
|
||||
break;
|
||||
case QT_TAB:
|
||||
if (pressed) {
|
||||
tap_code16(LGUI(KC_T));
|
||||
}
|
||||
break;
|
||||
case ZC_COPY:
|
||||
if (pressed) {
|
||||
tap_code16(LGUI(KC_C));
|
||||
}
|
||||
break;
|
||||
case XV_PASTE:
|
||||
if (pressed) {
|
||||
tap_code16(LGUI(KC_V));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
@@ -1,6 +1,6 @@
|
||||
#ifdef TAPPING_TERM
|
||||
#undef TAPPING_TERM
|
||||
#define TAPPING_TERM 300
|
||||
#define TAPPING_TERM 200
|
||||
#endif
|
||||
|
||||
// Mouse Settings: Smoothing out mouse movement on keypress
|
||||
@@ -11,4 +11,11 @@
|
||||
#define MOUSEKEY_DELAY 0
|
||||
#define MOUSEKEY_TIME_TO_MAX 60
|
||||
#define MOUSEKEY_MAX_SPEED 7
|
||||
#define MOUSEKEY_WHEEL_DELAY 0
|
||||
#define MOUSEKEY_WHEEL_DELAY 0
|
||||
|
||||
#ifdef COMBO_ENABLE
|
||||
#undef COMBO_COUNT
|
||||
#undef COMBO_TERM
|
||||
#define COMBO_COUNT 5
|
||||
#define COMBO_TERM 60
|
||||
#endif
|
104
users/ninjonas/encoder.c
Normal file
104
users/ninjonas/encoder.c
Normal file
@@ -0,0 +1,104 @@
|
||||
/* Copyright 2020 ninjonas
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include "ninjonas.h"
|
||||
|
||||
#ifdef ENCODER_ENABLE
|
||||
void left_encoder_cw(void) {
|
||||
switch (get_highest_layer(layer_state)) {
|
||||
case _LOWER:
|
||||
tap_code16(LGUI(KC_TAB));
|
||||
break;
|
||||
case _RAISE:
|
||||
tap_code(KC_PGDN);
|
||||
break;
|
||||
case _ADJUST:
|
||||
rgblight_decrease_hue();
|
||||
break;
|
||||
default:
|
||||
tap_code(KC_BRID);
|
||||
break;
|
||||
}
|
||||
}
|
||||
void left_encoder_acw(void) {
|
||||
switch (get_highest_layer(layer_state)) {
|
||||
case _LOWER:
|
||||
tap_code16(SGUI(KC_TAB));
|
||||
break;
|
||||
case _RAISE:
|
||||
tap_code(KC_PGUP);
|
||||
break;
|
||||
case _ADJUST:
|
||||
rgblight_increase_hue();
|
||||
break;
|
||||
default:
|
||||
tap_code(KC_BRIU);
|
||||
break;
|
||||
}
|
||||
}
|
||||
void right_encoder_cw(void) {
|
||||
switch (get_highest_layer(layer_state)) {
|
||||
case _LOWER:
|
||||
tap_code(KC_DOWN);
|
||||
break;
|
||||
case _RAISE:
|
||||
tap_code16(LCTL(LSFT(KC_TAB)));
|
||||
break;
|
||||
case _ADJUST:
|
||||
rgblight_decrease_val();
|
||||
break;
|
||||
default:
|
||||
tap_code(KC_VOLD);
|
||||
break;
|
||||
}
|
||||
}
|
||||
void right_encoder_acw(void) {
|
||||
switch (get_highest_layer(layer_state)) {
|
||||
case _LOWER:
|
||||
tap_code(KC_UP);
|
||||
break;
|
||||
case _RAISE:
|
||||
tap_code16(LCTL(KC_TAB));
|
||||
break;
|
||||
case _ADJUST:
|
||||
rgblight_increase_val();
|
||||
break;
|
||||
default:
|
||||
tap_code(KC_VOLU);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void encoder_update_user(uint8_t index, bool clockwise) {
|
||||
encoder_rotated_timer = timer_read();
|
||||
if (index == 0) {
|
||||
left_encoder_rotated = true;
|
||||
if (clockwise) {
|
||||
left_encoder_cw();
|
||||
} else {
|
||||
left_encoder_acw();
|
||||
}
|
||||
}
|
||||
else if (index == 1) {
|
||||
right_encoder_rotated = true;
|
||||
if (clockwise) {
|
||||
right_encoder_cw();
|
||||
} else {
|
||||
right_encoder_acw();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
@@ -27,6 +27,12 @@
|
||||
#include "split_util.h"
|
||||
#endif
|
||||
|
||||
#ifdef ENCODER_ENABLE
|
||||
bool left_encoder_rotated;
|
||||
bool right_encoder_rotated;
|
||||
uint16_t encoder_rotated_timer;
|
||||
#endif
|
||||
|
||||
#define _QWERTY 0
|
||||
#define _DVORAK 1
|
||||
#define _COLEMAK 2
|
||||
@@ -40,24 +46,17 @@
|
||||
#define K_CSCN LGUI(LCTL(LSFT(KC_4))) // Copy a portion of the screen to the clipboard
|
||||
#define K_CPRF LGUI(LSFT(KC_M)) // Cmd + Shift + M. Used for switching Google Chrome profiles
|
||||
#define K_MDSH LSFT(LALT(KC_MINS))
|
||||
#define K_LAPP SGUI(KC_TAB) // Cmd + Shift + Tab
|
||||
#define K_RAPP LGUI(KC_TAB) // Cmd + Tab
|
||||
|
||||
// Layer Keys
|
||||
#define LM_LOW MO(_LOWER)
|
||||
#define LM_RAI MO(_RAISE)
|
||||
#define LG_LOW TG(_LOWER)
|
||||
#define LG_RAI TG(_RAISE)
|
||||
#define LG_NUM TG(_NUMPAD)
|
||||
#define LT_LOW LT(_LOWER, KC_ENT)
|
||||
#define LT_RAI LT(_RAISE, KC_SPC)
|
||||
|
||||
// Mod-Tap Keys
|
||||
#define MT_DEL MT(MOD_LGUI | MOD_LALT | MOD_LSFT, KC_DEL)
|
||||
#define MT_EQL MT(MOD_LALT | MOD_LSFT, KC_EQL)
|
||||
#define MT_DEL MT(MOD_LALT | MOD_LSFT, KC_DEL)
|
||||
#define MT_EQL MT(MOD_RSFT, KC_EQL)
|
||||
|
||||
// Layout blocks
|
||||
#define _____________________QWERTY_L1______________________ T_TAB, T_Q, KC_W, KC_E, KC_R, KC_T
|
||||
#define _____________________QWERTY_L1______________________ T_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T
|
||||
#define _____________________QWERTY_L2______________________ T_ESC, KC_A, KC_S, KC_D, KC_F, KC_G
|
||||
#define _____________________QWERTY_L3______________________ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B
|
||||
|
||||
@@ -130,7 +129,7 @@
|
||||
#define __________________________________ _______, _______, _______, _______
|
||||
|
||||
#define _____________MOD_LEFT_____________ KC_LALT, T_GUI, KC_LCTL, LT_RAI
|
||||
#define _____________MOD_RIGHT____________ LT_LOW, KC_BSPC, MT_DEL, T_CPNU
|
||||
#define _____________MOD_RIGHT____________ LT_LOW, KC_BSPC, MT_DEL, T_CPAP
|
||||
|
||||
#define _________MEDIA_1_________ KC_BRIU, KC_MPLY, KC_MUTE
|
||||
#define _________MEDIA_2_________ KC_BRID, KC_MFFD, KC__VOLUP
|
||||
@@ -141,7 +140,7 @@
|
||||
#define ________MOD_RIGHT________ LT_LOW, KC_BSPC, MT_DEL
|
||||
#else
|
||||
#define ________MOD_LEFT_________ KC_LALT, T_GUI, KC_LCTL
|
||||
#define ________MOD_RIGHT________ KC_BSPC, MT_DEL, T_CPNU
|
||||
#define ________MOD_RIGHT________ KC_BSPC, MT_DEL, T_CPAP
|
||||
#endif
|
||||
|
||||
// Layout wrappers
|
||||
|
@@ -1,7 +1,5 @@
|
||||
#include "ninjonas.h"
|
||||
|
||||
uint16_t copy_paste_timer;
|
||||
|
||||
__attribute__((weak))
|
||||
bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { return true; }
|
||||
|
||||
@@ -92,18 +90,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
}
|
||||
break;
|
||||
|
||||
// Single key copy/paste
|
||||
case M_COPA:
|
||||
if (record->event.pressed) {
|
||||
copy_paste_timer = timer_read();
|
||||
} else {
|
||||
if (timer_elapsed(copy_paste_timer) > TAPPING_TERM) {
|
||||
tap_code16(LGUI(KC_C)); // Hold Cmd + C
|
||||
} else {
|
||||
tap_code16(LGUI(KC_V)); // Tap Cmd + V
|
||||
}
|
||||
}
|
||||
|
||||
// BEGIN: Layer macros
|
||||
case QWERTY:
|
||||
if (record->event.pressed) {
|
||||
|
@@ -15,7 +15,6 @@ enum custom_keycodes {
|
||||
M_VRSN,
|
||||
M_CODE,
|
||||
M_TERM,
|
||||
M_COPA,
|
||||
// Secret Macros
|
||||
M_XXX1,
|
||||
M_XXX2,
|
||||
|
@@ -2,11 +2,14 @@ BOOTMAGIC_ENABLE = no # Disable Boot Magic (https://beta.docs.qmk.fm/featu
|
||||
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
|
||||
TAP_DANCE_ENABLE = yes # Enable Tap Dance.
|
||||
COMBO_ENABLE = yes # Enable Combos
|
||||
|
||||
SRC += ninjonas.c \
|
||||
process_records.c \
|
||||
tap_dances.c \
|
||||
oled.c
|
||||
oled.c \
|
||||
encoder.c \
|
||||
combos.c
|
||||
|
||||
ifneq ("$(wildcard $(USER_PATH)/secrets.c)","")
|
||||
SRC += secrets.c
|
||||
|
@@ -2,28 +2,41 @@
|
||||
|
||||
//// BEGIN: Advanced Tap Dances
|
||||
int cur_dance (qk_tap_dance_state_t *state) {
|
||||
if (state->count == 1) {
|
||||
if (!state->pressed) {
|
||||
return SINGLE_TAP;
|
||||
} else {
|
||||
return SINGLE_HOLD;
|
||||
}
|
||||
} else if (state->count == 2) {
|
||||
return DOUBLE_TAP;
|
||||
if (state->count == 1) {
|
||||
if (state->interrupted || !state->pressed) return SINGLE_TAP;
|
||||
//key has not been interrupted, but they key is still held. Means you want to send a 'HOLD'.
|
||||
else return SINGLE_HOLD;
|
||||
}
|
||||
else return 8;
|
||||
else if (state->count == 2) {
|
||||
/*
|
||||
* DOUBLE_SINGLE_TAP is to distinguish between typing "pepper", and actually wanting a double tap
|
||||
* action when hitting 'pp'. Suggested use case for this return value is when you want to send two
|
||||
* keystrokes of the key, and not the 'double tap' action/macro.
|
||||
*/
|
||||
if (state->interrupted) return DOUBLE_SINGLE_TAP;
|
||||
else if (state->pressed) return DOUBLE_HOLD;
|
||||
else return DOUBLE_TAP;
|
||||
}
|
||||
//Assumes no one is trying to type the same letter three times (at least not quickly).
|
||||
//If your tap dance key is 'KC_W', and you want to type "www." quickly - then you will need to add
|
||||
//an exception here to return a 'TRIPLE_SINGLE_TAP', and define that enum just like 'DOUBLE_SINGLE_TAP'
|
||||
if (state->count == 3) {
|
||||
if (state->interrupted || !state->pressed) return TRIPLE_TAP;
|
||||
else return TRIPLE_HOLD;
|
||||
}
|
||||
else return 8; //magic number. At some point this method will expand to work for more presses
|
||||
}
|
||||
|
||||
// BEGIN: Copy, Paste, NUMPAD
|
||||
// BEGIN: Copy, Paste, Apps
|
||||
// https://beta.docs.qmk.fm/features/feature_tap_dance#example-6-using-tap-dance-for-momentary-layer-switch-and-layer-toggle-keys
|
||||
static tap copy_paste_numpad_tap_state = {
|
||||
static tap copy_paste_app_tap_state = {
|
||||
.is_press_action = true,
|
||||
.state = 0
|
||||
};
|
||||
|
||||
void copy_paste_numpad_finished (qk_tap_dance_state_t *state, void *user_data) {
|
||||
copy_paste_numpad_tap_state.state = cur_dance(state);
|
||||
switch (copy_paste_numpad_tap_state.state) {
|
||||
void copy_paste_app_finished (qk_tap_dance_state_t *state, void *user_data) {
|
||||
copy_paste_app_tap_state.state = cur_dance(state);
|
||||
switch (copy_paste_app_tap_state.state) {
|
||||
case SINGLE_TAP:
|
||||
tap_code16(LGUI(KC_V)); // Tap Cmd + V
|
||||
break;
|
||||
@@ -31,19 +44,22 @@ void copy_paste_numpad_finished (qk_tap_dance_state_t *state, void *user_data) {
|
||||
tap_code16(LGUI(KC_C)); // Hold Cmd + C
|
||||
break;
|
||||
case DOUBLE_TAP:
|
||||
if (layer_state_is(_NUMPAD)) {
|
||||
layer_off(_NUMPAD);
|
||||
} else {
|
||||
layer_on(_NUMPAD);
|
||||
}
|
||||
SEND_STRING(SS_DOWN(X_LGUI) SS_TAP(X_SPACE) SS_UP(X_LGUI));
|
||||
wait_ms(250);
|
||||
SEND_STRING("line\n");
|
||||
break;
|
||||
case TRIPLE_TAP:
|
||||
SEND_STRING(SS_DOWN(X_LGUI) SS_TAP(X_SPACE) SS_UP(X_LGUI));
|
||||
wait_ms(250);
|
||||
SEND_STRING("itunes\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void copy_paste_numpad_reset (qk_tap_dance_state_t *state, void *user_data) {
|
||||
copy_paste_numpad_tap_state.state = 0;
|
||||
void copy_paste_app_reset (qk_tap_dance_state_t *state, void *user_data) {
|
||||
copy_paste_app_tap_state.state = 0;
|
||||
}
|
||||
// END: Copy, Paste, NUMPAD
|
||||
// END: Copy, Paste, Apps
|
||||
|
||||
// BEGIN: Y, NUMPAD
|
||||
static tap y_numpad_tap_state = {
|
||||
@@ -89,10 +105,8 @@ qk_tap_dance_action_t tap_dance_actions[] = {
|
||||
[TD_TAB_CTRLTAB] = ACTION_TAP_DANCE_DOUBLE(KC_TAB, LCTL(KC_TAB)),
|
||||
[TD_GRV_CTRLGRV] = ACTION_TAP_DANCE_DOUBLE(KC_GRV, LGUI(KC_GRV)),
|
||||
[TD_GUI_GUISPC] = ACTION_TAP_DANCE_DOUBLE(KC_LGUI, LGUI(KC_SPC)),
|
||||
[TD_W_CTRLW] = ACTION_TAP_DANCE_DOUBLE(KC_W, LGUI(KC_W)),
|
||||
[TD_Q_GUIQ] = ACTION_TAP_DANCE_DOUBLE(KC_Q, LGUI(KC_Q)),
|
||||
|
||||
// Advanced Tap Dances
|
||||
[TD_COPY_PASTE_NUMPAD] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, copy_paste_numpad_finished, copy_paste_numpad_reset),
|
||||
[TD_Y_NUMPAD] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, y_numpad_finished, y_numpad_reset),
|
||||
[TD_COPY_PASTE_APP] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(NULL, copy_paste_app_finished, copy_paste_app_reset, 300),
|
||||
[TD_Y_NUMPAD] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(NULL, y_numpad_finished, y_numpad_reset, 300),
|
||||
};
|
@@ -9,7 +9,11 @@ typedef struct {
|
||||
enum tapdance_types{
|
||||
SINGLE_TAP = 1,
|
||||
SINGLE_HOLD = 2,
|
||||
DOUBLE_TAP = 3
|
||||
DOUBLE_TAP = 3,
|
||||
DOUBLE_HOLD = 4,
|
||||
DOUBLE_SINGLE_TAP = 5, //send two single taps
|
||||
TRIPLE_TAP = 6,
|
||||
TRIPLE_HOLD = 7
|
||||
};
|
||||
|
||||
enum custom_tapdances{
|
||||
@@ -19,9 +23,7 @@ enum custom_tapdances{
|
||||
TD_TAB_CTRLTAB,
|
||||
TD_GRV_CTRLGRV,
|
||||
TD_GUI_GUISPC,
|
||||
TD_W_CTRLW,
|
||||
TD_Q_GUIQ,
|
||||
TD_COPY_PASTE_NUMPAD,
|
||||
TD_COPY_PASTE_APP,
|
||||
TD_Y_NUMPAD,
|
||||
};
|
||||
|
||||
@@ -31,7 +33,5 @@ enum custom_tapdances{
|
||||
#define T_TAB TD(TD_TAB_CTRLTAB) // Tap for TAB, double tap for CTRL + TAB
|
||||
#define T_GRV TD(TD_GRV_CTRLGRV) // Tap for GRV, double tap for Cmd + GRV
|
||||
#define T_GUI TD(TD_GUI_GUISPC) // Tap for Cmd, double tap for Cmd + Space
|
||||
#define T_W TD(TD_W_CTRLW) // Tap for W, double tap for Cmd + W
|
||||
#define T_Q TD(TD_Q_GUIQ) // Tap for Q, double tap for Cmd + Q
|
||||
#define T_CPNU TD(TD_COPY_PASTE_NUMPAD) // Tap for paste, hold for copy, double tap for NUMPAD
|
||||
#define T_CPAP TD(TD_COPY_PASTE_APP) // Tap for paste, hold for copy, double tap for Line App
|
||||
#define T_Y TD(TD_Y_NUMPAD) // Tap for Y, double tap for NUMPAD
|
@@ -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/"
|
||||
|
||||
|
Reference in New Issue
Block a user