forked from mirrors/qmk_firmware
Compare commits
21 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
526c185e7e | ||
|
|
c63fd051da | ||
|
|
b95979560c | ||
|
|
65150984bd | ||
|
|
205321c377 | ||
|
|
1816ad01d0 | ||
|
|
9c8f61dfa0 | ||
|
|
d1df576ece | ||
|
|
83ebbf57b3 | ||
|
|
8e1f706ac6 | ||
|
|
b0c780ed32 | ||
|
|
3ad2be52a7 | ||
|
|
0fbcb41c85 | ||
|
|
ddca422776 | ||
|
|
82bb7d2852 | ||
|
|
1044519f36 | ||
|
|
209942366b | ||
|
|
494b34b63f | ||
|
|
58e3b01f37 | ||
|
|
6c2008c688 | ||
|
|
bcedc80ec7 |
@@ -34,7 +34,9 @@
|
||||
* [Customizing Functionality](custom_quantum_functions.md)
|
||||
* [Driver Installation with Zadig](driver_installation_zadig.md)
|
||||
* [Keymap Overview](keymap.md)
|
||||
* [Vagrant Guide](getting_started_vagrant.md)
|
||||
* Development Environments
|
||||
* [Docker Guide](getting_started_docker.md)
|
||||
* [Vagrant Guide](getting_started_vagrant.md)
|
||||
* Flashing
|
||||
* [Flashing](flashing.md)
|
||||
* [Flashing ATmega32A (ps2avrgb)](flashing_bootloadhid.md)
|
||||
@@ -126,6 +128,7 @@
|
||||
* [SPI Driver](spi_driver.md)
|
||||
* [WS2812 Driver](ws2812_driver.md)
|
||||
* [EEPROM Driver](eeprom_driver.md)
|
||||
* ['serial' Driver](serial_driver.md)
|
||||
* [GPIO Controls](internals_gpio_control.md)
|
||||
* [Keyboard Guidelines](hardware_keyboard_guidelines.md)
|
||||
|
||||
|
||||
@@ -44,7 +44,11 @@ To connect your host computer to your keyboard with raw HID you need four pieces
|
||||
3. Usage Page
|
||||
4. Usage
|
||||
|
||||
The first two can easily be found in your keyboard's `config.h` in the keyboard's main directory under `VENDOR_ID` and `PRODUCT_ID`. **Usage Page** is **`0xFF60`** and **Usage** is **`0x0061`**.
|
||||
The first two can easily be found in your keyboard's `config.h` in the keyboard's main directory under `VENDOR_ID` and `PRODUCT_ID`.
|
||||
|
||||
The final two can be overridden in your keyboard's `config.h` in the keyboard's main directory by redefining the values: `#define RAW_USAGE_PAGE 0xFF60` and `#define RAW_USAGE_ID 0x61`.
|
||||
|
||||
By default, **Usage Page** is `0xFF60` and **Usage** is `0x61`.
|
||||
|
||||
### Building your host
|
||||
|
||||
|
||||
47
docs/getting_started_docker.md
Normal file
47
docs/getting_started_docker.md
Normal file
@@ -0,0 +1,47 @@
|
||||
# Docker Quick Start
|
||||
|
||||
This project includes a Docker workflow that will allow you to build a new firmware for your keyboard very easily without major changes to your primary operating system. This also ensures that when you clone the project and perform a build, you have the exact same environment as anyone else and the QMK build infrastructure. This makes it much easier for people to help you troubleshoot any issues you encounter.
|
||||
|
||||
## Requirements
|
||||
|
||||
The main prerequisite is a working `docker` install.
|
||||
* [Docker CE](https://docs.docker.com/install/#supported-platforms)
|
||||
|
||||
## Usage
|
||||
|
||||
Acquire a local copy of the QMK's repository (including submodules):
|
||||
|
||||
```bash
|
||||
git clone --recurse-submodules https://github.com/qmk/qmk_firmware.git
|
||||
cd qmk_firmware
|
||||
```
|
||||
|
||||
Run the following command to build a keymap:
|
||||
```bash
|
||||
util/docker_build.sh <keyboard>:<keymap>
|
||||
# For example: util/docker_build.sh planck/rev6:default
|
||||
```
|
||||
|
||||
This will compile the desired keyboard/keymap and leave the resulting `.hex` or `.bin` file in the QMK directory for you to flash. If `:keymap` is omitted, all keymaps are used. Note that the parameter format is the same as when building with `make`.
|
||||
|
||||
There is also support for building _and_ flashing the keyboard straight from Docker by specifying the `target` as well:
|
||||
|
||||
```bash
|
||||
util/docker_build.sh keyboard:keymap:target
|
||||
# For example: util/docker_build.sh planck/rev6:default:flash
|
||||
```
|
||||
|
||||
You can also start the script without any parameters, in which case it will ask you to input the build parameters one by one, which you may find easier to use:
|
||||
|
||||
```bash
|
||||
util/docker_build.sh
|
||||
# Reads parameters as input (leave blank for all keyboards/keymaps)
|
||||
```
|
||||
|
||||
## FAQ
|
||||
|
||||
### Why can't I flash on Windows/macOS
|
||||
|
||||
On Windows and macOS, it requires [Docker Machine](http://gw.tnode.com/docker/docker-machine-with-usb-support-on-windows-macos/) to be running. This is tedious to set up, so it's not recommended; use [QMK Toolbox](https://github.com/qmk/qmk_toolbox) instead.
|
||||
|
||||
!> Docker for Windows requires [Hyper-V](https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/quick-start/enable-hyper-v) to be enabled. This means that it cannot work on versions of Windows which don't have Hyper-V, such as Windows 7, Windows 8 and **Windows 10 Home**.
|
||||
@@ -1,18 +1,41 @@
|
||||
# Flashing Your Keyboard
|
||||
# Flashing Your Keyboard
|
||||
|
||||
Now that you've built a custom firmware file you'll want to flash your keyboard.
|
||||
Now that you've built a custom firmware file you'll want to flash your keyboard.
|
||||
|
||||
## Put Your Keyboard into DFU (Bootloader) Mode
|
||||
|
||||
In order to flash your custom firmware you must first put your keyboard into a special flashing mode. While it is in this mode you will not be able to type or otherwise use your keyboard. It is very important that you do not unplug the keyboard or otherwise interrupt the flashing process while the firmware is being written.
|
||||
|
||||
Different keyboards have different ways to enter this special mode. If your PCB currently runs QMK, TMK, or PS2AVRGB (Bootmapper Client) and you have not been given specific instructions, try the following, in order:
|
||||
|
||||
* Hold down both shift keys and press `Pause`
|
||||
* Hold down both shift keys and press `B`
|
||||
* Unplug your keyboard, hold down the Spacebar and `B` at the same time, plug in your keyboard and wait a second before releasing the keys
|
||||
* Unplug your keyboard, hold down the top or bottom left key (usually Escape or Left Control) and plug in your keyboard
|
||||
* Press the physical `RESET` button, usually located on the underside of the PCB
|
||||
* Locate header pins on the PCB labeled `RESET` and `GND`, and short them together while plugging your PCB in
|
||||
|
||||
If you've attempted all of the above to no avail, and the main chip on the board says `STM32` on it, this may be a bit more complicated. Generally your best bet is to ask on [Discord](https://discord.gg/Uq7gcHh) for assistance. It's likely some photos of the board will be asked for -- if you can get them ready beforehand it'll help move things along!
|
||||
|
||||
Otherwise, you should see a message in yellow, similar to this in QMK Toolbox:
|
||||
|
||||
```
|
||||
*** DFU device connected: Atmel Corp. ATmega32U4 (03EB:2FF4:0000)
|
||||
```
|
||||
|
||||
and this bootloader device will also be present in Device Manager, System Information.app, or `lsusb`.
|
||||
|
||||
## Flashing Your Keyboard with QMK Toolbox
|
||||
|
||||
The simplest way to flash your keyboard will be with the [QMK Toolbox](https://github.com/qmk/qmk_toolbox/releases).
|
||||
The simplest way to flash your keyboard will be with the [QMK Toolbox](https://github.com/qmk/qmk_toolbox/releases).
|
||||
|
||||
However, the QMK Toolbox is only available for Windows and macOS currently. If you're using Linux (or just wish to flash the firmware from the command line), proceed down to [Flash Your Keyboard From The Command Line](#flash-your-keyboard-from-the-command-line).
|
||||
However, the Toolbox is currently only available for Windows and macOS. If you're using Linux (or just wish to flash the firmware from the command line), skip to the [Flash your Keyboard from the Command Line](#flash-your-keyboard-from-the-command-line) section.
|
||||
|
||||
### Load The File Into QMK Toolbox
|
||||
### Load the File into QMK Toolbox
|
||||
|
||||
Begin by opening the QMK Toolbox application. You'll want to locate the firmware file in Finder or Explorer. Your keyboard firmware may be in one of two formats- `.hex` or `.bin`. QMK tries to copy the appropriate one for your keyboard into the root `qmk_firmware` directory.
|
||||
|
||||
If you are on Windows or macOS there are commands you can use to easily open the current firmware folder in Explorer or Finder.
|
||||
If you are on Windows or macOS, there are commands you can use to easily open the current folder in Explorer or Finder.
|
||||
|
||||
#### Windows
|
||||
|
||||
@@ -38,65 +61,44 @@ For example, the `planck/rev5` with a `default` keymap will have this filename:
|
||||
planck_rev5_default.hex
|
||||
```
|
||||
|
||||
Once you have located your firmware file drag it into the "Local file" box in QMK Toolbox, or click "Open" and navigate to where your firmware file is stored.
|
||||
|
||||
### Put Your Keyboard Into DFU (Bootloader) Mode
|
||||
|
||||
In order to flash your custom firmware you have to put your keyboard into a special flashing mode. While it is in this mode you will not be able to type or otherwise use your keyboard. It is very important that you do not unplug your keyboard or otherwise interrupt the flashing process while the firmware is being written.
|
||||
|
||||
Different keyboards have different ways to enter this special mode. If your PCB currently runs QMK or TMK and you have not been given specific instructions try the following, in order:
|
||||
|
||||
* Hold down both shift keys and press `Pause`
|
||||
* Hold down both shift keys and press `B`
|
||||
* Unplug your keyboard, hold down the Spacebar and `B` at the same time, plug in your keyboard and wait a second before releasing the keys
|
||||
* Press the physical `RESET` button on the bottom of the PCB
|
||||
* Locate header pins on the PCB labeled `BOOT0` or `RESET`, short those together while plugging your PCB in
|
||||
|
||||
When you are successful you will see a message similar to this in QMK Toolbox:
|
||||
|
||||
```
|
||||
*** Clueboard - Clueboard 66% HotSwap disconnected -- 0xC1ED:0x2390
|
||||
*** DFU device connected
|
||||
```
|
||||
Once you have located your firmware file drag it into the "Local file" box in QMK Toolbox, or click "Open" and navigate to where your firmware file is stored.
|
||||
|
||||
### Flash Your Keyboard
|
||||
|
||||
Click the `Flash` button in QMK Toolbox. You will see output similar to the following:
|
||||
|
||||
```
|
||||
*** Clueboard - Clueboard 66% HotSwap disconnected -- 0xC1ED:0x2390
|
||||
*** DFU device connected
|
||||
*** DFU device connected: Atmel Corp. ATmega32U4 (03EB:2FF4:0000)
|
||||
*** Attempting to flash, please don't remove device
|
||||
>>> dfu-programmer atmega32u4 erase --force
|
||||
>>> dfu-programmer.exe atmega32u4 erase --force
|
||||
Erasing flash... Success
|
||||
Checking memory from 0x0 to 0x6FFF... Empty.
|
||||
>>> dfu-programmer atmega32u4 flash /Users/skully/qmk_firmware/clueboard_66_hotswap_gen1_skully.hex
|
||||
Checking memory from 0x0 to 0x55FF... Empty.
|
||||
0% 100% Programming 0x5600 bytes...
|
||||
>>> dfu-programmer.exe atmega32u4 flash "D:\Git\qmk_firmware\gh60_satan_default.hex"
|
||||
Checking memory from 0x0 to 0x3F7F... Empty.
|
||||
0% 100% Programming 0x3F80 bytes...
|
||||
[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] Success
|
||||
0% 100% Reading 0x7000 bytes...
|
||||
[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] Success
|
||||
Validating... Success
|
||||
0x5600 bytes written into 0x7000 bytes memory (76.79%).
|
||||
>>> dfu-programmer atmega32u4 reset
|
||||
0x3F80 bytes written into 0x7000 bytes memory (56.70%).
|
||||
>>> dfu-programmer.exe atmega32u4 reset
|
||||
|
||||
*** DFU device disconnected
|
||||
*** Clueboard - Clueboard 66% HotSwap connected -- 0xC1ED:0x2390
|
||||
*** DFU device disconnected: Atmel Corp: ATmega32U4 (03EB:2FF4:0000)
|
||||
```
|
||||
|
||||
## Flash your Keyboard from the Command Line
|
||||
|
||||
This has been made pretty simple compared to what it used to be. When you are ready to compile and flash your firmware, open up your terminal window and run the flash command:
|
||||
This has been made pretty simple compared to what it used to be. When you are ready to compile and flash your firmware, open up your terminal window and run the flash command:
|
||||
|
||||
qmk flash
|
||||
|
||||
If you have not configured your keyboard/keymap name, or you have multiple keyboards, you can specify the keyboard and keymap:
|
||||
If you have not configured your keyboard/keymap name in the CLI, or you have multiple keyboards, you can specify the keyboard and keymap:
|
||||
|
||||
qmk flash -kb <my_keyboard> -km <my_keymap>
|
||||
|
||||
This will check the keyboard's configuration, and then attempt to flash it based on the specified bootloader. This means that you don't need to know which bootloader that your keyboard uses. Just run the command, and let the command do the heavy lifting.
|
||||
This will check the keyboard's configuration, and then attempt to flash it based on the specified bootloader. This means that you don't need to know which bootloader that your keyboard uses. Just run the command, and let the command do the heavy lifting.
|
||||
|
||||
However, this does rely on the bootloader being set by the keyboard. If this information is not configured, or you're using a board that doesn't have a supported target to flash it, you will see this error:
|
||||
However, this does rely on the bootloader being set by the keyboard. If this information is not configured, or you're using a board that doesn't have a supported target to flash it, you will see this error:
|
||||
|
||||
WARNING: This board's bootloader is not specified or is not supported by the ":flash" target at this time.
|
||||
|
||||
|
||||
@@ -69,10 +69,21 @@ You will need to install Git and Python. It's very likely that you already have
|
||||
* Fedora / Red Hat / CentOS: `sudo yum install git python3 python3-pip`
|
||||
* Arch / Manjaro: `sudo pacman -S git python python-pip python-setuptools libffi`
|
||||
|
||||
|
||||
Install the global CLI to bootstrap your system:
|
||||
|
||||
`python3 -m pip install --user qmk` (on Arch-based distros you can also try the `qmk` package from AUR (**note**: it's maintained by a community member): `yay -S qmk`)
|
||||
`python3 -m pip install --user qmk` (on Arch-based distros you can also try the `qmk` package from AUR (**note**: it's maintained by a community member): `yay -S qmk`)
|
||||
|
||||
### FreeBSD
|
||||
|
||||
You will need to install Git and Python. It's possible that you already have both, but if not, run the following commands to install them:
|
||||
|
||||
pkg install git python3
|
||||
|
||||
Make sure that `$HOME/.local/bin` is added to your `$PATH` so that locally install Python packages are available.
|
||||
|
||||
Once installed, you can install QMK CLI:
|
||||
|
||||
python3 -m pip install --user qmk
|
||||
|
||||
## 3. Run QMK Setup :id=set-up-qmk
|
||||
|
||||
@@ -88,6 +99,12 @@ This is due to a [bug](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=839155)
|
||||
Sadly, Ubuntu reitroduced this bug and is [yet to fix it](https://bugs.launchpad.net/ubuntu/+source/bash/+bug/1588562).
|
||||
Luckily, the fix is easy. Run this as your user: `echo "PATH=$HOME/.local/bin:$PATH" >> $HOME/.bashrc && source $HOME/.bashrc`
|
||||
|
||||
?>**Note on FreeBSD**:
|
||||
It is suggested to run `qmk setup` as a non-`root` user to start with, but this will likely identify packages that need to be installed to your
|
||||
base system using `pkg`. However the installation will probably fail when run as an unprivileged user.
|
||||
To manually install the base dependencies, run `./util/qmk_install.sh` either as `root`, or with `sudo`.
|
||||
Once that completes, re-run `qmk setup` to complete the setup and checks.
|
||||
|
||||
?> If you already know [how to use GitHub](getting_started_github.md), we recommend that you create your own fork and use `qmk setup <github_username>/qmk_firmware` to clone your personal fork. If you don't know what that means you can safely ignore this message.
|
||||
|
||||
## 4. Test Your Build Environment
|
||||
|
||||
59
docs/serial_driver.md
Normal file
59
docs/serial_driver.md
Normal file
@@ -0,0 +1,59 @@
|
||||
# 'serial' Driver
|
||||
This driver powers the [Split Keyboard](feature_split_keyboard.md) feature.
|
||||
|
||||
!> Serial in this context should be read as **sending information one bit at a time**, rather than implementing UART/USART/RS485/RS232 standards.
|
||||
|
||||
All drivers in this category have the following characteristics:
|
||||
* Provides data and signaling over a single conductor
|
||||
* Limited to single master, single slave
|
||||
|
||||
## Supported Driver Types
|
||||
|
||||
| | AVR | ARM |
|
||||
|-------------------|--------------------|--------------------|
|
||||
| bit bang | :heavy_check_mark: | Soon™ |
|
||||
| USART Half-duplex | | :heavy_check_mark: |
|
||||
|
||||
## Driver configuration
|
||||
|
||||
### Bitbang
|
||||
Default driver, the absence of configuration assumes this driver. To configure it, add this to your rules.mk:
|
||||
|
||||
```make
|
||||
SERIAL_DRIVER = bitbang
|
||||
```
|
||||
|
||||
Configure the driver via your config.h:
|
||||
```c
|
||||
#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6
|
||||
#define SELECT_SOFT_SERIAL_SPEED 1 // or 0, 2, 3, 4, 5
|
||||
// 0: about 189kbps (Experimental only)
|
||||
// 1: about 137kbps (default)
|
||||
// 2: about 75kbps
|
||||
// 3: about 39kbps
|
||||
// 4: about 26kbps
|
||||
// 5: about 20kbps
|
||||
```
|
||||
|
||||
### USART Half-duplex
|
||||
Targeting STM32 boards where communication is offloaded to a USART hardware device. The advantage is that this provides fast and accurate timings. `SOFT_SERIAL_PIN` for this driver is the configured USART TX pin. **The TX pin must have appropriate pull-up resistors**. To configure it, add this to your rules.mk:
|
||||
|
||||
```make
|
||||
SERIAL_DRIVER = usart
|
||||
```
|
||||
|
||||
Configure the hardware via your config.h:
|
||||
```c
|
||||
#define SOFT_SERIAL_PIN B6 // USART TX pin
|
||||
#define SELECT_SOFT_SERIAL_SPEED 1 // or 0, 2, 3, 4, 5
|
||||
// 0: about 460800 baud
|
||||
// 1: about 230400 baud (default)
|
||||
// 2: about 115200 baud
|
||||
// 3: about 57600 baud
|
||||
// 4: about 38400 baud
|
||||
// 5: about 19200 baud
|
||||
#define SERIAL_USART_DRIVER SD1 // USART driver of TX pin. default: SD1
|
||||
#define SERIAL_USART_TX_PAL_MODE 7 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 7
|
||||
```
|
||||
|
||||
You must also turn on the SERIAL feature in your halconf.h and mcuconf.h
|
||||
290
drivers/chibios/serial.c
Normal file
290
drivers/chibios/serial.c
Normal file
@@ -0,0 +1,290 @@
|
||||
/*
|
||||
* WARNING: be careful changing this code, it is very timing dependent
|
||||
*/
|
||||
|
||||
#include "quantum.h"
|
||||
#include "serial.h"
|
||||
#include "wait.h"
|
||||
|
||||
#include "hal.h"
|
||||
|
||||
// TODO: resolve/remove build warnings
|
||||
#if defined(RGBLIGHT_ENABLE) && defined(RGBLED_SPLIT) && defined(PROTOCOL_CHIBIOS) && defined(WS2812_DRIVER_BITBANG)
|
||||
# warning "RGBLED_SPLIT not supported with bitbang WS2812 driver"
|
||||
#endif
|
||||
|
||||
// default wait implementation cannot be called within interrupt
|
||||
// this method seems to be more accurate than GPT timers
|
||||
#if PORT_SUPPORTS_RT == FALSE
|
||||
# error "chSysPolledDelayX method not supported on this platform"
|
||||
#else
|
||||
# undef wait_us
|
||||
# define wait_us(x) chSysPolledDelayX(US2RTC(STM32_SYSCLK, x))
|
||||
#endif
|
||||
|
||||
#ifndef SELECT_SOFT_SERIAL_SPEED
|
||||
# define SELECT_SOFT_SERIAL_SPEED 1
|
||||
// TODO: correct speeds...
|
||||
// 0: about 189kbps (Experimental only)
|
||||
// 1: about 137kbps (default)
|
||||
// 2: about 75kbps
|
||||
// 3: about 39kbps
|
||||
// 4: about 26kbps
|
||||
// 5: about 20kbps
|
||||
#endif
|
||||
|
||||
// Serial pulse period in microseconds. At the moment, going lower than 12 causes communication failure
|
||||
#if SELECT_SOFT_SERIAL_SPEED == 0
|
||||
# define SERIAL_DELAY 12
|
||||
#elif SELECT_SOFT_SERIAL_SPEED == 1
|
||||
# define SERIAL_DELAY 16
|
||||
#elif SELECT_SOFT_SERIAL_SPEED == 2
|
||||
# define SERIAL_DELAY 24
|
||||
#elif SELECT_SOFT_SERIAL_SPEED == 3
|
||||
# define SERIAL_DELAY 32
|
||||
#elif SELECT_SOFT_SERIAL_SPEED == 4
|
||||
# define SERIAL_DELAY 48
|
||||
#elif SELECT_SOFT_SERIAL_SPEED == 5
|
||||
# define SERIAL_DELAY 64
|
||||
#else
|
||||
# error invalid SELECT_SOFT_SERIAL_SPEED value
|
||||
#endif
|
||||
|
||||
inline static void serial_delay(void) { wait_us(SERIAL_DELAY); }
|
||||
inline static void serial_delay_half(void) { wait_us(SERIAL_DELAY / 2); }
|
||||
inline static void serial_delay_blip(void) { wait_us(1); }
|
||||
inline static void serial_output(void) { setPinOutput(SOFT_SERIAL_PIN); }
|
||||
inline static void serial_input(void) { setPinInputHigh(SOFT_SERIAL_PIN); }
|
||||
inline static bool serial_read_pin(void) { return !!readPin(SOFT_SERIAL_PIN); }
|
||||
inline static void serial_low(void) { writePinLow(SOFT_SERIAL_PIN); }
|
||||
inline static void serial_high(void) { writePinHigh(SOFT_SERIAL_PIN); }
|
||||
|
||||
void interrupt_handler(void *arg);
|
||||
|
||||
// Use thread + palWaitLineTimeout instead of palSetLineCallback
|
||||
// - Methods like setPinOutput and palEnableLineEvent/palDisableLineEvent
|
||||
// cause the interrupt to lock up, which would limit to only receiving data...
|
||||
static THD_WORKING_AREA(waThread1, 128);
|
||||
static THD_FUNCTION(Thread1, arg) {
|
||||
(void)arg;
|
||||
chRegSetThreadName("blinker");
|
||||
while (true) {
|
||||
palWaitLineTimeout(SOFT_SERIAL_PIN, TIME_INFINITE);
|
||||
interrupt_handler(NULL);
|
||||
}
|
||||
}
|
||||
|
||||
static SSTD_t *Transaction_table = NULL;
|
||||
static uint8_t Transaction_table_size = 0;
|
||||
|
||||
void soft_serial_initiator_init(SSTD_t *sstd_table, int sstd_table_size) {
|
||||
Transaction_table = sstd_table;
|
||||
Transaction_table_size = (uint8_t)sstd_table_size;
|
||||
|
||||
serial_output();
|
||||
serial_high();
|
||||
}
|
||||
|
||||
void soft_serial_target_init(SSTD_t *sstd_table, int sstd_table_size) {
|
||||
Transaction_table = sstd_table;
|
||||
Transaction_table_size = (uint8_t)sstd_table_size;
|
||||
|
||||
serial_input();
|
||||
|
||||
palEnablePadEvent(PAL_PORT(SOFT_SERIAL_PIN), PAL_PAD(SOFT_SERIAL_PIN), PAL_EVENT_MODE_FALLING_EDGE);
|
||||
chThdCreateStatic(waThread1, sizeof(waThread1), HIGHPRIO, Thread1, NULL);
|
||||
}
|
||||
|
||||
// Used by the master to synchronize timing with the slave.
|
||||
static void __attribute__((noinline)) sync_recv(void) {
|
||||
serial_input();
|
||||
// This shouldn't hang if the slave disconnects because the
|
||||
// serial line will float to high if the slave does disconnect.
|
||||
while (!serial_read_pin()) {
|
||||
}
|
||||
|
||||
serial_delay();
|
||||
}
|
||||
|
||||
// Used by the slave to send a synchronization signal to the master.
|
||||
static void __attribute__((noinline)) sync_send(void) {
|
||||
serial_output();
|
||||
|
||||
serial_low();
|
||||
serial_delay();
|
||||
|
||||
serial_high();
|
||||
}
|
||||
|
||||
// Reads a byte from the serial line
|
||||
static uint8_t __attribute__((noinline)) serial_read_byte(void) {
|
||||
uint8_t byte = 0;
|
||||
serial_input();
|
||||
for (uint8_t i = 0; i < 8; ++i) {
|
||||
byte = (byte << 1) | serial_read_pin();
|
||||
serial_delay();
|
||||
}
|
||||
|
||||
return byte;
|
||||
}
|
||||
|
||||
// Sends a byte with MSB ordering
|
||||
static void __attribute__((noinline)) serial_write_byte(uint8_t data) {
|
||||
uint8_t b = 8;
|
||||
serial_output();
|
||||
while (b--) {
|
||||
if (data & (1 << b)) {
|
||||
serial_high();
|
||||
} else {
|
||||
serial_low();
|
||||
}
|
||||
serial_delay();
|
||||
}
|
||||
}
|
||||
|
||||
// interrupt handle to be used by the slave device
|
||||
void interrupt_handler(void *arg) {
|
||||
chSysLockFromISR();
|
||||
|
||||
sync_send();
|
||||
|
||||
// read mid pulses
|
||||
serial_delay_blip();
|
||||
|
||||
uint8_t checksum_computed = 0;
|
||||
int sstd_index = 0;
|
||||
|
||||
#ifdef SERIAL_USE_MULTI_TRANSACTION
|
||||
sstd_index = serial_read_byte();
|
||||
sync_send();
|
||||
#endif
|
||||
|
||||
SSTD_t *trans = &Transaction_table[sstd_index];
|
||||
for (int i = 0; i < trans->initiator2target_buffer_size; ++i) {
|
||||
trans->initiator2target_buffer[i] = serial_read_byte();
|
||||
sync_send();
|
||||
checksum_computed += trans->initiator2target_buffer[i];
|
||||
}
|
||||
checksum_computed ^= 7;
|
||||
uint8_t checksum_received = serial_read_byte();
|
||||
sync_send();
|
||||
|
||||
// wait for the sync to finish sending
|
||||
serial_delay();
|
||||
|
||||
uint8_t checksum = 0;
|
||||
for (int i = 0; i < trans->target2initiator_buffer_size; ++i) {
|
||||
serial_write_byte(trans->target2initiator_buffer[i]);
|
||||
sync_send();
|
||||
serial_delay_half();
|
||||
checksum += trans->target2initiator_buffer[i];
|
||||
}
|
||||
serial_write_byte(checksum ^ 7);
|
||||
sync_send();
|
||||
|
||||
// wait for the sync to finish sending
|
||||
serial_delay();
|
||||
|
||||
*trans->status = (checksum_computed == checksum_received) ? TRANSACTION_ACCEPTED : TRANSACTION_DATA_ERROR;
|
||||
|
||||
// end transaction
|
||||
serial_input();
|
||||
|
||||
// TODO: remove extra delay between transactions
|
||||
serial_delay();
|
||||
|
||||
chSysUnlockFromISR();
|
||||
}
|
||||
|
||||
/////////
|
||||
// start transaction by initiator
|
||||
//
|
||||
// int soft_serial_transaction(int sstd_index)
|
||||
//
|
||||
// Returns:
|
||||
// TRANSACTION_END
|
||||
// TRANSACTION_NO_RESPONSE
|
||||
// TRANSACTION_DATA_ERROR
|
||||
// this code is very time dependent, so we need to disable interrupts
|
||||
#ifndef SERIAL_USE_MULTI_TRANSACTION
|
||||
int soft_serial_transaction(void) {
|
||||
int sstd_index = 0;
|
||||
#else
|
||||
int soft_serial_transaction(int sstd_index) {
|
||||
#endif
|
||||
|
||||
if (sstd_index > Transaction_table_size) return TRANSACTION_TYPE_ERROR;
|
||||
SSTD_t *trans = &Transaction_table[sstd_index];
|
||||
|
||||
// TODO: remove extra delay between transactions
|
||||
serial_delay();
|
||||
|
||||
// this code is very time dependent, so we need to disable interrupts
|
||||
chSysLock();
|
||||
|
||||
// signal to the slave that we want to start a transaction
|
||||
serial_output();
|
||||
serial_low();
|
||||
serial_delay_blip();
|
||||
|
||||
// wait for the slaves response
|
||||
serial_input();
|
||||
serial_high();
|
||||
serial_delay();
|
||||
|
||||
// check if the slave is present
|
||||
if (serial_read_pin()) {
|
||||
// slave failed to pull the line low, assume not present
|
||||
dprintf("serial::NO_RESPONSE\n");
|
||||
chSysUnlock();
|
||||
return TRANSACTION_NO_RESPONSE;
|
||||
}
|
||||
|
||||
// if the slave is present syncronize with it
|
||||
|
||||
uint8_t checksum = 0;
|
||||
// send data to the slave
|
||||
#ifdef SERIAL_USE_MULTI_TRANSACTION
|
||||
serial_write_byte(sstd_index); // first chunk is transaction id
|
||||
sync_recv();
|
||||
#endif
|
||||
for (int i = 0; i < trans->initiator2target_buffer_size; ++i) {
|
||||
serial_write_byte(trans->initiator2target_buffer[i]);
|
||||
sync_recv();
|
||||
checksum += trans->initiator2target_buffer[i];
|
||||
}
|
||||
serial_write_byte(checksum ^ 7);
|
||||
sync_recv();
|
||||
|
||||
serial_delay();
|
||||
serial_delay(); // read mid pulses
|
||||
|
||||
// receive data from the slave
|
||||
uint8_t checksum_computed = 0;
|
||||
for (int i = 0; i < trans->target2initiator_buffer_size; ++i) {
|
||||
trans->target2initiator_buffer[i] = serial_read_byte();
|
||||
sync_recv();
|
||||
checksum_computed += trans->target2initiator_buffer[i];
|
||||
}
|
||||
checksum_computed ^= 7;
|
||||
uint8_t checksum_received = serial_read_byte();
|
||||
|
||||
sync_recv();
|
||||
serial_delay();
|
||||
|
||||
if ((checksum_computed) != (checksum_received)) {
|
||||
dprintf("serial::FAIL[%u,%u,%u]\n", checksum_computed, checksum_received, sstd_index);
|
||||
serial_output();
|
||||
serial_high();
|
||||
|
||||
chSysUnlock();
|
||||
return TRANSACTION_DATA_ERROR;
|
||||
}
|
||||
|
||||
// always, release the line when not in use
|
||||
serial_high();
|
||||
serial_output();
|
||||
|
||||
chSysUnlock();
|
||||
return TRANSACTION_END;
|
||||
}
|
||||
62
drivers/chibios/serial.h
Normal file
62
drivers/chibios/serial.h
Normal file
@@ -0,0 +1,62 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
// /////////////////////////////////////////////////////////////////
|
||||
// Need Soft Serial defines in config.h
|
||||
// /////////////////////////////////////////////////////////////////
|
||||
// ex.
|
||||
// #define SOFT_SERIAL_PIN ?? // ?? = D0,D1,D2,D3,E6
|
||||
// OPTIONAL: #define SELECT_SOFT_SERIAL_SPEED ? // ? = 1,2,3,4,5
|
||||
// // 1: about 137kbps (default)
|
||||
// // 2: about 75kbps
|
||||
// // 3: about 39kbps
|
||||
// // 4: about 26kbps
|
||||
// // 5: about 20kbps
|
||||
//
|
||||
// //// USE simple API (using signle-type transaction function)
|
||||
// /* nothing */
|
||||
// //// USE flexible API (using multi-type transaction function)
|
||||
// #define SERIAL_USE_MULTI_TRANSACTION
|
||||
//
|
||||
// /////////////////////////////////////////////////////////////////
|
||||
|
||||
// Soft Serial Transaction Descriptor
|
||||
typedef struct _SSTD_t {
|
||||
uint8_t *status;
|
||||
uint8_t initiator2target_buffer_size;
|
||||
uint8_t *initiator2target_buffer;
|
||||
uint8_t target2initiator_buffer_size;
|
||||
uint8_t *target2initiator_buffer;
|
||||
} SSTD_t;
|
||||
#define TID_LIMIT(table) (sizeof(table) / sizeof(SSTD_t))
|
||||
|
||||
// initiator is transaction start side
|
||||
void soft_serial_initiator_init(SSTD_t *sstd_table, int sstd_table_size);
|
||||
// target is interrupt accept side
|
||||
void soft_serial_target_init(SSTD_t *sstd_table, int sstd_table_size);
|
||||
|
||||
// initiator result
|
||||
#define TRANSACTION_END 0
|
||||
#define TRANSACTION_NO_RESPONSE 0x1
|
||||
#define TRANSACTION_DATA_ERROR 0x2
|
||||
#define TRANSACTION_TYPE_ERROR 0x4
|
||||
#ifndef SERIAL_USE_MULTI_TRANSACTION
|
||||
int soft_serial_transaction(void);
|
||||
#else
|
||||
int soft_serial_transaction(int sstd_index);
|
||||
#endif
|
||||
|
||||
// target status
|
||||
// *SSTD_t.status has
|
||||
// initiator:
|
||||
// TRANSACTION_END
|
||||
// or TRANSACTION_NO_RESPONSE
|
||||
// or TRANSACTION_DATA_ERROR
|
||||
// target:
|
||||
// TRANSACTION_DATA_ERROR
|
||||
// or TRANSACTION_ACCEPTED
|
||||
#define TRANSACTION_ACCEPTED 0x8
|
||||
#ifdef SERIAL_USE_MULTI_TRANSACTION
|
||||
int soft_serial_get_and_clean_status(int sstd_index);
|
||||
#endif
|
||||
234
drivers/chibios/serial_usart.c
Normal file
234
drivers/chibios/serial_usart.c
Normal file
@@ -0,0 +1,234 @@
|
||||
#include "quantum.h"
|
||||
#include "serial.h"
|
||||
#include "printf.h"
|
||||
|
||||
#include "ch.h"
|
||||
#include "hal.h"
|
||||
|
||||
#ifndef USART_CR1_M0
|
||||
# define USART_CR1_M0 USART_CR1_M // some platforms (f1xx) dont have this so
|
||||
#endif
|
||||
|
||||
#ifndef USE_GPIOV1
|
||||
// The default PAL alternate modes are used to signal that the pins are used for USART
|
||||
# ifndef SERIAL_USART_TX_PAL_MODE
|
||||
# define SERIAL_USART_TX_PAL_MODE 7
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef SERIAL_USART_DRIVER
|
||||
# define SERIAL_USART_DRIVER SD1
|
||||
#endif
|
||||
|
||||
#ifndef SERIAL_USART_CR1
|
||||
# define SERIAL_USART_CR1 (USART_CR1_PCE | USART_CR1_PS | USART_CR1_M0) // parity enable, odd parity, 9 bit length
|
||||
#endif
|
||||
|
||||
#ifndef SERIAL_USART_CR2
|
||||
# define SERIAL_USART_CR2 (USART_CR2_STOP_1) // 2 stop bits
|
||||
#endif
|
||||
|
||||
#ifndef SERIAL_USART_CR3
|
||||
# define SERIAL_USART_CR3 0
|
||||
#endif
|
||||
|
||||
#ifdef SOFT_SERIAL_PIN
|
||||
# define SERIAL_USART_TX_PIN SOFT_SERIAL_PIN
|
||||
#endif
|
||||
|
||||
#ifndef SELECT_SOFT_SERIAL_SPEED
|
||||
# define SELECT_SOFT_SERIAL_SPEED 1
|
||||
#endif
|
||||
|
||||
#ifdef SERIAL_USART_SPEED
|
||||
// Allow advanced users to directly set SERIAL_USART_SPEED
|
||||
#elif SELECT_SOFT_SERIAL_SPEED == 0
|
||||
# define SERIAL_USART_SPEED 460800
|
||||
#elif SELECT_SOFT_SERIAL_SPEED == 1
|
||||
# define SERIAL_USART_SPEED 230400
|
||||
#elif SELECT_SOFT_SERIAL_SPEED == 2
|
||||
# define SERIAL_USART_SPEED 115200
|
||||
#elif SELECT_SOFT_SERIAL_SPEED == 3
|
||||
# define SERIAL_USART_SPEED 57600
|
||||
#elif SELECT_SOFT_SERIAL_SPEED == 4
|
||||
# define SERIAL_USART_SPEED 38400
|
||||
#elif SELECT_SOFT_SERIAL_SPEED == 5
|
||||
# define SERIAL_USART_SPEED 19200
|
||||
#else
|
||||
# error invalid SELECT_SOFT_SERIAL_SPEED value
|
||||
#endif
|
||||
|
||||
#define TIMEOUT 100
|
||||
#define HANDSHAKE_MAGIC 7
|
||||
|
||||
static inline msg_t sdWriteHalfDuplex(SerialDriver* driver, uint8_t* data, uint8_t size) {
|
||||
msg_t ret = sdWrite(driver, data, size);
|
||||
|
||||
// Half duplex requires us to read back the data we just wrote - just throw it away
|
||||
uint8_t dump[size];
|
||||
sdRead(driver, dump, size);
|
||||
|
||||
return ret;
|
||||
}
|
||||
#undef sdWrite
|
||||
#define sdWrite sdWriteHalfDuplex
|
||||
|
||||
static inline msg_t sdWriteTimeoutHalfDuplex(SerialDriver* driver, uint8_t* data, uint8_t size, uint32_t timeout) {
|
||||
msg_t ret = sdWriteTimeout(driver, data, size, timeout);
|
||||
|
||||
// Half duplex requires us to read back the data we just wrote - just throw it away
|
||||
uint8_t dump[size];
|
||||
sdReadTimeout(driver, dump, size, timeout);
|
||||
|
||||
return ret;
|
||||
}
|
||||
#undef sdWriteTimeout
|
||||
#define sdWriteTimeout sdWriteTimeoutHalfDuplex
|
||||
|
||||
static inline void sdClear(SerialDriver* driver) {
|
||||
while (sdGetTimeout(driver, TIME_IMMEDIATE) != MSG_TIMEOUT) {
|
||||
// Do nothing with the data
|
||||
}
|
||||
}
|
||||
|
||||
static SerialConfig sdcfg = {
|
||||
(SERIAL_USART_SPEED), // speed - mandatory
|
||||
(SERIAL_USART_CR1), // CR1
|
||||
(SERIAL_USART_CR2), // CR2
|
||||
(SERIAL_USART_CR3) // CR3
|
||||
};
|
||||
|
||||
void handle_soft_serial_slave(void);
|
||||
|
||||
/*
|
||||
* This thread runs on the slave and responds to transactions initiated
|
||||
* by the master
|
||||
*/
|
||||
static THD_WORKING_AREA(waSlaveThread, 2048);
|
||||
static THD_FUNCTION(SlaveThread, arg) {
|
||||
(void)arg;
|
||||
chRegSetThreadName("slave_transport");
|
||||
|
||||
while (true) {
|
||||
handle_soft_serial_slave();
|
||||
}
|
||||
}
|
||||
|
||||
__attribute__((weak)) void usart_init(void) {
|
||||
#if defined(USE_GPIOV1)
|
||||
palSetLineMode(SERIAL_USART_TX_PIN, PAL_MODE_STM32_ALTERNATE_OPENDRAIN);
|
||||
#else
|
||||
palSetLineMode(SERIAL_USART_TX_PIN, PAL_MODE_ALTERNATE(SERIAL_USART_TX_PAL_MODE) | PAL_STM32_OTYPE_OPENDRAIN);
|
||||
#endif
|
||||
}
|
||||
|
||||
void usart_master_init(void) {
|
||||
usart_init();
|
||||
|
||||
sdcfg.cr3 |= USART_CR3_HDSEL;
|
||||
sdStart(&SERIAL_USART_DRIVER, &sdcfg);
|
||||
}
|
||||
|
||||
void usart_slave_init(void) {
|
||||
usart_init();
|
||||
|
||||
sdcfg.cr3 |= USART_CR3_HDSEL;
|
||||
sdStart(&SERIAL_USART_DRIVER, &sdcfg);
|
||||
|
||||
// Start transport thread
|
||||
chThdCreateStatic(waSlaveThread, sizeof(waSlaveThread), HIGHPRIO, SlaveThread, NULL);
|
||||
}
|
||||
|
||||
static SSTD_t* Transaction_table = NULL;
|
||||
static uint8_t Transaction_table_size = 0;
|
||||
|
||||
void soft_serial_initiator_init(SSTD_t* sstd_table, int sstd_table_size) {
|
||||
Transaction_table = sstd_table;
|
||||
Transaction_table_size = (uint8_t)sstd_table_size;
|
||||
|
||||
usart_master_init();
|
||||
}
|
||||
|
||||
void soft_serial_target_init(SSTD_t* sstd_table, int sstd_table_size) {
|
||||
Transaction_table = sstd_table;
|
||||
Transaction_table_size = (uint8_t)sstd_table_size;
|
||||
|
||||
usart_slave_init();
|
||||
}
|
||||
|
||||
void handle_soft_serial_slave(void) {
|
||||
uint8_t sstd_index = sdGet(&SERIAL_USART_DRIVER); // first chunk is always transaction id
|
||||
SSTD_t* trans = &Transaction_table[sstd_index];
|
||||
|
||||
// Always write back the sstd_index as part of a basic handshake
|
||||
sstd_index ^= HANDSHAKE_MAGIC;
|
||||
sdWrite(&SERIAL_USART_DRIVER, &sstd_index, sizeof(sstd_index));
|
||||
|
||||
if (trans->initiator2target_buffer_size) {
|
||||
sdRead(&SERIAL_USART_DRIVER, trans->initiator2target_buffer, trans->initiator2target_buffer_size);
|
||||
}
|
||||
|
||||
if (trans->target2initiator_buffer_size) {
|
||||
sdWrite(&SERIAL_USART_DRIVER, trans->target2initiator_buffer, trans->target2initiator_buffer_size);
|
||||
}
|
||||
|
||||
if (trans->status) {
|
||||
*trans->status = TRANSACTION_ACCEPTED;
|
||||
}
|
||||
}
|
||||
|
||||
/////////
|
||||
// start transaction by initiator
|
||||
//
|
||||
// int soft_serial_transaction(int sstd_index)
|
||||
//
|
||||
// Returns:
|
||||
// TRANSACTION_END
|
||||
// TRANSACTION_NO_RESPONSE
|
||||
// TRANSACTION_DATA_ERROR
|
||||
#ifndef SERIAL_USE_MULTI_TRANSACTION
|
||||
int soft_serial_transaction(void) {
|
||||
uint8_t sstd_index = 0;
|
||||
#else
|
||||
int soft_serial_transaction(int index) {
|
||||
uint8_t sstd_index = index;
|
||||
#endif
|
||||
|
||||
if (sstd_index > Transaction_table_size) return TRANSACTION_TYPE_ERROR;
|
||||
SSTD_t* trans = &Transaction_table[sstd_index];
|
||||
msg_t res = 0;
|
||||
|
||||
sdClear(&SERIAL_USART_DRIVER);
|
||||
|
||||
// First chunk is always transaction id
|
||||
sdWriteTimeout(&SERIAL_USART_DRIVER, &sstd_index, sizeof(sstd_index), TIME_MS2I(TIMEOUT));
|
||||
|
||||
uint8_t sstd_index_shake = 0xFF;
|
||||
|
||||
// Which we always read back first so that we can error out correctly
|
||||
// - due to the half duplex limitations on return codes, we always have to read *something*
|
||||
// - without the read, write only transactions *always* succeed, even during the boot process where the slave is not ready
|
||||
res = sdReadTimeout(&SERIAL_USART_DRIVER, &sstd_index_shake, sizeof(sstd_index_shake), TIME_MS2I(TIMEOUT));
|
||||
if (res < 0 || (sstd_index_shake != (sstd_index ^ HANDSHAKE_MAGIC))) {
|
||||
dprintf("serial::usart_shake NO_RESPONSE\n");
|
||||
return TRANSACTION_NO_RESPONSE;
|
||||
}
|
||||
|
||||
if (trans->initiator2target_buffer_size) {
|
||||
res = sdWriteTimeout(&SERIAL_USART_DRIVER, trans->initiator2target_buffer, trans->initiator2target_buffer_size, TIME_MS2I(TIMEOUT));
|
||||
if (res < 0) {
|
||||
dprintf("serial::usart_transmit NO_RESPONSE\n");
|
||||
return TRANSACTION_NO_RESPONSE;
|
||||
}
|
||||
}
|
||||
|
||||
if (trans->target2initiator_buffer_size) {
|
||||
res = sdReadTimeout(&SERIAL_USART_DRIVER, trans->target2initiator_buffer, trans->target2initiator_buffer_size, TIME_MS2I(TIMEOUT));
|
||||
if (res < 0) {
|
||||
dprintf("serial::usart_receive NO_RESPONSE\n");
|
||||
return TRANSACTION_NO_RESPONSE;
|
||||
}
|
||||
}
|
||||
|
||||
return TRANSACTION_END;
|
||||
}
|
||||
@@ -16,7 +16,8 @@
|
||||
|
||||
|
||||
/*
|
||||
* see jj40/stevexyz for more information
|
||||
* The 25% SuperMicro keyboard: a pure - full features - "Alpha 26" keymap on Gherkin, compatible also with 28 and 30 keys layouts
|
||||
* See https://github.com/stevexyz/qmk_firmware/blob/master/keyboards/40percentclub/gherkin/keymaps/stevexyz/readme.md for more information
|
||||
*/
|
||||
|
||||
|
||||
@@ -56,7 +57,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
* ,---------------------------------------------------------------------.
|
||||
* | | | | | | | | | | |
|
||||
* | Q | W | E | R | T | Y | U | I | O | P |
|
||||
* | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ |
|
||||
* | ____ | ____ | ____ | ____ | ____ | FnNav|NumSym| Alt | Ctrl | Shift|
|
||||
* |------+------+------+------+-------------+------+------+------+------|
|
||||
* | | | | | | | | | | |
|
||||
* | A | S | D | F | G | H | J | K | L | Enter|
|
||||
@@ -68,83 +69,73 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
* '-------------------------------------------------------'
|
||||
*/
|
||||
[LAYER_HOME] = LAYOUT_ortho_3x10(
|
||||
LT(LAYER_ARROWPAD, KC_Q), LT(LAYER_NUMPAD, KC_W), LT(LAYER_MEDIAPAD, KC_E), KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P,
|
||||
MT(MOD_LSFT, KC_A), LT(LAYER_FUNC, KC_S), LT(LAYER_NUMSYM, KC_D), MT(MOD_RALT, KC_F), MT(MOD_LGUI, KC_G), MT(MOD_RGUI, KC_H), MT(MOD_RALT, KC_J), LT(LAYER_FUNC, KC_K), LT(LAYER_NUMSYM, KC_L), MT(MOD_RSFT, KC_ENT),
|
||||
XXXXXXX, MT(MOD_LCTL, KC_Z), MT(MOD_LALT, KC_X), LT(LAYER_FUNC, KC_C), LT(LAYER_NUMSYM, KC_V), MT(MOD_LSFT, KC_B), MT(MOD_LALT, KC_N), MT(MOD_RCTL, KC_M), MT(MOD_RSFT, KC_SPC), XXXXXXX ),
|
||||
LT(LAYER_ARROWPAD, KC_Q), LT(LAYER_NUMPAD, KC_W), LT(LAYER_MEDIAPAD, KC_E), KC_R, KC_T, LT(LAYER_FUNC, KC_Y), LT(LAYER_NUMSYM, KC_U), MT(MOD_LALT, KC_I), MT(MOD_RCTL, KC_O), MT(MOD_RSFT, KC_P),
|
||||
MT(MOD_LSFT, KC_A), LT(LAYER_FUNC, KC_S), LT(LAYER_NUMSYM, KC_D), MT(MOD_RALT, KC_F), MT(MOD_LGUI, KC_G), MT(MOD_RGUI, KC_H), MT(MOD_RALT, KC_J), LT(LAYER_FUNC, KC_K), LT(LAYER_NUMSYM, KC_L), MT(MOD_RSFT, KC_ENT),
|
||||
KC_DOWN, MT(MOD_LCTL, KC_Z), MT(MOD_LALT, KC_X), LT(LAYER_FUNC, KC_C), LT(LAYER_NUMSYM, KC_V), MT(MOD_LSFT, KC_B), MT(MOD_LALT, KC_N), MT(MOD_RCTL, KC_M), MT(MOD_RSFT, KC_SPC), KC_BSPC
|
||||
),
|
||||
|
||||
/* Function and Navigation Layer
|
||||
* ,---------------------------------------------------------------------.
|
||||
* | | | | | | | | | | |
|
||||
* | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 |
|
||||
* | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ |
|
||||
* | ____ | ____ | ____ | ____ | ____ | ____ |SysLay| Alt | Ctrl | Shift|
|
||||
* |------+------+------+------+-------------+------+------+------+------|
|
||||
* | | | | | | | | | | |
|
||||
* | ESC | Home | PgDn | PgUp | End | Left | Down | Up | Right| Baksp|
|
||||
* | ESC | Home | PgDn | PgUp | End | Left | Down | Up | Right|Backsp|
|
||||
* | Shift| ____ |SysLay| AltGr| OSkey| OSkey| AltGr| ____ |SysLay| Shift|
|
||||
* '------+------+------+------+------+------|------+------+------+------'
|
||||
* | | | | | | | | |
|
||||
* | ____ | ____ | | ____ | ____ | ____ | ____ | ____ |
|
||||
* | F11 | F12 | | Space|PrnScr|ScrLck|Pause |Backsp|
|
||||
* | Ctrl | Alt | ____ |SysLay| Shift| Alt | Ctrl | Shift|
|
||||
* '-------------------------------------------------------'
|
||||
*/
|
||||
[LAYER_FUNC] = LAYOUT_ortho_3x10(
|
||||
KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10,
|
||||
MT(MOD_LSFT, KC_ESC), KC_HOME, LT(LAYER_SYST, KC_PGDN), MT(MOD_RALT, KC_PGUP), MT(MOD_LGUI, KC_END), MT(MOD_RGUI, KC_LEFT), MT(MOD_RALT, KC_DOWN), KC_UP, LT(LAYER_SYST, KC_RGHT), MT(MOD_RSFT, KC_BSPC),
|
||||
XXXXXXX, KC_LCTL, KC_LALT, KC_NO, MO(LAYER_SYST), KC_LSFT, KC_LALT, KC_RCTL, MT(MOD_RSFT, KC_SPC), XXXXXXX ),
|
||||
KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, LT(LAYER_SYST, KC_F7), MT(MOD_LALT, KC_F8), MT(MOD_RCTL,KC_F9), MT(MOD_RSFT, KC_F10),
|
||||
MT(MOD_LSFT, KC_ESC), KC_HOME, LT(LAYER_SYST, KC_PGDN), MT(MOD_RALT, KC_PGUP), MT(MOD_LGUI, KC_END), MT(MOD_RGUI, KC_LEFT), MT(MOD_RALT, KC_DOWN), KC_UP, LT(LAYER_SYST, KC_RGHT), MT(MOD_RSFT, KC_BSPC),
|
||||
KC_DOWN, MT(KC_LCTL, KC_F11), MT(KC_LALT, KC_F12), KC_NO, LT(LAYER_SYST, KC_SPACE), MT(KC_LSFT, KC_PSCR), MT(KC_LALT, KC_SLCK), MT(KC_RCTL, KC_PAUS), MT(MOD_RSFT, KC_BSPC), KC_UP
|
||||
),
|
||||
|
||||
/* Number and Symbols Layer
|
||||
* ,---------------------------------------------------------------------.
|
||||
* | ! | @ | # | $ | % | ^ | & | * | ( | ) |
|
||||
* | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 |
|
||||
* | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ |
|
||||
* | ____ | ____ | ____ | ____ | ____ |SysLay| ____ | Alt | Ctrl | Shift|
|
||||
* |------+------+------+------+-------------+------+------+------+------|
|
||||
* | | ~ | _ | + | { | } | | | : | " | |
|
||||
* | TAB | ` | - | = | [ | ] | \ | ; | ' | Del |
|
||||
* | Shift|SysLay| ____ | AltGr| OSkey| OSkey| AltGr|SysLay| ____ | Shift|
|
||||
* ' -----+------+------+------+------+------|------+------+------+------'
|
||||
* | | | | | < | > | ? | |
|
||||
* | ____ | ____ | ____ | | , | . | / | ____ |
|
||||
* |BackSp| Del | Enter| | , | . | / | Enter|
|
||||
* | Ctrl | Alt |SysLay| ____ | Shift| Alt | Ctrl | Shift|
|
||||
* '-------------------------------------------------------'
|
||||
*/
|
||||
[LAYER_NUMSYM] = LAYOUT_ortho_3x10(
|
||||
KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0,
|
||||
MT(MOD_LSFT, KC_TAB), LT(LAYER_SYST, KC_GRV), KC_MINS, MT(MOD_RALT, KC_EQL), MT(MOD_LGUI, KC_LBRC), MT(MOD_RGUI, KC_RBRC), MT(MOD_RALT, KC_BSLS), LT(LAYER_SYST, KC_SCLN), KC_QUOT, MT(MOD_RSFT, KC_DEL),
|
||||
XXXXXXX, KC_LCTL, KC_LALT, MO(LAYER_SYST), KC_NO, MT(MOD_LSFT, KC_COMM), MT(MOD_LALT, KC_DOT), MT(MOD_RCTL, KC_SLSH), MT(MOD_RSFT, KC_SPC), XXXXXXX ),
|
||||
KC_1, KC_2, KC_3, KC_4, KC_5, LT(LAYER_SYST, KC_6), KC_7, MT(MOD_LALT, KC_8), MT(MOD_RCTL,KC_9), MT(MOD_RSFT, KC_0),
|
||||
MT(MOD_LSFT, KC_TAB), LT(LAYER_SYST, KC_GRV), KC_MINS, MT(MOD_RALT, KC_EQL), MT(MOD_LGUI, KC_LBRC), MT(MOD_RGUI, KC_RBRC), MT(MOD_RALT, KC_BSLS), LT(LAYER_SYST, KC_SCLN), KC_QUOT, MT(MOD_RSFT, KC_DEL),
|
||||
KC_LEFT, MT(KC_LCTL, KC_BSPC), MT(KC_LALT, KC_DEL), LT(LAYER_SYST, KC_ENT), KC_NO, MT(MOD_LSFT, KC_COMM), MT(MOD_LALT, KC_DOT), MT(MOD_RCTL, KC_SLSH), MT(MOD_RSFT, KC_ENT), KC_RGHT
|
||||
),
|
||||
|
||||
/* System Layer
|
||||
* ,---------------------------------------------------------------------.
|
||||
* | | | | | | | | | | |
|
||||
* | F11 | F12 | Play | Next |MsWhlU|MsBtn1|OSMenu|SysReq|MsBtn2|Backsp|
|
||||
* | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ |
|
||||
* | Play | Stop | Prev | Next |MsBtn1|MsLeft|MSDown| MsUp |MsRigh|MsBtn2|
|
||||
* | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ | Shift|
|
||||
* |------+------+------+------+-------------+------+------+------+------|
|
||||
* | | | | | | | | | | |
|
||||
* | Caps | Mute | Vol- | Vol+ |MsWhlD|MsLeft|MSDown| MsUp |MsRigh| Ins |
|
||||
* | Shift| ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ | Shift|
|
||||
* |Backsp| Mute | Vol- | Vol+ |MsWhlD| Left | Down | Up | Right|Backsp|
|
||||
* | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ |
|
||||
* '------+------+------+------+------+------|------+------+------+------'
|
||||
* | | | | | | | | |
|
||||
* | ____ | ____ | | |PrnScr|ScrLck|Pause | ____ |
|
||||
* | Ctrl | Alt | ____ | ____ | ____ | ____ | ____ | Shift|
|
||||
* '-------------------------------------------------------'
|
||||
* simplified view (for media and mouse there are dedicated layers)
|
||||
* ,---------------------------------------------------------------------.
|
||||
* | | | | | | | | | | |
|
||||
* | F11 | F12 | | | | |OSMenu|SysReq| |Backsp|
|
||||
* | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ |
|
||||
* |------+------+------+------+-------------+------+------+------+------|
|
||||
* | | | | | | | | | | |
|
||||
* | Caps | | | | | | | | | Ins |
|
||||
* | Shift| ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ | Shift|
|
||||
* '------+------+------+------+------+------|------+------+------+------+
|
||||
* | | | | | | | | |
|
||||
* | | | | |PrnScr|ScrLck|Pause | |
|
||||
* | Ctrl | Alt | ____ | ____ | ____ | ____ | ____ | Shift|
|
||||
* | ____ | ____ | Enter| Space| Mute | Vol- | Vol+ | Space|
|
||||
* | Ctrl | Alt | ____ | ____ | Shift| Alt | Ctrl | ____ |
|
||||
* '-------------------------------------------------------'
|
||||
*/
|
||||
[LAYER_SYST] = LAYOUT_ortho_3x10(
|
||||
KC_F11, KC_F12, KC_MPLY, KC_MNXT, KC_MS_WH_UP, KC_MS_BTN1, KC_APP, KC_SYSREQ, KC_MS_BTN2, KC_BSPC,
|
||||
MT(MOD_LSFT, KC_CAPS), KC_MUTE, KC_VOLD, KC_VOLU, KC_MS_WH_DOWN, KC_MS_LEFT, KC_MS_DOWN, KC_MS_UP, KC_MS_RIGHT, MT(MOD_RSFT, KC_INS),
|
||||
XXXXXXX, KC_LCTL, KC_LALT, KC_NO, KC_NO, KC_PSCR, KC_SLCK, KC_PAUS, MT(MOD_RSFT, KC_SPC), XXXXXXX ),
|
||||
KC_MPLY, KC_STOP, KC_MPRV, KC_MNXT, KC_MS_BTN1, KC_MS_LEFT, KC_MS_DOWN, KC_MS_UP, KC_MS_RIGHT, MT(MOD_RSFT, KC_MS_BTN2),
|
||||
KC_BSPC, KC_DEL, KC_PGDN, KC_PGUP, KC_APP, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_BSPC,
|
||||
KC_PGDN, MT(KC_LCTL, KC_CAPS), MT(KC_LALT, KC_INS), KC_ENT, KC_SPC, MT(MOD_RSFT, KC_MUTE), MT(MOD_LALT, KC_VOLD), MT(MOD_RCTL, KC_VOLU), KC_SPC, KC_PGUP
|
||||
),
|
||||
|
||||
/* ArrowPad (mod su Q) /------mouse-------\ /-----cursor-------\
|
||||
* ,---------------------------------------------------------------------.
|
||||
@@ -157,23 +148,24 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
* | Shift| ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ |
|
||||
* '------+------+------+------+------+------|------+------+------+------'
|
||||
* | | | | | | | | |
|
||||
* | | |MsWhlU|MsDown|MsWhlD| End | Down | PdDn |
|
||||
* | | |MsWhlU|MsDown|MsWhlD| End | PgDn | PgDn |
|
||||
* | Ctrl | Alt | ____ | ____ | ____ | ____ | ____ | ____ |
|
||||
* '-------------------------------------------------------'
|
||||
*/
|
||||
[LAYER_ARROWPAD] = LAYOUT_ortho_3x10(
|
||||
KC_NO, KC_NO, KC_NO, KC_MS_BTN1, KC_MS_UP, KC_MS_BTN2, KC_HOME, KC_UP, KC_PGUP, KC_BSPC,
|
||||
KC_LSFT, KC_NO, KC_NO, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, KC_LEFT, KC_DOWN, KC_RIGHT, KC_ENT,
|
||||
XXXXXXX, KC_LCTL, KC_LALT, KC_MS_WH_UP, KC_MS_DOWN, KC_MS_WH_DOWN, KC_END, KC_DOWN, KC_PGDN, XXXXXXX ),
|
||||
KC_NO, KC_NO, KC_NO, KC_MS_BTN1, KC_MS_UP, KC_MS_BTN2, KC_HOME, KC_UP, KC_PGUP, KC_BSPC,
|
||||
KC_LSFT, KC_NO, KC_NO, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, KC_LEFT, KC_DOWN, KC_RIGHT, KC_ENT,
|
||||
XXXXXXX, KC_LCTL, KC_LALT, KC_MS_WH_UP, KC_MS_DOWN, KC_MS_WH_DOWN, KC_END, KC_PGDN, KC_PGDN, XXXXXXX
|
||||
),
|
||||
|
||||
/* NumPad (mod su W)
|
||||
* ,---------------------------------------------------------------------.
|
||||
* | | | | | | | | | | |
|
||||
* | | | / | * | - |Backsp| 7 | 8 | 9 | 0 |
|
||||
* | | | 3 | * | - |Backsp| 7 | 8 | 9 | 0 |
|
||||
* | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ |
|
||||
* |------+------+------+------+-------------+------+------+------+------|
|
||||
* | | | | | | | | | | |
|
||||
* | | | | = | + | . | 4 | 5 | 6 | Enter|
|
||||
* | | | / | = | + | . | 4 | 5 | 6 | Enter|
|
||||
* | Shift| ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ |
|
||||
* '------+------+------+------+------+------|------+------+------+------'
|
||||
* | | | | | | | | |
|
||||
@@ -182,9 +174,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
* '-------------------------------------------------------'
|
||||
*/
|
||||
[LAYER_NUMPAD] = LAYOUT_ortho_3x10(
|
||||
KC_NO, KC_NO, KC_KP_SLASH, KC_KP_ASTERISK, KC_KP_MINUS, KC_BSPC, KC_7, KC_8, KC_9, KC_0,
|
||||
KC_LSFT, KC_NO, KC_NO, KC_KP_EQUAL, KC_KP_PLUS, KC_DOT, KC_4, KC_5, KC_6, KC_ENT,
|
||||
XXXXXXX, KC_LCTL, KC_LALT, KC_NO, KC_TAB, KC_COMM, KC_1, KC_2, KC_3, XXXXXXX ),
|
||||
KC_NO, KC_NO, KC_3, KC_KP_ASTERISK, KC_KP_MINUS, KC_BSPC, KC_7, KC_8, KC_9, KC_0,
|
||||
KC_LSFT, KC_NO, KC_KP_SLASH, KC_KP_EQUAL, KC_KP_PLUS, KC_DOT, KC_4, KC_5, KC_6, KC_ENT,
|
||||
XXXXXXX, KC_LCTL, KC_LALT, KC_NO, KC_TAB, KC_COMM, KC_1, KC_2, KC_3, XXXXXXX
|
||||
),
|
||||
|
||||
/* MediaPad (mod su E)
|
||||
* ,---------------------------------------------------------------------.
|
||||
@@ -202,9 +195,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
* '-------------------------------------------------------'
|
||||
*/
|
||||
[LAYER_MEDIAPAD] = LAYOUT_ortho_3x10(
|
||||
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_VOLU, KC_NO, KC_NO,
|
||||
KC_LSFT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_MPRV, KC_MPLY, KC_MNXT, KC_NO,
|
||||
XXXXXXX, KC_LCTL, KC_LALT, KC_NO, KC_NO, KC_NO, KC_MUTE, KC_VOLD, KC_NO, XXXXXXX ),
|
||||
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_VOLU, KC_NO, KC_NO,
|
||||
KC_LSFT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_MPRV, KC_MPLY, KC_MNXT, KC_NO,
|
||||
XXXXXXX, KC_LCTL, KC_LALT, KC_NO, KC_NO, KC_NO, KC_MUTE, KC_VOLD, KC_NO, XXXXXXX
|
||||
),
|
||||
|
||||
};
|
||||
|
||||
@@ -225,15 +219,13 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
case CK_TRIPLEZERO:
|
||||
if (record->event.pressed) {
|
||||
SEND_STRING("000");
|
||||
} // else { when released... }
|
||||
} // else { when released }
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
void keyboard_pre_init_user(void) {
|
||||
// Call the keyboard pre init code.
|
||||
|
||||
// Set our LED pins as output
|
||||
setPinOutput(D5);
|
||||
setPinOutput(B0);
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
# gherkin super micro edition
|
||||
# The 25% SuperMicro keyboard
|
||||
## A full featured keymap on Gherkin compatible with a pure "Alpha 26" layout
|
||||
|
||||
With this configuration the "28" layout first experimented on the plank-like jj40 is being ported to a more proper board, leaving just two keys not used.
|
||||
With this configuration the "SuperMicro" layout first experimented on the plank-like jj40 is being ported to a more proper board, and with the last changes, this layout has been made compatible also to a "26 keys" one. So you can now choose to leave all 30 keys on the keyboard, or remove the two on the bottom line corners to have the "old" and comfortable 28 keys layout, or remove also space and enter to have the simplest "pure alpha" one! And even the intermediate 27 keys one is an interesting compatible option!
|
||||
|
||||
For more information please have a look at https://github.com/stevexyz/qmk_firmware/blob/master/keyboards/jj40/keymaps/stevexyz/readme.md
|
||||
This keymap is for a generic usage, trying to avoid as much gimmick as possible (considering the number of keys) and retain muscle memory from people used to the standard Qwerty 104 keys one. Functions and numbers (with related symbols) are on the first row as expected; other examples of design coherency include the symbols on the central row laid out in the same order as you'll find on a standard full keyboard, and the cursor movement aligned to the common unix vi standard ("hjkl", and for symmetry "sdfg" for home/pgdn/pgup/end). I've personally used this layout for months on my home PC in parallel to my portable work PC.
|
||||
|
||||
The image below explain the main layers. In addition to them with q, w and e there are three specific dedicated layers for cursors/mouse, numpad and media.
|
||||

|
||||
Relying just on the alphabetic keys this layout can be also very easily ported and tested on any qmk supported keyboard (ok, butterstick excluded).
|
||||
|
||||
The image below explains the main layers activated respectively with F, N or both modifiers pressed together. In addition to them there are available 5 layers that can be personalized as needed or completely removed without losing any functionality; three of them are currently setup in the default keymap for cursors/mouse, numpad and media (activated with q, w and e respectively).
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
#include "config_common.h"
|
||||
|
||||
/* USB Device descriptor parameter */
|
||||
#define VENDOR_ID 0xFEED
|
||||
#define PRODUCT_ID 0x6060
|
||||
#define VENDOR_ID 0x544B //TK
|
||||
#define PRODUCT_ID 0x0003
|
||||
#define DEVICE_VER 0x0006
|
||||
#define MANUFACTURER The Key Company
|
||||
#define PRODUCT Candybar
|
||||
|
||||
38
keyboards/candybar/lefty/keymaps/via/keymap.c
Normal file
38
keyboards/candybar/lefty/keymaps/via/keymap.c
Normal file
@@ -0,0 +1,38 @@
|
||||
/* Copyright 2018 Jack Humbert
|
||||
*
|
||||
* 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
|
||||
|
||||
#define _BL 0
|
||||
#define _FL 1
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/* Keymap _BL: Base Layer (Default Layer)
|
||||
*/
|
||||
[_BL] = LAYOUT(
|
||||
KC_P7 , KC_P8, KC_P9 , KC_PAST, KC_ESC , KC_Q , KC_W , KC_E, KC_R , KC_T , KC_Y, KC_U , KC_I , KC_O , KC_P , KC_DEL , KC_BSPC , \
|
||||
KC_P4 , KC_P5, KC_P6 , KC_PMNS, KC_TAB , KC_A , KC_S , KC_D, KC_F , KC_G , KC_H, KC_J , KC_K , KC_L , KC_SCLN, KC_ENT , \
|
||||
KC_P1 , KC_P2, KC_P3 , KC_PPLS, KC_LSFT, KC_Z , KC_X, KC_C , KC_V , KC_B, KC_N , KC_M , KC_COMM, KC_DOT , KC_UP ,KC_RSFT , \
|
||||
MO(_FL), KC_P0, KC_PDOT, KC_PENT, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC , KC_BSPC, KC_APP , KC_LEFT, KC_DOWN, KC_RGHT),
|
||||
|
||||
/* Keymap _FL: Function Layer
|
||||
*/
|
||||
[_FL] = LAYOUT(
|
||||
KC_P7 , KC_P8, KC_P9 , KC_VOLU, RESET , KC_Q , KC_W , KC_E, KC_R , KC_T , KC_Y, KC_U , KC_I , KC_LBRC, KC_RBRC, KC_INS , KC_BSPC , \
|
||||
KC_P4 , KC_P5, KC_P6 , KC_VOLD, KC_TAB , KC_A , KC_SLCK, KC_D, KC_F , KC_G , KC_H, KC_J , KC_K , KC_L , KC_QUOT, KC_BSLS , \
|
||||
KC_P1 , KC_P2, KC_P3 , KC_PEQL, KC_LSFT, KC_Z , KC_X, KC_CAPS, KC_V , KC_B, KC_NLCK, KC_M , KC_COMM, KC_DOT , KC_SLSH, KC_PGUP , \
|
||||
KC_END, KC_P0, KC_PDOT, KC_PENT, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC , KC_BSPC, KC_APP , MO(_FL), KC_HOME, KC_PGDN),
|
||||
};
|
||||
1
keyboards/candybar/lefty/keymaps/via/rules.mk
Normal file
1
keyboards/candybar/lefty/keymaps/via/rules.mk
Normal file
@@ -0,0 +1 @@
|
||||
VIA_ENABLE = yes
|
||||
@@ -7,7 +7,7 @@ MCU = STM32F072
|
||||
# EXTRAFLAGS+=-flto
|
||||
LINK_TIME_OPTIMIZATION_ENABLE = yes
|
||||
BACKLIGHT_ENABLE = no
|
||||
BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration
|
||||
BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration
|
||||
## (Note that for BOOTMAGIC on Teensy LC you have to use a custom .ld script.)
|
||||
MOUSEKEY_ENABLE = no # Mouse keys
|
||||
EXTRAKEY_ENABLE = yes # Audio control and System control
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
#include "config_common.h"
|
||||
|
||||
/* USB Device descriptor parameter */
|
||||
#define VENDOR_ID 0xFEED
|
||||
#define PRODUCT_ID 0x6060
|
||||
#define VENDOR_ID 0x544B //TK
|
||||
#define PRODUCT_ID 0x0002
|
||||
#define DEVICE_VER 0x0006
|
||||
#define MANUFACTURER The Key Company
|
||||
#define PRODUCT Candybar
|
||||
|
||||
38
keyboards/candybar/righty/keymaps/via/keymap.c
Normal file
38
keyboards/candybar/righty/keymaps/via/keymap.c
Normal file
@@ -0,0 +1,38 @@
|
||||
/* Copyright 2018 Jack Humbert
|
||||
*
|
||||
* 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
|
||||
|
||||
#define _BL 0
|
||||
#define _FL 1
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/* Keymap _BL: Base Layer (Default Layer)
|
||||
*/
|
||||
[_BL] = LAYOUT(
|
||||
KC_ESC,KC_Q,KC_W,KC_E,KC_R,KC_T,KC_Y,KC_U,KC_I,KC_O,KC_P,KC_DEL,KC_BSPC,KC_P7,KC_P8,KC_P9,KC_PAST, \
|
||||
KC_TAB,KC_A,KC_S,KC_D,KC_F,KC_G,KC_H,KC_J,KC_K,KC_L,KC_SCLN,KC_ENT,KC_P4,KC_P5,KC_P6,KC_PMNS, \
|
||||
KC_LSFT,KC_Z,KC_X,KC_C,KC_V,KC_B,KC_N,KC_M,KC_COMM,KC_DOT,KC_RSFT,KC_UP,KC_P1,KC_P2,KC_P3,KC_PPLS, \
|
||||
KC_LCTL,KC_LGUI,KC_LALT,KC_SPC,KC_SPC,KC_BSPC,KC_APP,MO(_FL),KC_LEFT,KC_DOWN,KC_RGHT,KC_P0,KC_PDOT,KC_PENT),
|
||||
|
||||
/* Keymap _FL: Function Layer
|
||||
*/
|
||||
[_FL] = LAYOUT(
|
||||
RESET,KC_Q,KC_W,KC_E,KC_R,KC_T,KC_Y,KC_U,KC_I,KC_LBRC,KC_RBRC,KC_INS,KC_BSPC,KC_P7,KC_P8,KC_P9,KC_VOLU, \
|
||||
KC_TAB,KC_A,KC_SLCK,KC_D,KC_F,KC_G,KC_H,KC_J,KC_K,KC_L,KC_QUOT,KC_BSLS,KC_P4,KC_P5,KC_P6,KC_VOLD, \
|
||||
KC_LSFT,KC_Z,KC_X,KC_CAPS,KC_V,KC_B,KC_NLCK,KC_M,KC_COMM,KC_DOT,KC_SLSH,KC_PGUP,KC_P1,KC_P2,KC_P3,KC_PEQL, \
|
||||
KC_LCTL,KC_LGUI,KC_LALT,KC_SPC,KC_SPC,KC_BSPC,KC_APP,MO(_FL),KC_HOME,KC_PGDN,KC_END,KC_P0,KC_PDOT,KC_PENT),
|
||||
};
|
||||
1
keyboards/candybar/righty/keymaps/via/rules.mk
Normal file
1
keyboards/candybar/righty/keymaps/via/rules.mk
Normal file
@@ -0,0 +1 @@
|
||||
VIA_ENABLE = yes
|
||||
@@ -7,7 +7,7 @@ MCU = STM32F072
|
||||
# EXTRAFLAGS+=-flto
|
||||
LINK_TIME_OPTIMIZATION_ENABLE = yes
|
||||
BACKLIGHT_ENABLE = no
|
||||
BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration
|
||||
BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration
|
||||
## (Note that for BOOTMAGIC on Teensy LC you have to use a custom .ld script.)
|
||||
MOUSEKEY_ENABLE = no # Mouse keys
|
||||
EXTRAKEY_ENABLE = yes # Audio control and System control
|
||||
|
||||
23
keyboards/chimera_ortho_plus/chimera_ortho_plus.c
Normal file
23
keyboards/chimera_ortho_plus/chimera_ortho_plus.c
Normal file
@@ -0,0 +1,23 @@
|
||||
#include "chimera_ortho_plus.h"
|
||||
|
||||
void uart_init(void) {
|
||||
SERIAL_UART_INIT();
|
||||
}
|
||||
|
||||
void led_init(void) {
|
||||
setPinOutput(D1);
|
||||
setPinOutput(F4);
|
||||
setPinOutput(F5);
|
||||
writePinHigh(D1);
|
||||
writePinHigh(F4);
|
||||
writePinHigh(F5);
|
||||
}
|
||||
|
||||
|
||||
void matrix_init_kb(void) {
|
||||
// put your keyboard start-up code here
|
||||
// runs once when the firmware starts up
|
||||
matrix_init_user();
|
||||
uart_init();
|
||||
led_init();
|
||||
}
|
||||
38
keyboards/chimera_ortho_plus/chimera_ortho_plus.h
Normal file
38
keyboards/chimera_ortho_plus/chimera_ortho_plus.h
Normal file
@@ -0,0 +1,38 @@
|
||||
#pragma once
|
||||
|
||||
#include "quantum.h"
|
||||
|
||||
#define red_led_off PORTF |= (1<<5)
|
||||
#define red_led_on PORTF &= ~(1<<5)
|
||||
#define blu_led_off PORTF |= (1<<4)
|
||||
#define blu_led_on PORTF &= ~(1<<4)
|
||||
#define grn_led_off PORTD |= (1<<1)
|
||||
#define grn_led_on PORTD &= ~(1<<1)
|
||||
|
||||
#define set_led_off red_led_off; grn_led_off; blu_led_off
|
||||
#define set_led_red red_led_on; grn_led_off; blu_led_off
|
||||
#define set_led_blue red_led_off; grn_led_off; blu_led_on
|
||||
#define set_led_green red_led_off; grn_led_on; blu_led_off
|
||||
#define set_led_yellow red_led_on; grn_led_on; blu_led_off
|
||||
#define set_led_magenta red_led_on; grn_led_off; blu_led_on
|
||||
#define set_led_cyan red_led_off; grn_led_on; blu_led_on
|
||||
#define set_led_white red_led_on; grn_led_on; blu_led_on
|
||||
|
||||
// This a shortcut to help you visually see your layout.
|
||||
// The first section contains all of the arguements
|
||||
// The second converts the arguments into a two-dimensional array
|
||||
|
||||
#define LAYOUT( \
|
||||
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k10, k11, \
|
||||
k12, k13, k14, k15, k16, k17, k18, k19, k20, k21, k22, k23, \
|
||||
k24, k25, k26, k27, k28, k29, k30, k31, k32, k33, k34, k35, \
|
||||
k36, k37, k38, k39, k40, k41, k42, k43, k44, k45, k46, k47, \
|
||||
k48, k49, k50, k51 \
|
||||
) \
|
||||
{ \
|
||||
{ k03, k40, k26, k15, k28, k01, k42, k31, k20, k33, k08, k10 }, \
|
||||
{ k00, k37, k14, k27, k16, k36, k47, k19, k32, k21, k46, k11 }, \
|
||||
{ k12, k25, k02, k39, k17, k49, k50, k18, k44, k09, k34, k23 }, \
|
||||
{ k24, k13, k38, k04, k05, k48, k51, k06, k07, k45, k22, k35 }, \
|
||||
{ k29, k41, KC_NO, KC_NO, KC_NO, KC_NO, k30, k43, KC_NO, KC_NO, KC_NO, KC_NO } \
|
||||
}
|
||||
76
keyboards/chimera_ortho_plus/config.h
Normal file
76
keyboards/chimera_ortho_plus/config.h
Normal file
@@ -0,0 +1,76 @@
|
||||
/*
|
||||
Copyright 2012 Jun Wako <wakojun@gmail.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "config_common.h"
|
||||
|
||||
/* USB Device descriptor parameter */
|
||||
|
||||
#define VENDOR_ID 0xFEED
|
||||
#define PRODUCT_ID 0xDE1D
|
||||
#define DEVICE_VER 0x0001
|
||||
#define MANUFACTURER unknown
|
||||
#define PRODUCT Chimera Ortho Plus
|
||||
#define DESCRIPTION q.m.k. keyboard firmware for Chimera Ortho Plus
|
||||
|
||||
/* key matrix size */
|
||||
#define MATRIX_ROWS 6
|
||||
#define MATRIX_COLS 12
|
||||
|
||||
/* define if matrix has ghost */
|
||||
//#define MATRIX_HAS_GHOST
|
||||
|
||||
/* number of backlight levels */
|
||||
//#define BACKLIGHT_LEVELS 3
|
||||
|
||||
#define ONESHOT_TIMEOUT 500
|
||||
|
||||
/*
|
||||
* Feature disable options
|
||||
* These options are also useful to firmware size reduction.
|
||||
*/
|
||||
|
||||
/* disable debug print */
|
||||
//#define NO_DEBUG
|
||||
|
||||
/* disable print */
|
||||
//#define NO_PRINT
|
||||
|
||||
/* disable action features */
|
||||
//#define NO_ACTION_LAYER
|
||||
//#define NO_ACTION_TAPPING
|
||||
//#define NO_ACTION_ONESHOT
|
||||
//#define NO_ACTION_MACRO
|
||||
//#define NO_ACTION_FUNCTION
|
||||
|
||||
//UART settings for communication with the RF microcontroller
|
||||
#define SERIAL_UART_BAUD 1000000
|
||||
#define SERIAL_UART_DATA UDR1
|
||||
#define SERIAL_UART_UBRR (F_CPU / (16UL * SERIAL_UART_BAUD) - 1)
|
||||
#define SERIAL_UART_TXD_READY (UCSR1A & _BV(UDRE1))
|
||||
#define SERIAL_UART_RXD_PRESENT (UCSR1A & _BV(RXC1))
|
||||
#define SERIAL_UART_INIT() do { \
|
||||
/* baud rate */ \
|
||||
UBRR1L = SERIAL_UART_UBRR; \
|
||||
/* baud rate */ \
|
||||
UBRR1H = SERIAL_UART_UBRR >> 8; \
|
||||
/* enable TX and RX */ \
|
||||
UCSR1B = _BV(TXEN1) | _BV(RXEN1); \
|
||||
/* 8-bit data */ \
|
||||
UCSR1C = _BV(UCSZ11) | _BV(UCSZ10); \
|
||||
} while(0)
|
||||
65
keyboards/chimera_ortho_plus/info.json
Normal file
65
keyboards/chimera_ortho_plus/info.json
Normal file
@@ -0,0 +1,65 @@
|
||||
{
|
||||
"keyboard_name": "Chimera Ortho Plus",
|
||||
"keyboard_folder": "chimera_ortho_plus",
|
||||
"maintainer": "qmk",
|
||||
"width": 13.5,
|
||||
"height": 6,
|
||||
"layouts": {
|
||||
"LAYOUT": {
|
||||
"layout": [
|
||||
{"label": "{", "x": 0, "y": 0},
|
||||
{"label": "1", "x": 1, "y": 0},
|
||||
{"label": "2", "x": 2, "y": 0},
|
||||
{"label": "3", "x": 3, "y": 0},
|
||||
{"label": "4", "x": 4, "y": 0},
|
||||
{"label": "5", "x": 5, "y": 0},
|
||||
{"label": "6", "x": 7.5, "y": 0},
|
||||
{"label": "7", "x": 8.5, "y": 0},
|
||||
{"label": "8", "x": 9.5, "y": 0},
|
||||
{"label": "9", "x": 10.5, "y": 0},
|
||||
{"label": "0", "x": 11.5, "y": 0},
|
||||
{"label": "}", "x": 12.5, "y": 0},
|
||||
{"label": "Esc", "x": 0, "y": 1},
|
||||
{"label": "Q", "x": 1, "y": 1},
|
||||
{"label": "W", "x": 2, "y": 1},
|
||||
{"label": "E", "x": 3, "y": 1},
|
||||
{"label": "R", "x": 4, "y": 1},
|
||||
{"label": "T", "x": 5, "y": 1},
|
||||
{"label": "Y", "x": 7.5, "y": 1},
|
||||
{"label": "U", "x": 8.5, "y": 1},
|
||||
{"label": "I", "x": 9.5, "y": 1},
|
||||
{"label": "O", "x": 10.5, "y": 1},
|
||||
{"label": "P", "x": 11.5, "y": 1},
|
||||
{"label": "\"", "x": 12.5, "y": 1},
|
||||
{"label": "Tab", "x": 0, "y": 2},
|
||||
{"label": "A", "x": 1, "y": 2},
|
||||
{"label": "S", "x": 2, "y": 2},
|
||||
{"label": "D", "x": 3, "y": 2},
|
||||
{"label": "F", "x": 4, "y": 2},
|
||||
{"label": "G", "x": 5, "y": 2},
|
||||
{"label": "H", "x": 7.5, "y": 2},
|
||||
{"label": "J", "x": 8.5, "y": 2},
|
||||
{"label": "K", "x": 9.5, "y": 2},
|
||||
{"label": "L", "x": 10.5, "y": 2},
|
||||
{"label": ";", "x": 11.5, "y": 2},
|
||||
{"label": "Enter", "x": 12.5, "y": 2},
|
||||
{"label": "(", "x": 0, "y": 3},
|
||||
{"label": "Z", "x": 1, "y": 3},
|
||||
{"label": "X", "x": 2, "y": 3},
|
||||
{"label": "C", "x": 3, "y": 3},
|
||||
{"label": "V", "x": 4, "y": 3},
|
||||
{"label": "B", "x": 5, "y": 3},
|
||||
{"label": "N", "x": 7.5, "y": 3},
|
||||
{"label": "M", "x": 8.5, "y": 3},
|
||||
{"label": ",", "x": 9.5, "y": 3},
|
||||
{"label": ".", "x": 10.5, "y": 3},
|
||||
{"label": "/", "x": 11.5, "y": 3},
|
||||
{"label": ")", "x": 12.5, "y": 3},
|
||||
{"label": "Num Layer", "x": 4, "y": 4},
|
||||
{"label": "Back Space", "x": 5, "y": 4},
|
||||
{"label": "Space", "x": 7.5, "y": 4},
|
||||
{"label": "Symbol Layer", "x": 8.5, "y": 4}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
5
keyboards/chimera_ortho_plus/keymaps/default/config.h
Normal file
5
keyboards/chimera_ortho_plus/keymaps/default/config.h
Normal file
@@ -0,0 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
// place overrides here
|
||||
#define LONGPRESS_DELAY 150
|
||||
//#define LAYER_TOGGLE_DELAY 300
|
||||
185
keyboards/chimera_ortho_plus/keymaps/default/keymap.c
Normal file
185
keyboards/chimera_ortho_plus/keymaps/default/keymap.c
Normal file
@@ -0,0 +1,185 @@
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
// Each layer gets a name for readability, which is then used in the keymap matrix below.
|
||||
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
|
||||
// Layer names don't all need to be of the same length, obviously, and you can also skip them
|
||||
// entirely and just use numbers.
|
||||
enum chimera_ortho_plus_layers {
|
||||
_QWERTY,
|
||||
_CAPS,
|
||||
_NUMPAD,
|
||||
_SYMBOLS,
|
||||
_MACROS,
|
||||
_NAV
|
||||
};
|
||||
|
||||
#define KC_NMPD TG(_NUMPAD)
|
||||
#define KC_SYMB TG(_SYMBOLS)
|
||||
#define KC_SPFN LT(_NAV,KC_4)
|
||||
#define KC_SCTL MT(MOD_LCTL, KC_2)
|
||||
#define KC_SCTR MT(MOD_LCTL, KC_9)
|
||||
#define KC_SPLT MT(MOD_LALT, KC_3)
|
||||
#define KC_SPRT MT(MOD_LALT, KC_8)
|
||||
#define KC_GBRC MT(MOD_RGUI, KC_7)
|
||||
#define KC_GQOT MT(MOD_LGUI, KC_QUOT)
|
||||
#define KC_MESC LT(_MACROS, KC_ESC)
|
||||
#define KC_CAD LALT(LCTL(KC_DEL))
|
||||
|
||||
enum custom_keycodes {
|
||||
KC_INCL = SAFE_RANGE,
|
||||
KC_PULL,
|
||||
KC_PUSH,
|
||||
KC_SCAP,
|
||||
KC_SCOF
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
[_QWERTY] = LAYOUT(
|
||||
//,-------+-------+-------+-------+-------+-------. ,-------+-------+-------+-------+-------+-------.
|
||||
KC_LBRC, KC_1 ,KC_SCTL,KC_SPLT,KC_SPFN, KC_5 , KC_6 ,KC_GBRC,KC_SPRT,KC_SCTR, KC_0 ,KC_RBRC,
|
||||
//|-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------|
|
||||
KC_MESC, KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P ,KC_QUOT,
|
||||
//|-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------|
|
||||
KC_TAB , KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L ,KC_SCLN,KC_ENT ,
|
||||
//|-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------|
|
||||
KC_LSPO, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M ,KC_COMM,KC_DOT ,KC_SLSH,KC_RSPC,
|
||||
//|-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------|
|
||||
KC_NMPD,KC_BSPC, KC_SPC ,KC_SYMB
|
||||
//|-------------------------------+-------+-------| |-------+-------+-------------------------------|
|
||||
),
|
||||
|
||||
[_CAPS] = LAYOUT(
|
||||
//,-------+-------+-------+-------+-------+-------. ,-------+-------+-------+-------+-------+-------.
|
||||
_______,KC_UNDS,_______,_______,_______,_______, _______,_______,_______,_______,_______,_______,
|
||||
//|-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------|
|
||||
_______,_______,_______,_______,_______,_______, _______,_______,_______,_______,_______,_______,
|
||||
//|-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------|
|
||||
_______,_______,_______,_______,_______,_______, _______,_______,_______,_______,KC_COLN,_______,
|
||||
//|-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------|
|
||||
KC_SCOF,_______,_______,_______,_______,_______, _______,_______,_______,_______,_______,KC_SCOF,
|
||||
//|-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------|
|
||||
_______,_______, _______,_______
|
||||
//|-------------------------------+-------+-------| |-------+-------+-------------------------------|
|
||||
),
|
||||
|
||||
[_NUMPAD] = LAYOUT(
|
||||
//,-------+-------+-------+-------+-------+-------. ,-------+-------+-------+-------+-------+-------.
|
||||
_______,_______,_______,_______,_______,_______, _______,_______,_______,_______,KC_MINS,_______,
|
||||
//|-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------|
|
||||
_______,_______,KC_COLN,_______,_______,_______, _______, KC_7 , KC_8 , KC_9 ,KC_ASTR,_______,
|
||||
//|-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------|
|
||||
_______,_______,KC_DOT ,_______,_______,_______, _______, KC_4 , KC_5 , KC_6 ,KC_PLUS,_______,
|
||||
//|-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------|
|
||||
_______,_______,_______,_______,_______,_______, _______, KC_1 , KC_2 , KC_3 ,KC_SLSH,_______,
|
||||
//|-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------|
|
||||
_______,_______, _______, KC_0
|
||||
//|-------------------------------+-------+-------/ |-------+-------+-------------------------------|
|
||||
),
|
||||
|
||||
[_SYMBOLS] = LAYOUT(
|
||||
//,-------+-------+-------+-------+-------+-------. ,-------+-------+-------+-------+-------+-------.
|
||||
_______,_______,_______,_______,_______,_______, _______,_______,_______,_______,_______,_______,
|
||||
//|-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------|
|
||||
_______,KC_EXLM, KC_AT ,KC_HASH,KC_DLR ,KC_PERC, KC_CIRC,KC_AMPR,KC_ASTR,KC_LPRN,KC_RPRN,KC_BSLS,
|
||||
//|-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------|
|
||||
KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_TILD,KC_EQL ,KC_UNDS,KC_LCBR,KC_RCBR,_______,
|
||||
//|-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------|
|
||||
KC_F7 , KC_F8 , KC_F9 ,KC_F10 ,KC_F11 ,KC_F12 , KC_GRV ,KC_PLUS,KC_MINS,KC_LBRC,KC_RBRC,_______,
|
||||
//|-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------|
|
||||
KC_PIPE,_______, _______,_______
|
||||
//|-------------------------------+-------+-------| |-------+-------+-------------------------------|
|
||||
),
|
||||
|
||||
[_MACROS] = LAYOUT(
|
||||
//,-------+-------+-------+-------+-------+-------. ,-------+-------+-------+-------+-------+-------.
|
||||
_______,_______,_______,_______,_______,_______, _______ ,_______,_______,_______,_______,_______,
|
||||
//|-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------|
|
||||
_______,_______,_______,_______,_______,_______, _______ ,_______,KC_INCL,_______,_______,_______,
|
||||
//|-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------|
|
||||
_______,_______,_______,KC_CAD ,_______,_______, _______ ,_______,_______,_______,_______,_______,
|
||||
//|-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------|
|
||||
KC_SCAP,_______,_______,_______,_______,_______, _______ ,_______,KC_PULL,KC_PUSH,_______,_______,
|
||||
//|-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------|
|
||||
_______,_______, _______,_______
|
||||
//|-------------------------------+-------+-------| |-------+-------+-------------------------------|
|
||||
),
|
||||
|
||||
[_NAV] = LAYOUT(
|
||||
//,-------+-------+-------+-------+-------+-------. ,-------+-------+-------+-------+-------+-------.
|
||||
_______,_______,_______,_______,_______,_______, _______,_______,_______,_______,_______,_______,
|
||||
//|-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------|
|
||||
_______,_______,_______,_______,_______,_______, _______,KC_PGUP, KC_UP ,KC_PGDN,KC_PSCR,_______,
|
||||
//|-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------|
|
||||
_______,_______,_______,_______,_______,_______, _______,KC_LEFT,KC_DOWN,KC_RGHT,_______,_______,
|
||||
//|-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------|
|
||||
_______,_______,_______,_______,_______,_______, _______,_______,_______,_______,_______,_______,
|
||||
//|-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------|
|
||||
_______,KC_DEL , _______,_______
|
||||
//|-------------------------------+-------+-------| |-------+-------+-------------------------------|
|
||||
)
|
||||
};
|
||||
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
switch(keycode) {
|
||||
/* include some kind of library or header */
|
||||
case KC_INCL:
|
||||
if (record->event.pressed) {
|
||||
SEND_STRING("#include <>" SS_TAP(X_LEFT));
|
||||
}
|
||||
return false;
|
||||
case KC_PULL:
|
||||
if (record->event.pressed) {
|
||||
SEND_STRING("git pull\n");
|
||||
}
|
||||
return false;
|
||||
case KC_PUSH:
|
||||
if (record->event.pressed){
|
||||
SEND_STRING("git push\n");
|
||||
}
|
||||
return false;
|
||||
case KC_SCAP:
|
||||
if (record->event.pressed){
|
||||
layer_on(_CAPS);
|
||||
tap_code(KC_CAPS);
|
||||
}
|
||||
return false;
|
||||
case KC_SCOF:
|
||||
if (record->event.pressed){
|
||||
layer_off(_CAPS);
|
||||
tap_code(KC_CAPS);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
void matrix_scan_user(void) {
|
||||
uint8_t layer = get_highest_layer(layer_state);
|
||||
|
||||
switch (layer) {
|
||||
case _QWERTY:
|
||||
set_led_green;
|
||||
break;
|
||||
case _CAPS:
|
||||
set_led_white;
|
||||
break;
|
||||
case _NUMPAD:
|
||||
set_led_blue;
|
||||
break;
|
||||
case _SYMBOLS:
|
||||
set_led_red;
|
||||
break;
|
||||
case _MACROS:
|
||||
set_led_cyan;
|
||||
break;
|
||||
case _NAV:
|
||||
set_led_magenta;
|
||||
break;
|
||||
default:
|
||||
set_led_green;
|
||||
break;
|
||||
}
|
||||
};
|
||||
154
keyboards/chimera_ortho_plus/matrix.c
Normal file
154
keyboards/chimera_ortho_plus/matrix.c
Normal file
@@ -0,0 +1,154 @@
|
||||
/*
|
||||
Copyright 2012 Jun Wako
|
||||
Copyright 2014 Jack Humbert
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#if defined(__AVR__)
|
||||
#include <avr/io.h>
|
||||
#endif
|
||||
#include "wait.h"
|
||||
#include "print.h"
|
||||
#include "debug.h"
|
||||
#include "util.h"
|
||||
#include "matrix.h"
|
||||
#include "timer.h"
|
||||
|
||||
#if (MATRIX_COLS <= 8)
|
||||
# define print_matrix_header() print("\nr/c 01234567\n")
|
||||
# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row))
|
||||
# define matrix_bitpop(i) bitpop(matrix[i])
|
||||
# define ROW_SHIFTER ((uint8_t)1)
|
||||
#elif (MATRIX_COLS <= 16)
|
||||
# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n")
|
||||
# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row))
|
||||
# define matrix_bitpop(i) bitpop16(matrix[i])
|
||||
# define ROW_SHIFTER ((uint16_t)1)
|
||||
#elif (MATRIX_COLS <= 32)
|
||||
# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n")
|
||||
# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row))
|
||||
# define matrix_bitpop(i) bitpop32(matrix[i])
|
||||
# define ROW_SHIFTER ((uint32_t)1)
|
||||
#endif
|
||||
|
||||
/* matrix state(1:on, 0:off) */
|
||||
static matrix_row_t matrix[MATRIX_ROWS];
|
||||
|
||||
__attribute__ ((weak))
|
||||
void matrix_init_kb(void) {
|
||||
matrix_init_user();
|
||||
}
|
||||
|
||||
__attribute__ ((weak))
|
||||
void matrix_scan_kb(void) {
|
||||
matrix_scan_user();
|
||||
}
|
||||
|
||||
__attribute__ ((weak))
|
||||
void matrix_init_user(void) {
|
||||
}
|
||||
|
||||
__attribute__ ((weak))
|
||||
void matrix_scan_user(void) {
|
||||
}
|
||||
|
||||
inline
|
||||
uint8_t matrix_rows(void) {
|
||||
return MATRIX_ROWS;
|
||||
}
|
||||
|
||||
inline
|
||||
uint8_t matrix_cols(void) {
|
||||
return MATRIX_COLS;
|
||||
}
|
||||
|
||||
void matrix_init(void) {
|
||||
|
||||
matrix_init_quantum();
|
||||
}
|
||||
|
||||
uint8_t matrix_scan(void)
|
||||
{
|
||||
SERIAL_UART_INIT();
|
||||
|
||||
uint32_t timeout = 0;
|
||||
|
||||
//the s character requests the RF slave to send the matrix
|
||||
SERIAL_UART_DATA = 's';
|
||||
|
||||
//trust the external keystates entirely, erase the last data
|
||||
uint8_t uart_data[14] = {0};
|
||||
|
||||
//there are 10 bytes corresponding to 10 columns, and an end byte
|
||||
for (uint8_t i = 0; i < 14; i++) {
|
||||
//wait for the serial data, timeout if it's been too long
|
||||
//this only happened in testing with a loose wire, but does no
|
||||
//harm to leave it in here
|
||||
while(!SERIAL_UART_RXD_PRESENT){
|
||||
timeout++;
|
||||
if (timeout > 10000){
|
||||
break;
|
||||
}
|
||||
}
|
||||
uart_data[i] = SERIAL_UART_DATA;
|
||||
}
|
||||
|
||||
//check for the end packet, the key state bytes use the LSBs, so 0xE0
|
||||
//will only show up here if the correct bytes were recieved
|
||||
if (uart_data[10] == 0xE0)
|
||||
{
|
||||
//shifting and transferring the keystates to the QMK matrix variable
|
||||
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
|
||||
matrix[i] = (uint16_t) uart_data[i*2] | (uint16_t) uart_data[i*2+1] << 6;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
matrix_scan_quantum();
|
||||
return 1;
|
||||
}
|
||||
|
||||
inline
|
||||
bool matrix_is_on(uint8_t row, uint8_t col)
|
||||
{
|
||||
return (matrix[row] & ((matrix_row_t)1<<col));
|
||||
}
|
||||
|
||||
inline
|
||||
matrix_row_t matrix_get_row(uint8_t row)
|
||||
{
|
||||
return matrix[row];
|
||||
}
|
||||
|
||||
void matrix_print(void)
|
||||
{
|
||||
print_matrix_header();
|
||||
|
||||
for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
|
||||
phex(row); print(": ");
|
||||
print_matrix_row(row);
|
||||
print("\n");
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t matrix_key_count(void)
|
||||
{
|
||||
uint8_t count = 0;
|
||||
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
|
||||
count += matrix_bitpop(i);
|
||||
}
|
||||
return count;
|
||||
}
|
||||
15
keyboards/chimera_ortho_plus/readme.md
Normal file
15
keyboards/chimera_ortho_plus/readme.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# Chimera Ortho+
|
||||
|
||||

|
||||
|
||||
A split wireless 50% ortholinear keyboard.
|
||||
|
||||
* Keyboard Maintainer: [William Wilson](https://github.com/GlenPickle)
|
||||
* Hardware Supported: Chimera Ortho+ PCB, WaveShare core nRF51822
|
||||
* Hardware Availability: [Gerbers](https://github.com/GlenPickle/Chimera/tree/master/ortho_plus/gerbers)
|
||||
|
||||
Make example for this keyboard (after setting up your build environment):
|
||||
|
||||
make chimera_ortho_plus:default
|
||||
|
||||
See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
|
||||
37
keyboards/chimera_ortho_plus/rules.mk
Normal file
37
keyboards/chimera_ortho_plus/rules.mk
Normal file
@@ -0,0 +1,37 @@
|
||||
# MCU name
|
||||
MCU = atmega32u4
|
||||
|
||||
# Bootloader
|
||||
# Teensy halfkay
|
||||
# Pro Micro caterina
|
||||
# Atmel DFU atmel-dfu
|
||||
# LUFA DFU lufa-dfu
|
||||
# QMK DFU qmk-dfu
|
||||
# ATmega32A bootloadHID
|
||||
# ATmega328P USBasp
|
||||
BOOTLOADER = caterina
|
||||
|
||||
# Build Options
|
||||
# change yes to no to disable
|
||||
#
|
||||
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration
|
||||
MOUSEKEY_ENABLE = yes # Mouse keys
|
||||
EXTRAKEY_ENABLE = yes # Audio control and System control
|
||||
CONSOLE_ENABLE = yes # Console for debug
|
||||
COMMAND_ENABLE = yes # Commands for debug and configuration
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
NKRO_ENABLE = yes # USB Nkey Rollover
|
||||
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
|
||||
RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
|
||||
MIDI_ENABLE = no # MIDI support
|
||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
AUDIO_ENABLE = no # Audio output
|
||||
FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
|
||||
HD44780_ENABLE = no # Enable support for HD44780 based LCDs
|
||||
UNICODE_ENABLE = yes
|
||||
CUSTOM_MATRIX = yes
|
||||
|
||||
# project specific files
|
||||
SRC = matrix.c
|
||||
446
keyboards/ergodone/keymaps/art/keymap.c
Normal file
446
keyboards/ergodone/keymaps/art/keymap.c
Normal file
@@ -0,0 +1,446 @@
|
||||
#include "art.h"
|
||||
#include "sendstring_workman_zxcvm.h"
|
||||
|
||||
bool is_win = true;
|
||||
|
||||
enum custom_keycodes {
|
||||
keyboardSpecificKeyCode = NEW_SAFE_RANGE //not used
|
||||
};
|
||||
|
||||
void led_show_current_os(void) {
|
||||
if (is_win) {
|
||||
ergodox_right_led_1_on();
|
||||
wait_ms(50);
|
||||
ergodox_right_led_1_off();
|
||||
wait_ms(50);
|
||||
ergodox_right_led_1_on();
|
||||
wait_ms(50);
|
||||
ergodox_right_led_1_off();
|
||||
wait_ms(50);
|
||||
ergodox_right_led_1_on();
|
||||
wait_ms(50);
|
||||
ergodox_right_led_1_off();
|
||||
wait_ms(50);
|
||||
} else {
|
||||
ergodox_right_led_3_on();
|
||||
wait_ms(50);
|
||||
ergodox_right_led_3_off();
|
||||
wait_ms(50);
|
||||
ergodox_right_led_3_on();
|
||||
wait_ms(50);
|
||||
ergodox_right_led_3_off();
|
||||
wait_ms(50);
|
||||
ergodox_right_led_3_on();
|
||||
wait_ms(50);
|
||||
ergodox_right_led_3_off();
|
||||
wait_ms(50);
|
||||
}
|
||||
}
|
||||
|
||||
void matrix_init_user(void) {
|
||||
led_show_current_os();
|
||||
}
|
||||
|
||||
void led_set_user(uint8_t usb_led) {
|
||||
if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
|
||||
ergodox_right_led_2_on();
|
||||
} else {
|
||||
ergodox_right_led_2_off();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||
ergodox_board_led_off();
|
||||
ergodox_right_led_1_off();
|
||||
ergodox_right_led_3_off();
|
||||
switch (get_highest_layer(state)) {
|
||||
case NAV:
|
||||
case CTRL_NAV:
|
||||
case SHIFT_NAV:
|
||||
ergodox_right_led_1_on();
|
||||
break;
|
||||
case FKEYS:
|
||||
ergodox_right_led_3_on();
|
||||
break;
|
||||
}
|
||||
return state;
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/* Base qwerty layer
|
||||
*
|
||||
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||
* | ` ~ | 1 | 2 | 3 | 4 | 5 | ESC | | - _ | 6 | 7 | 8 | 9 | 0 | ] |
|
||||
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||
* | Tab | Q | W | E | R | T | ??? | | = | Y | U | I | O | P | [ |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | Caps | A | S | D | F | G |------| |------| H | J | K | L | ; | ' |
|
||||
* |--------+------+------+------+------+------| FKEYS| | FKEYS|------+------+------+------+------+--------|
|
||||
* | LShift | Z | X | C | V | B | | | | N | M | , | . | / git| RShift |
|
||||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||
* |LCtrl |Media\| Win |Alt | NAV | | Home | End |Workmn| | RCtrl|
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,---------------.
|
||||
* | Del | Ins | | Left | Right |
|
||||
* ,------|------|------| |------+--------+------.
|
||||
* | | | PgUp | |SFT_NV| | |
|
||||
* | Space|BSpace|------| |------| NAV |Enter |
|
||||
* | | | PgDn | |CTR_NV| | |
|
||||
* `--------------------' `----------------------'
|
||||
*/
|
||||
[QWERTY] = LAYOUT_ergodox(
|
||||
// -----------------------------------------------------left hand-----------------------------------------------------
|
||||
KC_GRAVE, KC_1, KC_2, KC_3, KC_4, KC_5, KC_ESCAPE,
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, XXXXXXX,
|
||||
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G,
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, TT(FKEYS),
|
||||
KC_LCTRL, LT(MEDIA, KC_BSLASH), KC_LWIN, KC_LALT, LT(NAV, KC_RIGHT),
|
||||
|
||||
KC_DEL, KC_INS,
|
||||
KC_PGUP,
|
||||
KC_SPC, LT(COMBOS,KC_BSPC), KC_PGDOWN,
|
||||
|
||||
// -----------------------------------------------------right hand-----------------------------------------------------
|
||||
KC_MINS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_RBRC,
|
||||
KC_EQL, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,
|
||||
KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
|
||||
TT(FKEYS), KC_N, KC_M, KC_COMM, KC_DOT, LT(GIT,KC_SLSH), KC_RSFT,
|
||||
KC_HOME, KC_END, DF(WORKMAN), KC_RALT, KC_RCTRL,
|
||||
|
||||
KC_LEFT, KC_RIGHT,
|
||||
LT(SHIFT_NAV, KC_UP),
|
||||
LT(CTRL_NAV, KC_DOWN), MO(NAV), KC_ENT
|
||||
),
|
||||
/* Workman
|
||||
*
|
||||
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||
* | | | | | | | | | | | | | | | |
|
||||
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||
* | | Q | D | R | W | B | | | | J | F | U | P | ; | |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | | A | S | H | T | G |------| |------| Y | N | E | O | I | |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | | Z | X | C | V | M | | | | K | L | , | . | / | |
|
||||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||
* | | | | | | | | |QWERTY| | |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,---------------.
|
||||
* | | | | | |
|
||||
* ,------|------|------| |------+--------+------.
|
||||
* | | | | | | | |
|
||||
* | | |------| |------| | |
|
||||
* | | | | | | | |
|
||||
* `--------------------' `----------------------'
|
||||
*/
|
||||
[WORKMAN] = LAYOUT_ergodox(
|
||||
// -----------------------------------------------------left hand-----------------------------------------------------
|
||||
_______, _______, _______, _______, _______, _______, _______,
|
||||
_______, KC_Q, KC_D, KC_R, KC_W, KC_B, _______,
|
||||
_______, KC_A, KC_S, KC_H, KC_T, KC_G,
|
||||
_______, KC_Z, KC_X, KC_C, KC_V, KC_M, _______,
|
||||
_______, _______, _______, _______, _______,
|
||||
|
||||
_______, _______,
|
||||
_______,
|
||||
_______, _______, _______,
|
||||
|
||||
// -----------------------------------------------------right hand-----------------------------------------------------
|
||||
_______, _______, _______, _______, _______, _______, _______,
|
||||
_______, KC_J, KC_F, KC_U, KC_P, KC_SCLN, _______,
|
||||
KC_Y, KC_N, KC_E, KC_O, KC_I, _______,
|
||||
_______, KC_K, KC_L, KC_COMM, KC_DOT, KC_SLSH, _______,
|
||||
_______, _______, DF(QWERTY), _______, _______,
|
||||
|
||||
_______, _______,
|
||||
_______,
|
||||
_______, _______, _______
|
||||
),
|
||||
|
||||
[FKEYS] = LAYOUT_ergodox(
|
||||
// -----------------------------------------------------left hand-----------------------------------------------------
|
||||
_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______,
|
||||
|
||||
_______, _______,
|
||||
_______,
|
||||
_______, _______, _______,
|
||||
// -----------------------------------------------------right hand-----------------------------------------------------
|
||||
_______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
|
||||
_______, _______, _______, _______, _______, _______, KC_F12,
|
||||
_______, _______, _______, _______, _______, KC_PSCREEN,
|
||||
_______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______,
|
||||
|
||||
_______, _______,
|
||||
_______,
|
||||
_______, _______, _______
|
||||
),
|
||||
|
||||
[NAV] = LAYOUT_ergodox(
|
||||
// -----------------------------------------------------left hand-----------------------------------------------------
|
||||
_______, LALT(KC_F1), LALT(KC_F2), LALT(KC_F3), LALT(KC_F4), LALT(KC_F5), _______,
|
||||
_______, _______, KC_HOME, KC_UP, KC_END, KC_PGUP, _______,
|
||||
_______, _______, KC_LEFT, KC_DOWN, KC_RIGHT, KC_PGDOWN,
|
||||
_______, _______, _______, _______, KC_LALT, _______, _______,
|
||||
_______, _______, _______, _______, _______,
|
||||
|
||||
_______, _______,
|
||||
_______,
|
||||
_______, KC_DEL, _______,
|
||||
// -----------------------------------------------------right hand-----------------------------------------------------
|
||||
_______, LALT(KC_F6), LALT(KC_F7), LALT(KC_F8), LALT(KC_F9), LALT(KC_F10), LALT(KC_F11),
|
||||
_______, _______, _______, _______, _______, _______, LALT(KC_F12),
|
||||
_______, CTR_ALT, KC_RSFT, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______,
|
||||
|
||||
_______, _______,
|
||||
_______,
|
||||
_______, _______, _______
|
||||
),
|
||||
|
||||
[CTRL_NAV] = LAYOUT_ergodox(
|
||||
// -----------------------------------------------------left hand-----------------------------------------------------
|
||||
_______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, CTL_ALT(KC_HOME), CTL_ALT(KC_UP), CTL_ALT(KC_END), CTL_ALT(KC_PGUP), _______,
|
||||
_______, _______, CTL_ALT(KC_LEFT), CTL_ALT(KC_DOWN), CTL_ALT(KC_RIGHT),CTL_ALT(KC_PGDOWN),
|
||||
_______, _______, CTL_ALT(KC_X), CTL_ALT(KC_C), CTL_ALT(KC_V), _______, _______,
|
||||
_______, _______, _______, _______, _______,
|
||||
|
||||
CTL_ALT(KC_DEL), _______,
|
||||
_______,
|
||||
_______, CTL_ALT(KC_BSPC), CTL_ALT(KC_DEL),
|
||||
// -----------------------------------------------------right hand-----------------------------------------------------
|
||||
_______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______,
|
||||
CTL_ALT(KC_HOME), CTL_ALT(KC_END), _______, _______, _______,
|
||||
|
||||
CTL_ALT(KC_LEFT), CTL_ALT(KC_RIGHT),
|
||||
KC_RSFT,
|
||||
_______, _______, _______
|
||||
),
|
||||
|
||||
[SHIFT_NAV] = LAYOUT_ergodox(
|
||||
// -----------------------------------------------------left hand-----------------------------------------------------
|
||||
_______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, LSFT(KC_HOME), LSFT(KC_UP), LSFT(KC_END), LSFT(KC_PGUP), _______,
|
||||
_______, _______, LSFT(KC_LEFT), LSFT(KC_DOWN), LSFT(KC_RIGHT), LSFT(KC_PGDOWN),
|
||||
_______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______,
|
||||
|
||||
_______, _______,
|
||||
_______,
|
||||
_______, _______, _______,
|
||||
|
||||
|
||||
// -----------------------------------------------------right hand-----------------------------------------------------
|
||||
_______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______,
|
||||
LSFT(KC_HOME), LSFT(KC_END), _______, _______, _______,
|
||||
|
||||
LSFT(KC_LEFT), LSFT(KC_RIGHT),
|
||||
_______,
|
||||
CTR_ALT, _______, _______
|
||||
),
|
||||
|
||||
[COMBOS] = LAYOUT_ergodox(
|
||||
// -----------------------------------------------------left hand-----------------------------------------------------
|
||||
TILD_BLOCK, PRESCRIPTION, _______, _______, FOURS, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______,
|
||||
_______, ADMINS, SARCASM, _______, CTRL_CTV, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______,
|
||||
|
||||
_______, _______,
|
||||
_______,
|
||||
_______, _______, _______,
|
||||
|
||||
// -----------------------------------------------------right hand-----------------------------------------------------
|
||||
_______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______,
|
||||
_______, _______, CTRL_LCTV, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______,
|
||||
|
||||
_______, _______,
|
||||
_______,
|
||||
_______, _______, _______
|
||||
),
|
||||
|
||||
// [STRINGS] = LAYOUT_ergodox(
|
||||
// // -----------------------------------------------------left hand-----------------------------------------------------
|
||||
// _______, _______, _______, _______, _______, _______, _______,
|
||||
// _______, _______, _______, _______, _______, _______, _______,
|
||||
// _______, _______, _______, _______, _______, _______,
|
||||
// _______, _______, _______, _______, _______, _______, _______,
|
||||
// _______, _______, _______, _______, _______,
|
||||
|
||||
// _______, _______,
|
||||
// _______,
|
||||
// _______, _______, _______,
|
||||
|
||||
// // -----------------------------------------------------right hand-----------------------------------------------------
|
||||
// _______, _______, _______, _______, _______, _______, _______,
|
||||
// _______, _______, _______, _______, _______, _______, _______,
|
||||
// _______, _______, _______, _______, _______, _______,
|
||||
// _______, _______, _______, _______, _______, _______, _______,
|
||||
// _______, _______, _______, _______, _______,
|
||||
|
||||
// _______, _______,
|
||||
// _______,
|
||||
// _______, _______, _______
|
||||
// ),
|
||||
|
||||
[MEDIA] = LAYOUT_ergodox(
|
||||
// -----------------------------------------------------left hand-----------------------------------------------------
|
||||
_______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, KC_MPRV, KC_VOLU, KC_MNXT, _______, _______,
|
||||
_______, _______, _______, KC_VOLD, _______, _______,
|
||||
_______, _______, _______, KC_MUTE, KC_MPLY, _______, _______,
|
||||
_______, _______, _______, _______, _______,
|
||||
|
||||
_______, _______,
|
||||
_______,
|
||||
_______, _______, _______,
|
||||
|
||||
// -----------------------------------------------------right hand-----------------------------------------------------
|
||||
_______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, TOG_OS, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______,
|
||||
|
||||
_______, _______,
|
||||
_______,
|
||||
_______, _______, _______
|
||||
),
|
||||
|
||||
[GIT] = LAYOUT_ergodox(
|
||||
// -----------------------------------------------------left hand-----------------------------------------------------
|
||||
_______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, G_DIFF, G_RST, _______, G_BRCH, _______,
|
||||
_______, G_ADD, G_S, _______, _______, _______,
|
||||
_______, _______, _______, G_C, _______, G_MERG, _______,
|
||||
_______, _______, _______, _______, _______,
|
||||
|
||||
_______, _______,
|
||||
_______,
|
||||
_______, _______, _______,
|
||||
|
||||
// -----------------------------------------------------right hand-----------------------------------------------------
|
||||
_______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, G_FTCH, _______, G_P, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______,
|
||||
_______, _______, G_LOG, _______, G_DEV, _______, _______,
|
||||
_______, _______, _______, _______, _______,
|
||||
|
||||
_______, _______,
|
||||
_______,
|
||||
_______, _______, _______
|
||||
),
|
||||
|
||||
[GIT_C] = LAYOUT_ergodox(
|
||||
// -----------------------------------------------------left hand-----------------------------------------------------
|
||||
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||
XXXXXXX, XXXXXXX, XXXXXXX, G_CHEC, XXXXXXX, XXXXXXX,
|
||||
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||
|
||||
XXXXXXX, XXXXXXX,
|
||||
XXXXXXX,
|
||||
XXXXXXX, KC_BSPC, XXXXXXX,
|
||||
|
||||
// -----------------------------------------------------right hand-----------------------------------------------------
|
||||
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||
XXXXXXX, XXXXXXX, XXXXXXX, G_COMM, XXXXXXX, XXXXXXX,
|
||||
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______,
|
||||
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||
|
||||
XXXXXXX, XXXXXXX,
|
||||
XXXXXXX,
|
||||
XXXXXXX, XXXXXXX, XXXXXXX
|
||||
),
|
||||
|
||||
[GIT_S] = LAYOUT_ergodox(
|
||||
// -----------------------------------------------------left hand-----------------------------------------------------
|
||||
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||
XXXXXXX, XXXXXXX, G_STSH, G_SHOW, G_STAT, XXXXXXX,
|
||||
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||
|
||||
XXXXXXX, XXXXXXX,
|
||||
XXXXXXX,
|
||||
XXXXXXX, KC_BSPC, XXXXXXX,
|
||||
|
||||
// -----------------------------------------------------right hand-----------------------------------------------------
|
||||
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||
XXXXXXX, XXXXXXX, XXXXXXX, G_COMM, XXXXXXX, XXXXXXX,
|
||||
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______,
|
||||
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||
|
||||
XXXXXXX, XXXXXXX,
|
||||
XXXXXXX,
|
||||
XXXXXXX, XXXXXXX, XXXXXXX
|
||||
),
|
||||
|
||||
|
||||
/* Numpad
|
||||
*
|
||||
* ,--------------------------------------------------.
|
||||
* | | | | | | / | |
|
||||
* |------+------+------+------+------+------+--------|
|
||||
* | | | 7 | 8 | 9 | * | |
|
||||
* | |------+------+------+------+------+--------|
|
||||
* |------| | 4 | 5 | 6 | - | Enter |
|
||||
* | |------+------+------+------+------+--------|
|
||||
* | | | 1 | 2 | 3 | + | Enter |
|
||||
* `-------------+------+------+------+------+--------'
|
||||
* | | 0 | . | Calc | Calc |
|
||||
* `----------------------------------'
|
||||
*/
|
||||
|
||||
// [] = LAYOUT_ergodox(
|
||||
// // -----------------------------------------------------left hand-----------------------------------------------------
|
||||
// _______, _______, _______, _______, _______, _______, _______,
|
||||
// _______, _______, _______, _______, _______, _______, _______,
|
||||
// _______, _______, _______, _______, _______, _______,
|
||||
// _______, _______, _______, _______, _______, _______, _______,
|
||||
// _______, _______, _______, _______, _______,
|
||||
|
||||
// _______, _______,
|
||||
// _______,
|
||||
// _______, _______, _______,
|
||||
|
||||
// // -----------------------------------------------------right hand-----------------------------------------------------
|
||||
// _______, _______, _______, _______, _______, _______, _______,
|
||||
// _______, _______, _______, _______, _______, _______, _______,
|
||||
// _______, _______, _______, _______, _______, _______,
|
||||
// _______, _______, _______, _______, _______, _______, _______,
|
||||
// _______, _______, _______, _______, _______,
|
||||
|
||||
// _______, _______,
|
||||
// _______,
|
||||
// _______, _______, _______
|
||||
// ),
|
||||
|
||||
};
|
||||
|
||||
bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
|
||||
switch (keycode) {
|
||||
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -37,8 +37,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define MATRIX_COL_PINS {F0,F1,E6,C7,C6,B7,D4,B1,B0,B5,B4,D7,D6,B3,F4}
|
||||
#define UNUSED_PINS
|
||||
|
||||
#define BACKLIGHT_PIN B6
|
||||
|
||||
/* COL2ROW or ROW2COL */
|
||||
#define DIODE_DIRECTION COL2ROW
|
||||
|
||||
@@ -53,8 +51,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
/* Locking resynchronize hack */
|
||||
#define LOCKING_RESYNC_ENABLE
|
||||
|
||||
/* Backlight configuration
|
||||
*/
|
||||
/* Backlight configuration */
|
||||
#define BACKLIGHT_PIN B6
|
||||
#define BACKLIGHT_BREATHING
|
||||
#define BACKLIGHT_LEVELS 4
|
||||
|
||||
/*
|
||||
|
||||
57
keyboards/the_royal/liminal/keymaps/via/keymap.c
Normal file
57
keyboards/the_royal/liminal/keymaps/via/keymap.c
Normal file
@@ -0,0 +1,57 @@
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
LAYOUT_base_kit_all(
|
||||
KC_ESC, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINUS, KC_BSPC,
|
||||
KC_PGUP, KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOTE, KC_ENT,
|
||||
KC_PGDN, KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, MO(3),
|
||||
KC_END, KC_DEL, KC_LGUI, KC_LALT, MO(1), KC_SPACE, KC_CAPS, MO(2), KC_MENU, KC_RCTL
|
||||
),
|
||||
|
||||
LAYOUT_base_kit_all(
|
||||
KC_GRAVE, _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_UNDS, _______,
|
||||
KC_TILD, _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DQT, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
),
|
||||
|
||||
LAYOUT_base_kit_all(
|
||||
KC_BSLS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_EQUAL, _______,
|
||||
KC_PIPE, KC_CAPS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PLUS, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LBRC, KC_RBRC, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
),
|
||||
|
||||
LAYOUT_base_kit_all(
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_UP, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_RGHT, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DOWN, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
)
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
void keyboard_post_init_user(void) {
|
||||
layer_state_set_user(layer_state);
|
||||
}
|
||||
|
||||
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||
switch (get_highest_layer(state)) {
|
||||
case 1:
|
||||
rgblight_setrgb (RGB_CORAL);
|
||||
break;
|
||||
case 2:
|
||||
rgblight_setrgb (RGB_RED);
|
||||
break;
|
||||
case 3:
|
||||
rgblight_setrgb (RGB_BLUE);
|
||||
break;
|
||||
default: // for any other layers, or the default layer
|
||||
rgblight_setrgb (RGB_GREEN);
|
||||
break;
|
||||
}
|
||||
return state;
|
||||
}
|
||||
3
keyboards/the_royal/liminal/keymaps/via/readme.md
Normal file
3
keyboards/the_royal/liminal/keymaps/via/readme.md
Normal file
@@ -0,0 +1,3 @@
|
||||
# The VIA keymap for the Liminal Keyboard
|
||||
|
||||
This keymap is for compatibility with the VIA configurator.
|
||||
1
keyboards/the_royal/liminal/keymaps/via/rules.mk
Normal file
1
keyboards/the_royal/liminal/keymaps/via/rules.mk
Normal file
@@ -0,0 +1 @@
|
||||
VIA_ENABLE = yes
|
||||
@@ -1,16 +1,95 @@
|
||||
#include QMK_KEYBOARD_H
|
||||
#include <art.h>
|
||||
#include <sendstring_workman_zxcvm.h>
|
||||
|
||||
enum layer_names {
|
||||
BASE,
|
||||
QWERTY_MOD,
|
||||
QWERTY,
|
||||
WORKMAN,
|
||||
MOD,
|
||||
MEDIA
|
||||
bool is_win = false;
|
||||
|
||||
enum custom_keycodes {
|
||||
keyboardSpecificKeyCode = NEW_SAFE_RANGE //not used atm
|
||||
};
|
||||
|
||||
bool led_update_user(led_t led_state) {
|
||||
writePin(CAPSLOCK_LED_PIN, led_state.caps_lock);
|
||||
return false;
|
||||
}
|
||||
|
||||
void led_show_current_os(void) {
|
||||
if (is_win) {
|
||||
writePinHigh(NUMLOCK_LED_PIN);
|
||||
wait_ms(50);
|
||||
writePinLow(NUMLOCK_LED_PIN);
|
||||
wait_ms(50);
|
||||
writePinHigh(NUMLOCK_LED_PIN);
|
||||
wait_ms(50);
|
||||
writePinLow(NUMLOCK_LED_PIN);
|
||||
wait_ms(50);
|
||||
writePinHigh(NUMLOCK_LED_PIN);
|
||||
wait_ms(50);
|
||||
writePinLow(NUMLOCK_LED_PIN);
|
||||
wait_ms(50);
|
||||
} else {
|
||||
writePinHigh(SCROLLLOCK_LED_PIN);
|
||||
wait_ms(50);
|
||||
writePinLow(SCROLLLOCK_LED_PIN);
|
||||
wait_ms(50);
|
||||
writePinHigh(SCROLLLOCK_LED_PIN);
|
||||
wait_ms(50);
|
||||
writePinLow(SCROLLLOCK_LED_PIN);
|
||||
wait_ms(50);
|
||||
writePinHigh(SCROLLLOCK_LED_PIN);
|
||||
wait_ms(50);
|
||||
writePinLow(SCROLLLOCK_LED_PIN);
|
||||
wait_ms(50);
|
||||
}
|
||||
}
|
||||
|
||||
void keyboard_pre_init_user(void) {
|
||||
led_show_current_os();
|
||||
|
||||
layer_state_set_user(layer_state);
|
||||
}
|
||||
|
||||
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||
writePinLow(NUMLOCK_LED_PIN);
|
||||
writePinLow(SCROLLLOCK_LED_PIN);
|
||||
switch (get_highest_layer(state)) {
|
||||
case MEDIA:
|
||||
writePinHigh(SCROLLLOCK_LED_PIN);
|
||||
case BASE:
|
||||
writePinHigh(NUMLOCK_LED_PIN);
|
||||
break;
|
||||
case NUMPAD:
|
||||
writePinHigh(SCROLLLOCK_LED_PIN);
|
||||
break;
|
||||
}
|
||||
return state;
|
||||
}
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
/* QWERTY ,-----------------------------------------. ,-----------------------------------------------------.
|
||||
* | ESC | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 |Print| Ins | Home|
|
||||
* ,-----------. |-----+-----+-----+-----+-----+-----+-----| |-----+-----+-----+-----+-----+-----+-----------+-----|
|
||||
* | 8 | 9 | | ~ | 1 | 2 | 3 | 4 | 5 | 6 | | 7 | 8 | 9 | 0 | - | = | Backspac | Del |
|
||||
* |-----+-----| |-----------------------------------------' ,--------------------------------------------------+-----|
|
||||
* | 6 | 7 | | Tab | Q | W | E | R | T | | Y | U | I | O | P | [ | ] | \ | End |
|
||||
* |-----+-----| |---------------------------------------. `--------------------------------------------------+-----|
|
||||
* | 4 | 5 | | Caps | A | S | D | F | G | | H | J | K | L | ; | ' | Enter | PgUp|
|
||||
* |-----+-----| |-----------------------------------------. `-------------------------------------------------+-----|
|
||||
* | 2 | 3 | | Shift | Z | X | C | V | B | | N | M | , | . | / | Shift | Up | PgDn|
|
||||
* |-----+-----| |-----------------------------------------' ,-------------------------------------------+-----+-----|
|
||||
* | 0 | 1 | | Ctrl | GUI | Alt |Spac/MEDIA | BSPC| | NAV | Alt | NAV | Ctrl | Left| Down|Right|
|
||||
* `-----------' `---------------------------------------' `-------------------------------------------------------'
|
||||
*/
|
||||
[QWERTY] = LAYOUT(
|
||||
//--------------------------------Left Hand------------------------------------| |--------------------------------Right Hand------------------------------------------------
|
||||
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, LT(CONFIG, KC_PSCR), KC_INS, KC_HOME,
|
||||
KC_VOLD,KC_VOLU, KC_GRAVE, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, KC_EQUAL, KC_BSPC, KC_DEL,
|
||||
KC_MPRV,KC_MNXT, 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_END,
|
||||
KC_HOME,KC_END, 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_ENTER, KC_PGUP,
|
||||
DYN_MACRO_PLAY1,MO(STRINGS),KC_LSFT,KC_Z,KC_X,KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, LT(GIT,KC_SLSH), KC_RSFT, KC_UP, KC_PGDN,
|
||||
DYN_REC_STOP,DYN_REC_START1,KC_LCTL, KC_LGUI, KC_LALT, LT(MEDIA,KC_SPC), LT(COMBOS,KC_BSPC), LT(NAV, KC_ENTER), KC_RALT, MO(LAYOUT_CHG),KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT
|
||||
),
|
||||
|
||||
/* Base ,-----------------------------------------. ,-----------------------------------------------------.
|
||||
* | ESC | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 |Print| Ins | Home|
|
||||
* ,-----------. |-----+-----+-----+-----+-----+-----+-----| |-----+-----+-----+-----+-----+-----+-----------+-----|
|
||||
@@ -27,28 +106,64 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
*/
|
||||
[BASE] = LAYOUT(
|
||||
//--------------------------------Left Hand-----------------------------------| |--------------------------------Right Hand------------------------------------------------
|
||||
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_INS, KC_HOME,
|
||||
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, LT(CONFIG, KC_PSCR), KC_INS, KC_HOME,
|
||||
KC_8, KC_9, KC_GRAVE, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, KC_EQUAL, KC_BSPC, KC_DEL,
|
||||
KC_6, KC_7, 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_END,
|
||||
KC_4, KC_5, 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_ENTER, KC_PGUP,
|
||||
KC_2, KC_3, 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_0, KC_1, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, MO(QWERTY_MOD), KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT
|
||||
KC_0, KC_1, OS_CTRL, OS_WIN, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, MO(QWERTY_MOD), KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT
|
||||
),
|
||||
|
||||
/*QWERT On + Mod ,-----------------------------------------. ,-----------------------------------------------------.
|
||||
* | | | | | | | | | | | | | | | | | |
|
||||
* ,-----------. |-----+-----+-----+-----+-----+-----+-----| |-----+-----+-----+-----+-----+-----+-----------+-----|
|
||||
* | | | | | | | | | | | | | | | | | | | |
|
||||
* |-----+-----| |-----------------------------------------' ,--------------------------------------------------+-----|
|
||||
* | | | | |MePrv| Vol+|MeNxt| | | | | | | | | | | | |
|
||||
* |-----+-----| |---------------------------------------. `--------------------------------------------------+-----|
|
||||
* | | | | | | Vol-| | | | | | | | | | | | |
|
||||
* |-----+-----| |-----------------------------------------. `-------------------------------------------------+-----|
|
||||
* | | | | | | Vol0|MePly| | | | | | | | | | | |
|
||||
* |-----+-----| |-----------------------------------------' ,-------------------------------------------+-----+-----|
|
||||
* | | | | QWERTY | | | | | | | | | | | | |
|
||||
* `-----------' `---------------------------------------' `-------------------------------------------------------'
|
||||
*/
|
||||
[WORKMAN] = LAYOUT(
|
||||
//--------------------------------Left Hand-----------------------------------------------| |--------------------------------Right Hand------------------------------------------------
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, KC_Q, KC_D, KC_R, KC_W, KC_B, KC_J, KC_F, KC_U, KC_P, KC_SCLN, _______, _______, _______, _______,
|
||||
_______, _______, _______, KC_A, KC_S, KC_H, KC_T, KC_G, KC_Y, KC_N, KC_E, KC_O, KC_I, _______, _______, _______,
|
||||
_______, _______, _______, KC_Z, KC_X, KC_C, KC_V, KC_M, KC_K, KC_L, KC_COMM, KC_DOT, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, TO(QWERTY), _______, _______, _______, _______
|
||||
),
|
||||
|
||||
[NAV] = LAYOUT(
|
||||
//--------------------------------Left Hand-----------------------------------------------| |--------------------------------Right Hand------------------------------------------------
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
KC_8, KC_9, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
KC_6, KC_7, _______, _______, KC_HOME, KC_UP, KC_END, KC_PGUP, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
KC_4, KC_5, _______, _______, KC_LEFT, KC_DOWN, KC_RIGHT, KC_PGDOWN, _______, CTR_ALT, KC_RSFT, _______, _______, _______, _______, _______,
|
||||
KC_2, KC_3, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
KC_0, KC_1, _______, _______, _______, KC_DEL, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
),
|
||||
|
||||
[MEDIA] = LAYOUT(
|
||||
//--------------------------------Left Hand-----------------------------------------------| |--------------------------------Right Hand------------------------------------------------
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, KC_MPRV, KC_VOLU, KC_MNXT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, KC_VOLD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, KC_MUTE, KC_MPLY, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
),
|
||||
|
||||
[COMBOS] = LAYOUT(
|
||||
//--------------------------------Left Hand-----------------------------------------------| |--------------------------------Right Hand------------------------------------------------
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, SARCASM, _______, CTRL_CTV, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, CTRL_CAV, _______, _______, _______, CTRL_LCTV, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
),
|
||||
|
||||
[STRINGS] = LAYOUT(
|
||||
//--------------------------------Left Hand-----------------------------------------------| |--------------------------------Right Hand------------------------------------------------
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, TILD_BLOCK, PRESCRIPTION, _______, _______, FOURS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, ADMINS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
),
|
||||
|
||||
[QWERTY_MOD] = LAYOUT(
|
||||
//--------------------------------Left Hand-----------------------------------------------| |--------------------------------Right Hand------------------------------------------------
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
@@ -58,80 +173,68 @@ _______, _______, _______, _______, KC_VOLD, _______, _______, _______,
|
||||
_______, _______, _______, _______, KC_MUTE, KC_MPLY, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, TO(QWERTY),_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
),
|
||||
|
||||
/* QWERTY ,-----------------------------------------. ,-----------------------------------------------------.
|
||||
* | ESC | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 |Print| Ins | Home|
|
||||
* ,-----------. |-----+-----+-----+-----+-----+-----+-----| |-----+-----+-----+-----+-----+-----+-----------+-----|
|
||||
* | 8 | 9 | | ~ | 1 | 2 | 3 | 4 | 5 | 6 | | 7 | 8 | 9 | 0 | - | = | Backspac | Del |
|
||||
* |-----+-----| |-----------------------------------------' ,--------------------------------------------------+-----|
|
||||
* | 6 | 7 | | Tab | Q | W | E | R | T | | Y | U | I | O | P | [ | ] | \ | End |
|
||||
* |-----+-----| |---------------------------------------. `--------------------------------------------------+-----|
|
||||
* | 4 | 5 | | Caps | A | S | D | F | G | | H | J | K | L | ; | ' | Enter | PgUp|
|
||||
* |-----+-----| |-----------------------------------------. `-------------------------------------------------+-----|
|
||||
* | 2 | 3 | | Shift | Z | X | C | V | B | | N | M | , | . | / | Shift | Up | PgDn|
|
||||
* |-----+-----| |-----------------------------------------' ,-------------------------------------------+-----+-----|
|
||||
* | 0 | 1 | | Ctrl | GUI | Alt |Spac/MEDIA | BSPC| | MOD | Alt | MOD | Ctrl | Left| Down|Right|
|
||||
* `-----------' `---------------------------------------' `-------------------------------------------------------'
|
||||
*/
|
||||
[QWERTY] = LAYOUT(
|
||||
//--------------------------------Left Hand------------------------------------| |--------------------------------Right Hand------------------------------------------------
|
||||
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_INS, KC_HOME,
|
||||
KC_8, KC_9, KC_GRAVE, KC_1, KC_2, LGUI_T(KC_3), LALT_T(KC_4), LCTL_T(KC_5), KC_6, KC_7, LCTL_T(KC_8), LALT_T(KC_9), LGUI_T(KC_0), KC_MINUS, KC_EQUAL, KC_BSPC, KC_DEL,
|
||||
KC_6, KC_7, 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_END,
|
||||
KC_4, KC_5, 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_ENTER, KC_PGUP,
|
||||
KC_2, KC_3, 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_0, KC_1, KC_LCTL, KC_LGUI, KC_LALT, LT(MEDIA, KC_SPC),KC_BSPC, MO(MOD), KC_RALT, MO(MOD),KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT
|
||||
|
||||
[LAYOUT_CHG] = LAYOUT(
|
||||
//--------------------------------Left Hand-----------------------------------------------| |--------------------------------Right Hand------------------------------------------------
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, CTL_ALT(KC_HOME), CTL_ALT(KC_UP), CTL_ALT(KC_END), CTL_ALT(KC_PGUP), _______, _______,_______, _______,_______,_______,_______, _______, _______,
|
||||
_______, _______, _______, _______, CTL_ALT(KC_LEFT), CTL_ALT(KC_DOWN), CTL_ALT(KC_RIGHT), CTL_ALT(KC_PGDOWN), _______,_______,_______,_______,_______, _______, _______, _______,
|
||||
_______, _______, TO(WORKMAN), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
TO(NUMPAD), TO(NUMPAD), TO(BASE), _______, _______, _______, CTL_ALT(KC_BSPC), KC_LSFT, _______, _______, _______, _______, _______, _______
|
||||
),
|
||||
|
||||
[CONFIG] = LAYOUT(
|
||||
//--------------------------------Left Hand-----------------------------------------------| |--------------------------------Right Hand------------------------------------------------
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
RGB_VAI, RGB_VAD, RGB_MODE_PLAIN, RGB_MODE_BREATHE, RGB_MODE_RAINBOW, RGB_MODE_SWIRL, RGB_MODE_SNAKE, RGB_MODE_KNIGHT, RGB_MODE_XMAS, RGB_MODE_GRADIENT, RGB_MODE_RGBTEST, XXXXXXX, XXXXXXX, _______, _______, _______, _______,
|
||||
RGB_SAI, RGB_SAD, _______, _______, _______, _______, _______, _______, _______, _______, _______, TOG_OS, _______, _______, _______, _______, _______,
|
||||
RGB_HUI, RGB_HUD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
RGB_MOD, RGB_RMOD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
RGB_TOG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
),
|
||||
|
||||
/* WORKMAN ,-----------------------------------------. ,-----------------------------------------------------.
|
||||
* | | | | | | | | | | | | | | | | | |
|
||||
* ,-----------. |-----+-----+-----+-----+-----+-----+-----| |-----+-----+-----+-----+-----+-----+-----------+-----|
|
||||
* | | | | | | | | | | | | | | | | | | | |
|
||||
* |-----+-----| |-----------------------------------------' ,--------------------------------------------------+-----|
|
||||
* | | | | | | | | | | | | | | | | | | | |
|
||||
* |-----+-----| |---------------------------------------. `--------------------------------------------------+-----|
|
||||
* | | | | | | | | | | | | | | | | | | |
|
||||
* |-----+-----| |-----------------------------------------. `-------------------------------------------------+-----|
|
||||
* | | | | | | | | | | | | | | | | | | |
|
||||
* |-----+-----| |-----------------------------------------' ,-------------------------------------------+-----+-----|
|
||||
* | | | | BASE | | | | | | | | | | | | |
|
||||
* `-----------' `---------------------------------------' `-------------------------------------------------------'
|
||||
*/
|
||||
[WORKMAN] = LAYOUT(
|
||||
[NUMPAD] = LAYOUT(
|
||||
//--------------------------------Left Hand-----------------------------------------------| |--------------------------------Right Hand------------------------------------------------
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, KC_Q, KC_D, KC_R, KC_W, KC_B, KC_J, KC_F, KC_U, KC_P, KC_SCLN,_______,_______, _______, _______,
|
||||
_______, _______, _______, KC_A, KC_S, KC_H, KC_T, KC_G, KC_Y, KC_N, KC_E, KC_O, KC_I, _______, _______, _______,
|
||||
_______, _______, _______, KC_Z, KC_X, KC_C, KC_V, KC_M, KC_K, KC_L, KC_COMM,KC_DOT, KC_SLSH, _______, _______, _______,
|
||||
_______, _______, TO(BASE), _______,_______,_______, _______, _______, _______, TO(QWERTY), _______, _______, _______, _______
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
KC_8, KC_9, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
KC_6, KC_7, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
KC_4, KC_5, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
KC_2, KC_3, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
KC_0, KC_1, _______, _______, _______, _______, _______, _______, _______, TO(QWERTY),_______, _______, _______, _______
|
||||
),
|
||||
|
||||
/* MOD ,-----------------------------------------. ,-----------------------------------------------------.
|
||||
* | | | | | | | | | | | | | | | | | |
|
||||
* ,-----------. |-----+-----+-----+-----+-----+-----+-----| |-----+-----+-----+-----+-----+-----+-----------+-----|
|
||||
* | | | | | | | | | | | | | | | | | | | |
|
||||
* |-----+-----| |-----------------------------------------' ,--------------------------------------------------+-----|
|
||||
* | | | | | | | | | | | | | | | | | | | |
|
||||
* |-----+-----| |---------------------------------------. `--------------------------------------------------+-----|
|
||||
* | | | | | | | | | | | | | | | | | | |
|
||||
* |-----+-----| |-----------------------------------------. `-------------------------------------------------+-----|
|
||||
* | | | | | | | | | | | | | | | | | | |
|
||||
* |-----+-----| |-----------------------------------------' ,-------------------------------------------+-----+-----|
|
||||
* | | | | BASE | | | | | | | | | | | | |
|
||||
* `-----------' `---------------------------------------' `-------------------------------------------------------'
|
||||
*/
|
||||
[MOD] = LAYOUT(
|
||||
[GIT] = LAYOUT(
|
||||
//--------------------------------Left Hand-----------------------------------------------| |--------------------------------Right Hand------------------------------------------------
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, KC_HOME, KC_UP, KC_END, KC_PGUP, _______, KC_MS_BTN1,KC_MS_UP, KC_MS_BTN3,KC_MS_BTN2,_______,_______, _______, _______,
|
||||
_______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RIGHT, KC_PGDOWN, _______,KC_MS_LEFT,KC_MS_DOWN,KC_MS_RIGHT,KC_APPLICATION, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, TO(WORKMAN),TO(BASE), KC_MS_ACCEL0,KC_MS_ACCEL1,KC_MS_ACCEL2, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
_______, _______, _______, _______, G_DIFF, G_RST, _______, G_BRCH, _______, G_FTCH, _______, G_P, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, G_ADD, G_S, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, G_C, _______, G_MERG, _______, G_LOG, _______, G_DEV, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
),
|
||||
|
||||
/* MEDIA ,-----------------------------------------. ,-----------------------------------------------------.
|
||||
[GIT_C] = LAYOUT(
|
||||
//--------------------------------Left Hand-----------------------------------------------| |--------------------------------Right Hand------------------------------------------------
|
||||
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX,
|
||||
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, G_CHEC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, G_COMM, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||
XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX,
|
||||
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_BSPC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX
|
||||
),
|
||||
|
||||
[GIT_S] = LAYOUT(
|
||||
//--------------------------------Left Hand-----------------------------------------------| |--------------------------------Right Hand------------------------------------------------
|
||||
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX,
|
||||
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, G_STSH, G_SHOW, G_STAT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||
XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX,
|
||||
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_BSPC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX
|
||||
),
|
||||
|
||||
/* ,-----------------------------------------. ,-----------------------------------------------------.
|
||||
* | | | | | | | | | | | | | | | | | |
|
||||
* ,-----------. |-----+-----+-----+-----+-----+-----+-----| |-----+-----+-----+-----+-----+-----+-----------+-----|
|
||||
* | | | | | | | | | | | | | | | | | | | |
|
||||
@@ -140,50 +243,25 @@ _______, TO(WORKMAN),TO(BASE), KC_MS_ACCEL0,KC_MS_ACCEL1,KC_MS_ACCEL2, _______,
|
||||
* |-----+-----| |---------------------------------------. `--------------------------------------------------+-----|
|
||||
* | | | | | | | | | | | | | | | | | | |
|
||||
* |-----+-----| |-----------------------------------------. `-------------------------------------------------+-----|
|
||||
* | | | | | | | Play| | | | | | | | | | | |
|
||||
* | | | | | | | | | | | | | | | | | | |
|
||||
* |-----+-----| |-----------------------------------------' ,-------------------------------------------+-----+-----|
|
||||
* | | | | BASE | | | | | | | | | | | | |
|
||||
* | | | | | | | | | | | | | | | | |
|
||||
* `-----------' `---------------------------------------' `-------------------------------------------------------'
|
||||
*/
|
||||
[MEDIA] = LAYOUT(
|
||||
//--------------------------------Left Hand-----------------------------------------------| |--------------------------------Right Hand------------------------------------------------
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, KC_MPRV, KC_VOLU, KC_MNXT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, KC_VOLD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, KC_MUTE, KC_MPLY, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
)
|
||||
// [] = LAYOUT(
|
||||
// //--------------------------------Left Hand-----------------------------------------------| |--------------------------------Right Hand------------------------------------------------
|
||||
// _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
// _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
// _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
// _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
// _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
// _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
// ),
|
||||
};
|
||||
|
||||
bool led_update_user(led_t led_state) {
|
||||
writePin(CAPSLOCK_LED_PIN, led_state.caps_lock);
|
||||
return false;
|
||||
}
|
||||
bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
|
||||
switch (keycode) {
|
||||
|
||||
void keyboard_pre_init_user(void) {
|
||||
writePinHigh(SCROLLLOCK_LED_PIN);
|
||||
wait_ms(50);
|
||||
writePinHigh(CAPSLOCK_LED_PIN);
|
||||
wait_ms(50);
|
||||
writePinHigh(NUMLOCK_LED_PIN);
|
||||
wait_ms(50);
|
||||
writePinLow(SCROLLLOCK_LED_PIN);
|
||||
wait_ms(50);
|
||||
writePinLow(CAPSLOCK_LED_PIN);
|
||||
wait_ms(50);
|
||||
writePinLow(NUMLOCK_LED_PIN);
|
||||
|
||||
layer_state_set_user(layer_state);
|
||||
}
|
||||
|
||||
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||
writePinLow(NUMLOCK_LED_PIN);
|
||||
writePinLow(SCROLLLOCK_LED_PIN);
|
||||
switch (get_highest_layer(state)) {
|
||||
case BASE:
|
||||
writePinHigh(SCROLLLOCK_LED_PIN);
|
||||
break;
|
||||
}
|
||||
return state;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
1
keyboards/wheatfield/split75/keymaps/art/rules.mk
Normal file
1
keyboards/wheatfield/split75/keymaps/art/rules.mk
Normal file
@@ -0,0 +1 @@
|
||||
DYNAMIC_MACRO_ENABLE = yes
|
||||
@@ -1,6 +1,8 @@
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
#define BASE 0
|
||||
enum layer_names {
|
||||
BASE
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
|
||||
1
keyboards/xd60/keymaps/melka/.gitignore
vendored
Normal file
1
keyboards/xd60/keymaps/melka/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
passwd.h
|
||||
20
keyboards/xd60/keymaps/melka/config.h
Normal file
20
keyboards/xd60/keymaps/melka/config.h
Normal file
@@ -0,0 +1,20 @@
|
||||
#pragma once
|
||||
|
||||
#if __GNUC__ > 5
|
||||
# if __has_include("passwd.h")
|
||||
# include "passwd.h"
|
||||
# endif // if file exists
|
||||
#endif // __GNUC__
|
||||
|
||||
#ifndef PASSWORD_A
|
||||
#define PASSWORD_A "1234567890"
|
||||
#endif
|
||||
|
||||
#ifndef PASSWORD_B
|
||||
#define PASSWORD_B "pass123"
|
||||
#endif
|
||||
|
||||
#define RGBLIGHT_LAYERS
|
||||
|
||||
#define LSPO_KEYS KC_LSFT, KC_TRNS, KC_5
|
||||
#define RSPC_KEYS KC_RSFT, KC_TRNS, KC_MINS
|
||||
165
keyboards/xd60/keymaps/melka/keymap.c
Normal file
165
keyboards/xd60/keymaps/melka/keymap.c
Normal file
@@ -0,0 +1,165 @@
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
/*
|
||||
Security Note: While it is possible to use macros to send passwords, credit card numbers,
|
||||
and other sensitive information it is a supremely bad idea to do so. Anyone who gets a hold
|
||||
of your keyboard will be able to access that information by opening a text editor.
|
||||
*/
|
||||
enum custom_keycodes
|
||||
{
|
||||
PASS_A = SAFE_RANGE,
|
||||
PASS_B
|
||||
};
|
||||
|
||||
#define ___ KC_NO
|
||||
|
||||
#define LAYOUT_melka( \
|
||||
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \
|
||||
K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \
|
||||
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \
|
||||
K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \
|
||||
K40, K41, K42, K43, K44, K45, K46, K47, K48) \
|
||||
{ \
|
||||
{K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D}, \
|
||||
{K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, ___}, \
|
||||
{K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K1D}, \
|
||||
{K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3E, K3D}, \
|
||||
{K40, K41, K42, ___, ___, K43, ___, K3C, K46, K0E, K44, K45, K47, K48} \
|
||||
}
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
// 0: Base Layer
|
||||
LAYOUT_melka(
|
||||
KC_NUBS, 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_DEL, KC_BSPC,
|
||||
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_ENT,
|
||||
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_BSLS,
|
||||
MT(KC_LSFT, KC_5), KC_GRV, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, MT(KC_RSFT, KC_MINS), KC_UP, MO(1),
|
||||
KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT, KC_LEFT, KC_DOWN, KC_RIGHT),
|
||||
|
||||
// 1: Function Layer
|
||||
LAYOUT_melka(
|
||||
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______,
|
||||
_______, KC_WH_U, KC_UP, KC_WH_D, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, KC_LEFT, KC_DOWN, KC_RIGHT, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGUP, _______,
|
||||
TO(2), TO(3), _______, KC_APP, BL_STEP, _______, _______, _______, _______, _______, _______, KC_END, KC_PGDN, KC_VOLU, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, KC_VOLD, KC_MUTE),
|
||||
|
||||
// 2: RGB Layer
|
||||
LAYOUT_melka(
|
||||
RGB_TOG, RGB_M_P, RGB_RMOD, RGB_MOD, RGB_M_B, RGB_M_R, RGB_M_SW, RGB_M_SN, RGB_M_K, RGB_M_X, RGB_M_G, RGB_M_T, _______, _______, RESET,
|
||||
_______, RGB_HUD, RGB_HUI, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, RGB_SAD, RGB_SAI, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
TO(0), _______, RGB_VAD, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, PASS_A, PASS_B, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______),
|
||||
|
||||
// 3: Keypad Layer
|
||||
LAYOUT_melka(
|
||||
KC_ESC, _______, _______, _______, _______, _______, _______, _______, _______, KC_NLCK, KC_PEQL, KC_PSLS, KC_PAST, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, KC_P7, KC_P8, KC_P9, KC_PMNS, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, KC_P4, KC_P5, KC_P6, KC_PPLS,
|
||||
TO(0), _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_P1, KC_P2, KC_P3, KC_PENT, TO(0),
|
||||
_______, _______, _______, _______, KC_P0, KC_P0, KC_PDOT, KC_PENT, _______)
|
||||
};
|
||||
|
||||
// Light LEDs 6 to 9 and 12 to 15 red when caps lock is active. Hard to ignore!
|
||||
const rgblight_segment_t PROGMEM rgb_capslock_layer[] = RGBLIGHT_LAYER_SEGMENTS(
|
||||
{2, 4, HSV_RED}, // Light 4 LEDs, starting with LED 6
|
||||
{6, 4, HSV_RED} // Light 4 LEDs, starting with LED 12
|
||||
);
|
||||
// Light LEDs 9 & 10 in cyan when keyboard layer 1 is active
|
||||
const rgblight_segment_t PROGMEM rgb_function_layer[] = RGBLIGHT_LAYER_SEGMENTS(
|
||||
{9, 2, HSV_CYAN}
|
||||
);
|
||||
// Light LEDs 11 & 12 in purple when keyboard layer 2 is active
|
||||
const rgblight_segment_t PROGMEM rgb_backlight_layer[] = RGBLIGHT_LAYER_SEGMENTS(
|
||||
{10, 2, HSV_PURPLE}
|
||||
);
|
||||
const rgblight_segment_t PROGMEM rgb_keypad_layer[] = RGBLIGHT_LAYER_SEGMENTS(
|
||||
{4, 4, HSV_RED}
|
||||
);
|
||||
// Now define the array of layers. Later layers take precedence
|
||||
const rgblight_segment_t* const PROGMEM rgb_layers[] = RGBLIGHT_LAYERS_LIST(
|
||||
rgb_capslock_layer,
|
||||
rgb_function_layer,
|
||||
rgb_backlight_layer, // Overrides caps lock layer
|
||||
rgb_keypad_layer // Overrides other layers
|
||||
);
|
||||
|
||||
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||
// Both layers will light up if both kb layers are active
|
||||
rgblight_set_layer_state(1, layer_state_cmp(state, 1));
|
||||
rgblight_set_layer_state(2, layer_state_cmp(state, 2));
|
||||
return state;
|
||||
}
|
||||
|
||||
bool led_update_user(led_t led_state) {
|
||||
rgblight_set_layer_state(0, led_state.caps_lock);
|
||||
return true;
|
||||
}
|
||||
|
||||
void keyboard_post_init_user(void) {
|
||||
// Enable the LED layers
|
||||
rgblight_layers = rgb_layers;
|
||||
}
|
||||
// Loop
|
||||
void matrix_scan_user(void) {
|
||||
// Empty
|
||||
};
|
||||
|
||||
static bool control_disabled = false;
|
||||
static bool delete_pressed = false;
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record)
|
||||
{
|
||||
if (keycode == KC_BSPC)
|
||||
{
|
||||
if (record->event.pressed)
|
||||
{
|
||||
if (keyboard_report->mods & MOD_BIT(KC_LCTL))
|
||||
{
|
||||
delete_pressed = true;
|
||||
control_disabled = true;
|
||||
unregister_code(KC_LCTL);
|
||||
register_code(KC_DEL);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (delete_pressed)
|
||||
{
|
||||
delete_pressed = false;
|
||||
unregister_code(KC_DEL);
|
||||
|
||||
if (control_disabled)
|
||||
{
|
||||
control_disabled = false;
|
||||
register_code(KC_LCTL);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (keycode == KC_LCTL && !record->event.pressed && delete_pressed)
|
||||
{
|
||||
delete_pressed = false;
|
||||
control_disabled = false;
|
||||
unregister_code(KC_DEL);
|
||||
register_code(KC_BSPC);
|
||||
return false;
|
||||
}
|
||||
|
||||
switch (keycode)
|
||||
{
|
||||
case PASS_A:
|
||||
if (record->event.pressed)
|
||||
{
|
||||
SEND_STRING(PASSWORD_A "\n");
|
||||
}
|
||||
break;
|
||||
case PASS_B:
|
||||
if (record->event.pressed)
|
||||
{
|
||||
SEND_STRING(PASSWORD_B "\n");
|
||||
}
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
10
keyboards/xd60/keymaps/melka/passwd_template.h
Normal file
10
keyboards/xd60/keymaps/melka/passwd_template.h
Normal file
@@ -0,0 +1,10 @@
|
||||
/*
|
||||
To define your password, rename this file to passwd.h and edit the defines below.
|
||||
|
||||
Security Note: While it is possible to use macros to send passwords, credit card numbers,
|
||||
and other sensitive information it is a supremely bad idea to do so. Anyone who gets a hold
|
||||
of your keyboard will be able to access that information by opening a text editor.
|
||||
*/
|
||||
|
||||
#define PASSWORD_A "enter your first password here"
|
||||
#define PASSWORD_B "second password if you need"
|
||||
21
keyboards/xd60/keymaps/melka/readme.md
Normal file
21
keyboards/xd60/keymaps/melka/readme.md
Normal file
@@ -0,0 +1,21 @@
|
||||
# melka's keymap for XIUDI's 60% XD60 rev3 PCB
|
||||
|
||||
## Additional Notes
|
||||
Custom Keymap for XD60 rev3. French Mac layout.
|
||||
|
||||
## Security Note
|
||||
This keymap includes macros for entering passwords.
|
||||
|
||||
While it is possible to use macros to send passwords, credit card numbers,
|
||||
and other sensitive information it is a supremely bad idea to do so. Anyone who gets a hold
|
||||
of your keyboard will be able to access that information by opening a text editor.
|
||||
|
||||
Use this functionnality at your own risk.
|
||||
|
||||
To define your password, rename passwd_template.h file to passwd.h and edit the defines inside.
|
||||
|
||||
## Build
|
||||
|
||||
To build this keymap, simply run:
|
||||
|
||||
make xd60/rev3:melka # XD60 rev3
|
||||
@@ -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 0x0909
|
||||
#define VENDOR_ID 0x594D // "YM"
|
||||
#define PRODUCT_ID 0x4409 // "D" + 09
|
||||
#define DEVICE_VER 0x0001
|
||||
#define MANUFACTURER YMDK
|
||||
#define PRODUCT YMD09
|
||||
|
||||
20
keyboards/ymdk/ymd09/keymaps/via/keymap.c
Normal file
20
keyboards/ymdk/ymd09/keymaps/via/keymap.c
Normal file
@@ -0,0 +1,20 @@
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
[0] = LAYOUT(KC_KP_7, KC_KP_8, KC_KP_9,
|
||||
KC_KP_4, LT(1, KC_KP_5), KC_KP_6,
|
||||
KC_KP_1, KC_KP_2, KC_KP_3),
|
||||
|
||||
[1] = LAYOUT(RGB_RMOD, RGB_VAI, RGB_MOD,
|
||||
RGB_HUI, RESET, RGB_SAI,
|
||||
RGB_HUD, RGB_VAD, RGB_SAD),
|
||||
|
||||
[2] = LAYOUT(KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS),
|
||||
|
||||
[3] = LAYOUT(KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS),
|
||||
};
|
||||
1
keyboards/ymdk/ymd09/keymaps/via/rules.mk
Normal file
1
keyboards/ymdk/ymd09/keymaps/via/rules.mk
Normal file
@@ -0,0 +1 @@
|
||||
VIA_ENABLE = yes
|
||||
@@ -30,3 +30,4 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
AUDIO_ENABLE = no # Audio output on port C6
|
||||
FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
|
||||
HD44780_ENABLE = no # Enable support for HD44780 based LCDs
|
||||
LTO_ENABLE = yes # reduce firmware size
|
||||
|
||||
@@ -131,7 +131,10 @@ def check_submodules():
|
||||
cli.log.warn('Submodule %s is not available.', submodule['name'])
|
||||
elif not submodule['status']:
|
||||
if submodule['name'] in ESSENTIAL_SUBMODULES:
|
||||
cli.log.warn('Submodule %s is not up to date!')
|
||||
cli.log.error('Submodule %s is not up to date!', submodule['name'])
|
||||
ok = False
|
||||
else:
|
||||
cli.log.warn('Submodule %s is not up to date!', submodule['name'])
|
||||
|
||||
return ok
|
||||
|
||||
|
||||
@@ -48,17 +48,22 @@ static void init_pins(void) {
|
||||
}
|
||||
|
||||
static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) {
|
||||
matrix_row_t last_row_value = current_matrix[current_row];
|
||||
current_matrix[current_row] = 0;
|
||||
// Start with a clear matrix row
|
||||
matrix_row_t current_row_value = 0;
|
||||
|
||||
for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) {
|
||||
pin_t pin = direct_pins[current_row][col_index];
|
||||
if (pin != NO_PIN) {
|
||||
current_matrix[current_row] |= readPin(pin) ? 0 : (MATRIX_ROW_SHIFTER << col_index);
|
||||
current_row_value |= readPin(pin) ? 0 : (MATRIX_ROW_SHIFTER << col_index);
|
||||
}
|
||||
}
|
||||
|
||||
return (last_row_value != current_matrix[current_row]);
|
||||
// If the row has changed, store the row and return the changed flag.
|
||||
if (current_matrix[current_row] != current_row_value) {
|
||||
current_matrix[current_row] = current_row_value;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
#elif defined(DIODE_DIRECTION)
|
||||
@@ -85,11 +90,8 @@ static void init_pins(void) {
|
||||
}
|
||||
|
||||
static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) {
|
||||
// Store last value of row prior to reading
|
||||
matrix_row_t last_row_value = current_matrix[current_row];
|
||||
|
||||
// Clear data in matrix row
|
||||
current_matrix[current_row] = 0;
|
||||
// Start with a clear matrix row
|
||||
matrix_row_t current_row_value = 0;
|
||||
|
||||
// Select row and wait for row selecton to stabilize
|
||||
select_row(current_row);
|
||||
@@ -101,13 +103,18 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
|
||||
uint8_t pin_state = readPin(col_pins[col_index]);
|
||||
|
||||
// Populate the matrix row with the state of the col pin
|
||||
current_matrix[current_row] |= pin_state ? 0 : (MATRIX_ROW_SHIFTER << col_index);
|
||||
current_row_value |= pin_state ? 0 : (MATRIX_ROW_SHIFTER << col_index);
|
||||
}
|
||||
|
||||
// Unselect row
|
||||
unselect_row(current_row);
|
||||
|
||||
return (last_row_value != current_matrix[current_row]);
|
||||
// If the row has changed, store the row and return the changed flag.
|
||||
if (current_matrix[current_row] != current_row_value) {
|
||||
current_matrix[current_row] = current_row_value;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
# elif (DIODE_DIRECTION == ROW2COL)
|
||||
@@ -142,20 +149,22 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col)
|
||||
// For each row...
|
||||
for (uint8_t row_index = 0; row_index < MATRIX_ROWS; row_index++) {
|
||||
// Store last value of row prior to reading
|
||||
matrix_row_t last_row_value = current_matrix[row_index];
|
||||
matrix_row_t last_row_value = current_matrix[row_index];
|
||||
matrix_row_t current_row_value = last_row_value;
|
||||
|
||||
// Check row pin state
|
||||
if (readPin(row_pins[row_index]) == 0) {
|
||||
// Pin LO, set col bit
|
||||
current_matrix[row_index] |= (MATRIX_ROW_SHIFTER << current_col);
|
||||
current_row_value |= (MATRIX_ROW_SHIFTER << current_col);
|
||||
} else {
|
||||
// Pin HI, clear col bit
|
||||
current_matrix[row_index] &= ~(MATRIX_ROW_SHIFTER << current_col);
|
||||
current_row_value &= ~(MATRIX_ROW_SHIFTER << current_col);
|
||||
}
|
||||
|
||||
// Determine if the matrix changed state
|
||||
if ((last_row_value != current_matrix[row_index]) && !(matrix_changed)) {
|
||||
matrix_changed = true;
|
||||
if ((last_row_value != current_row_value)) {
|
||||
matrix_changed |= true;
|
||||
current_matrix[row_index] = current_row_value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -65,17 +65,22 @@ static void init_pins(void) {
|
||||
}
|
||||
|
||||
static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) {
|
||||
matrix_row_t last_row_value = current_matrix[current_row];
|
||||
current_matrix[current_row] = 0;
|
||||
// Start with a clear matrix row
|
||||
matrix_row_t current_row_value = 0;
|
||||
|
||||
for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) {
|
||||
pin_t pin = direct_pins[current_row][col_index];
|
||||
if (pin != NO_PIN) {
|
||||
current_matrix[current_row] |= readPin(pin) ? 0 : (MATRIX_ROW_SHIFTER << col_index);
|
||||
current_row_value |= readPin(pin) ? 0 : (MATRIX_ROW_SHIFTER << col_index);
|
||||
}
|
||||
}
|
||||
|
||||
return (last_row_value != current_matrix[current_row]);
|
||||
// If the row has changed, store the row and return the changed flag.
|
||||
if (current_matrix[current_row] != current_row_value) {
|
||||
current_matrix[current_row] = current_row_value;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
#elif defined(DIODE_DIRECTION)
|
||||
@@ -102,11 +107,8 @@ static void init_pins(void) {
|
||||
}
|
||||
|
||||
static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) {
|
||||
// Store last value of row prior to reading
|
||||
matrix_row_t last_row_value = current_matrix[current_row];
|
||||
|
||||
// Clear data in matrix row
|
||||
current_matrix[current_row] = 0;
|
||||
// Start with a clear matrix row
|
||||
matrix_row_t current_row_value = 0;
|
||||
|
||||
// Select row and wait for row selecton to stabilize
|
||||
select_row(current_row);
|
||||
@@ -118,13 +120,18 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
|
||||
uint8_t pin_state = readPin(col_pins[col_index]);
|
||||
|
||||
// Populate the matrix row with the state of the col pin
|
||||
current_matrix[current_row] |= pin_state ? 0 : (MATRIX_ROW_SHIFTER << col_index);
|
||||
current_row_value |= pin_state ? 0 : (MATRIX_ROW_SHIFTER << col_index);
|
||||
}
|
||||
|
||||
// Unselect row
|
||||
unselect_row(current_row);
|
||||
|
||||
return (last_row_value != current_matrix[current_row]);
|
||||
// If the row has changed, store the row and return the changed flag.
|
||||
if (current_matrix[current_row] != current_row_value) {
|
||||
current_matrix[current_row] = current_row_value;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
# elif (DIODE_DIRECTION == ROW2COL)
|
||||
@@ -159,20 +166,22 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col)
|
||||
// For each row...
|
||||
for (uint8_t row_index = 0; row_index < ROWS_PER_HAND; row_index++) {
|
||||
// Store last value of row prior to reading
|
||||
matrix_row_t last_row_value = current_matrix[row_index];
|
||||
matrix_row_t last_row_value = current_matrix[row_index];
|
||||
matrix_row_t current_row_value = last_row_value;
|
||||
|
||||
// Check row pin state
|
||||
if (readPin(row_pins[row_index]) == 0) {
|
||||
// Pin LO, set col bit
|
||||
current_matrix[row_index] |= (MATRIX_ROW_SHIFTER << current_col);
|
||||
current_row_value |= (MATRIX_ROW_SHIFTER << current_col);
|
||||
} else {
|
||||
// Pin HI, clear col bit
|
||||
current_matrix[row_index] &= ~(MATRIX_ROW_SHIFTER << current_col);
|
||||
current_row_value &= ~(MATRIX_ROW_SHIFTER << current_col);
|
||||
}
|
||||
|
||||
// Determine if the matrix changed state
|
||||
if ((last_row_value != current_matrix[row_index]) && !(matrix_changed)) {
|
||||
matrix_changed = true;
|
||||
if ((last_row_value != current_row_value)) {
|
||||
matrix_changed |= true;
|
||||
current_matrix[row_index] = current_row_value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,14 @@
|
||||
#include "transport.h"
|
||||
#include "quantum.h"
|
||||
|
||||
#ifdef PROTOCOL_LUFA
|
||||
# include <LUFA/Drivers/USB/USB.h>
|
||||
#endif
|
||||
|
||||
#ifdef PROTOCOL_VUSB
|
||||
# include "usbdrv.h"
|
||||
#endif
|
||||
|
||||
#ifdef EE_HANDS
|
||||
# include "eeconfig.h"
|
||||
#endif
|
||||
@@ -22,30 +30,54 @@
|
||||
# define SPLIT_USB_TIMEOUT_POLL 10
|
||||
#endif
|
||||
|
||||
#ifdef PROTOCOL_CHIBIOS
|
||||
# define SPLIT_USB_DETECT // Force this on for now
|
||||
#endif
|
||||
|
||||
volatile bool isLeftHand = true;
|
||||
|
||||
bool waitForUsb(void) {
|
||||
#if defined(SPLIT_USB_DETECT)
|
||||
# if defined(PROTOCOL_LUFA)
|
||||
static inline bool usbHasActiveConnection(void) { return USB_Device_IsAddressSet(); }
|
||||
static inline void usbDisable(void) { USB_Disable(); }
|
||||
# elif defined(PROTOCOL_CHIBIOS)
|
||||
static inline bool usbHasActiveConnection(void) { usbGetDriverStateI(&USBD1) == USB_ACTIVE; }
|
||||
static inline void usbDisable(void) { usbStop(&USBD1); }
|
||||
# elif defined(PROTOCOL_VUSB)
|
||||
static inline bool usbHasActiveConnection(void) {
|
||||
usbPoll();
|
||||
return usbConfiguration;
|
||||
}
|
||||
static inline void usbDisable(void) { usbDeviceDisconnect(); }
|
||||
# else
|
||||
static inline bool usbHasActiveConnection(void) { return true; }
|
||||
static inline void usbDisable(void) {}
|
||||
# endif
|
||||
|
||||
bool usbIsActive(void) {
|
||||
for (uint8_t i = 0; i < (SPLIT_USB_TIMEOUT / SPLIT_USB_TIMEOUT_POLL); i++) {
|
||||
// This will return true if a USB connection has been established
|
||||
#if defined(__AVR__)
|
||||
if (UDADDR & _BV(ADDEN)) {
|
||||
#else
|
||||
if (usbGetDriverStateI(&USBD1) == USB_ACTIVE) {
|
||||
#endif
|
||||
if (usbHasActiveConnection()) {
|
||||
return true;
|
||||
}
|
||||
wait_ms(SPLIT_USB_TIMEOUT_POLL);
|
||||
}
|
||||
|
||||
// Avoid NO_USB_STARTUP_CHECK - Disable USB as the previous checks seem to enable it somehow
|
||||
#if defined(__AVR__)
|
||||
(USBCON &= ~(_BV(USBE) | _BV(OTGPADE)));
|
||||
#else
|
||||
usbStop(&USBD1);
|
||||
#endif
|
||||
usbDisable();
|
||||
|
||||
return false;
|
||||
}
|
||||
#elif defined(PROTOCOL_LUFA)
|
||||
static inline bool usbIsActive(void) {
|
||||
USB_OTGPAD_On(); // enables VBUS pad
|
||||
wait_us(5);
|
||||
|
||||
return USB_VBUS_GetStatus(); // checks state of VBUS
|
||||
}
|
||||
#else
|
||||
static inline bool usbIsActive(void) { return true; }
|
||||
#endif
|
||||
|
||||
__attribute__((weak)) bool is_keyboard_left(void) {
|
||||
#if defined(SPLIT_HAND_PIN)
|
||||
@@ -66,16 +98,7 @@ __attribute__((weak)) bool is_keyboard_master(void) {
|
||||
|
||||
// only check once, as this is called often
|
||||
if (usbstate == UNKNOWN) {
|
||||
#if defined(SPLIT_USB_DETECT) || defined(PROTOCOL_CHIBIOS)
|
||||
usbstate = waitForUsb() ? MASTER : SLAVE;
|
||||
#elif defined(__AVR__)
|
||||
USBCON |= (1 << OTGPADE); // enables VBUS pad
|
||||
wait_us(5);
|
||||
|
||||
usbstate = (USBSTA & (1 << VBUS)) ? MASTER : SLAVE; // checks state of VBUS
|
||||
#else
|
||||
usbstate = MASTER;
|
||||
#endif
|
||||
usbstate = usbIsActive() ? MASTER : SLAVE;
|
||||
}
|
||||
|
||||
return (usbstate == MASTER);
|
||||
|
||||
@@ -203,7 +203,7 @@
|
||||
* @note Disabling this option saves both code and data space.
|
||||
*/
|
||||
# if !defined(PAL_USE_CALLBACKS) || defined(__DOXYGEN__)
|
||||
# define PAL_USE_CALLBACKS FALSE
|
||||
# define PAL_USE_CALLBACKS TRUE
|
||||
# endif
|
||||
|
||||
/**
|
||||
@@ -211,7 +211,7 @@
|
||||
* @note Disabling this option saves both code and data space.
|
||||
*/
|
||||
# if !defined(PAL_USE_WAIT) || defined(__DOXYGEN__)
|
||||
# define PAL_USE_WAIT FALSE
|
||||
# define PAL_USE_WAIT TRUE
|
||||
# endif
|
||||
|
||||
/*===========================================================================*/
|
||||
|
||||
@@ -220,6 +220,18 @@ COMPILEFLAGS += -fno-common
|
||||
COMPILEFLAGS += -fshort-wchar
|
||||
COMPILEFLAGS += $(THUMBFLAGS)
|
||||
|
||||
# FPU options default (Cortex-M4 and Cortex-M7 single precision).
|
||||
USE_FPU_OPT ?= -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant
|
||||
|
||||
# FPU-related options
|
||||
USE_FPU ?= no
|
||||
ifneq ($(USE_FPU),no)
|
||||
COMPILEFLAGS += $(USE_FPU_OPT)
|
||||
OPT_DEFS += -DCORTEX_USE_FPU=TRUE
|
||||
else
|
||||
OPT_DEFS += -DCORTEX_USE_FPU=FALSE
|
||||
endif
|
||||
|
||||
CFLAGS += $(COMPILEFLAGS)
|
||||
|
||||
ASFLAGS += $(THUMBFLAGS)
|
||||
@@ -241,22 +253,6 @@ OPT_DEFS += -DPORT_IGNORE_GCC_VERSION_CHECK=1
|
||||
|
||||
MCUFLAGS = -mcpu=$(MCU)
|
||||
|
||||
# FPU options default (Cortex-M4 and Cortex-M7 single precision).
|
||||
ifeq ($(USE_FPU_OPT),)
|
||||
USE_FPU_OPT = -mfloat-abi=$(USE_FPU) -mfpu=fpv4-sp-d16 -fsingle-precision-constant
|
||||
endif
|
||||
|
||||
# FPU-related options
|
||||
ifeq ($(USE_FPU),)
|
||||
USE_FPU = no
|
||||
endif
|
||||
ifneq ($(USE_FPU),no)
|
||||
OPT += $(USE_FPU_OPT)
|
||||
OPT_DEFS += -DCORTEX_USE_FPU=TRUE
|
||||
else
|
||||
OPT_DEFS += -DCORTEX_USE_FPU=FALSE
|
||||
endif
|
||||
|
||||
DEBUG = gdb
|
||||
|
||||
DFU_ARGS ?=
|
||||
|
||||
@@ -55,6 +55,7 @@
|
||||
#include "udi_hid_kbd.h"
|
||||
#include <string.h>
|
||||
#include "report.h"
|
||||
#include "usb_descriptor_common.h"
|
||||
|
||||
//***************************************************************************
|
||||
// KBD
|
||||
@@ -641,8 +642,8 @@ static uint8_t udi_hid_raw_report_recv[UDI_HID_RAW_REPORT_SIZE];
|
||||
|
||||
COMPILER_WORD_ALIGNED
|
||||
UDC_DESC_STORAGE udi_hid_raw_report_desc_t udi_hid_raw_report_desc = {{
|
||||
0x06, 0x60, 0xFF, // Usage Page (Vendor Defined)
|
||||
0x09, 0x61, // Usage (Vendor Defined)
|
||||
0x06, RAW_USAGE_PAGE_LO, RAW_USAGE_PAGE_HI, // Usage Page (Vendor Defined)
|
||||
0x09, RAW_USAGE_ID, // Usage (Vendor Defined)
|
||||
0xA1, 0x01, // Collection (Application)
|
||||
0x75, 0x08, // Report Size (8)
|
||||
0x15, 0x00, // Logical Minimum (0)
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
#include "util.h"
|
||||
#include "report.h"
|
||||
#include "usb_descriptor.h"
|
||||
#include "usb_descriptor_common.h"
|
||||
|
||||
// clang-format off
|
||||
|
||||
@@ -232,8 +233,8 @@ const USB_Descriptor_HIDReport_Datatype_t PROGMEM SharedReport[] = {
|
||||
|
||||
#ifdef RAW_ENABLE
|
||||
const USB_Descriptor_HIDReport_Datatype_t PROGMEM RawReport[] = {
|
||||
HID_RI_USAGE_PAGE(16, 0xFF60), // Vendor Defined
|
||||
HID_RI_USAGE(8, 0x61), // Vendor Defined
|
||||
HID_RI_USAGE_PAGE(16, RAW_USAGE_PAGE), // Vendor Defined
|
||||
HID_RI_USAGE(8, RAW_USAGE_ID), // Vendor Defined
|
||||
HID_RI_COLLECTION(8, 0x01), // Application
|
||||
// Data to host
|
||||
HID_RI_USAGE(8, 0x62), // Vendor Defined
|
||||
|
||||
31
tmk_core/protocol/usb_descriptor_common.h
Normal file
31
tmk_core/protocol/usb_descriptor_common.h
Normal file
@@ -0,0 +1,31 @@
|
||||
/* Copyright 2020 Nick Brassel (tzarc)
|
||||
*
|
||||
* 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
|
||||
|
||||
/////////////////////
|
||||
// RAW Usage page and ID configuration
|
||||
|
||||
#ifndef RAW_USAGE_PAGE
|
||||
# define RAW_USAGE_PAGE 0xFF60
|
||||
#endif
|
||||
|
||||
#ifndef RAW_USAGE_ID
|
||||
# define RAW_USAGE_ID 0x61
|
||||
#endif
|
||||
|
||||
#define RAW_USAGE_PAGE_HI ((uint8_t)(RAW_USAGE_PAGE >> 8))
|
||||
#define RAW_USAGE_PAGE_LO ((uint8_t)(RAW_USAGE_PAGE & 0xFF))
|
||||
@@ -26,6 +26,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#include "vusb.h"
|
||||
#include "print.h"
|
||||
#include "debug.h"
|
||||
#include "usb_descriptor_common.h"
|
||||
|
||||
#ifdef RAW_ENABLE
|
||||
# include "raw_hid.h"
|
||||
@@ -409,9 +410,9 @@ const PROGMEM uchar keyboard_hid_report[] = {
|
||||
|
||||
#ifdef RAW_ENABLE
|
||||
const PROGMEM uchar raw_hid_report[] = {
|
||||
0x06, 0x60, 0xFF, // Usage Page (Vendor Defined)
|
||||
0x09, 0x61, // Usage (Vendor Defined)
|
||||
0xA1, 0x01, // Collection (Application)
|
||||
0x06, RAW_USAGE_PAGE_LO, RAW_USAGE_PAGE_HI, // Usage Page (Vendor Defined)
|
||||
0x09, RAW_USAGE_ID, // Usage (Vendor Defined)
|
||||
0xA1, 0x01, // Collection (Application)
|
||||
// Data to host
|
||||
0x09, 0x62, // Usage (Vendor Defined)
|
||||
0x15, 0x00, // Logical Minimum (0)
|
||||
|
||||
@@ -46,7 +46,7 @@ FORMAT = ihex
|
||||
# Optimization level, can be [0, 1, 2, 3, s].
|
||||
# 0 = turn off optimization. s = optimize for size.
|
||||
# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
|
||||
OPT = s
|
||||
OPT ?= s
|
||||
|
||||
# Compiler flag to set the C Standard level.
|
||||
# c89 = "ANSI" C
|
||||
|
||||
464
users/art/art.c
Normal file
464
users/art/art.c
Normal file
@@ -0,0 +1,464 @@
|
||||
#include "art.h"
|
||||
#include "string.h"
|
||||
|
||||
__attribute__ ((weak))
|
||||
bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
|
||||
return true;
|
||||
}
|
||||
|
||||
__attribute__ ((weak))
|
||||
void led_show_current_os(void) {
|
||||
}
|
||||
|
||||
static bool mac_ctrl_on = false; //for switching tabs
|
||||
static bool mac_gui_on = false; //for switching languages
|
||||
static bool mac_alt_tab_on = false; //for switching windows
|
||||
|
||||
static const char *key_up[2] = {SS_UP(X_LALT), SS_UP(X_LCTL)};
|
||||
static const char *key_down[2] = {SS_DOWN(X_LALT), SS_DOWN(X_LCTL)};
|
||||
|
||||
int char_to_del = 1;
|
||||
static bool sarcasm_on = false;
|
||||
static bool sarcasm_key = false;
|
||||
|
||||
void backspace_n_times(int times) {
|
||||
for (int i=0; i<times; i++) {
|
||||
SEND_STRING(SS_TAP(X_BSPC));
|
||||
}
|
||||
}
|
||||
|
||||
void send_string_remembering_length(char *string) {
|
||||
send_string(string);
|
||||
char_to_del = strlen(string);
|
||||
}
|
||||
|
||||
void send_shifted_strings(char *string1, char *string2) {
|
||||
if ( get_mods() & MOD_MASK_SHIFT ) {
|
||||
clear_mods();
|
||||
send_string_remembering_length(string2);
|
||||
} else {
|
||||
send_string_remembering_length(string1);
|
||||
}
|
||||
}
|
||||
|
||||
void send_shifted_strings_add(char *string1, char *string2) {
|
||||
bool shifted = get_mods() & MOD_MASK_SHIFT;
|
||||
clear_mods();
|
||||
|
||||
send_string_remembering_length(string1);
|
||||
|
||||
if (shifted) {
|
||||
send_string(string2);
|
||||
char_to_del = strlen(string1) + strlen(string2);
|
||||
}
|
||||
}
|
||||
|
||||
bool is_mac_with_base_layer_off(void) {
|
||||
return !is_win && !layer_state_is(BASE);
|
||||
}
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
if (sarcasm_on) {
|
||||
sarcasm_key = ! sarcasm_key;
|
||||
if (sarcasm_key) {
|
||||
SEND_STRING(SS_TAP(X_CAPS));
|
||||
}
|
||||
}
|
||||
|
||||
//Checking all other non-backspace keys to clear the backspace buffer. This is to prevent the bug of deleting N chars sometime after using a macro
|
||||
if (record->event.pressed && (keycode != KC_BSPACE && keycode != XXXXXXX)) {
|
||||
char_to_del = 1;
|
||||
}
|
||||
|
||||
switch (keycode) {
|
||||
case KC_TAB:
|
||||
if (record->event.pressed && is_mac_with_base_layer_off()) {
|
||||
uint8_t mods = get_mods();
|
||||
uint8_t mod_state = mods & MOD_MASK_ALT;
|
||||
if (get_mods() & mod_state) {
|
||||
del_mods(mod_state);
|
||||
add_mods(MOD_LCTL);
|
||||
mac_alt_tab_on = true;
|
||||
}
|
||||
|
||||
mod_state = mods & MOD_MASK_CTRL;
|
||||
if (get_mods() & mod_state && !mac_alt_tab_on) {
|
||||
del_mods(mod_state);
|
||||
add_mods(MOD_LGUI);
|
||||
mac_ctrl_on = true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case KC_LSFT:
|
||||
if (record->event.pressed && is_mac_with_base_layer_off()) {
|
||||
uint8_t mods = get_mods();
|
||||
uint8_t mod_state = mods & MOD_MASK_AG;
|
||||
if (get_mods() & mod_state) {
|
||||
del_mods(mod_state);
|
||||
add_mods(MOD_LGUI);
|
||||
mac_gui_on = true;
|
||||
SEND_STRING(SS_TAP(X_SPACE));
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case KC_LEFT:
|
||||
case KC_RIGHT:
|
||||
if (record->event.pressed && is_mac_with_base_layer_off()) {
|
||||
/* && !mac_ctrl_on/!mac_alt_tab_on are required since setting the state while holding the key changes
|
||||
the modifier from OS's perspective. As a result, just the pressed key cannot be the single source
|
||||
of truth to determine which state we're in, and a separate bool is required */
|
||||
uint8_t mods = get_mods();
|
||||
uint8_t mod_state = mods & MOD_MASK_ALT;
|
||||
//Allows Ctrl <-/-> on Mac if Ctrl Tab is already pressed
|
||||
if (get_mods() & mod_state && mac_alt_tab_on && !mac_ctrl_on) {
|
||||
del_mods(mod_state);
|
||||
add_mods(MOD_LCTL);
|
||||
}
|
||||
|
||||
mod_state = mods & MOD_MASK_CTRL;
|
||||
if (get_mods() & mod_state && !mac_alt_tab_on) {
|
||||
del_mods(mod_state);
|
||||
add_mods(MOD_LALT);
|
||||
mac_ctrl_on = true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case KC_DEL:
|
||||
if (record->event.pressed && is_mac_with_base_layer_off()) {
|
||||
uint8_t mod_state = get_mods() & MOD_MASK_CTRL;
|
||||
if (get_mods() & mod_state) {
|
||||
del_mods(mod_state);
|
||||
add_mods(MOD_LALT);
|
||||
mac_ctrl_on = true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case KC_LALT:
|
||||
if (!record->event.pressed && is_mac_with_base_layer_off()) {
|
||||
if (mac_alt_tab_on) {
|
||||
unregister_mods(MOD_LCTL);
|
||||
mac_alt_tab_on = false;
|
||||
return false;
|
||||
} else if (mac_gui_on) {
|
||||
SEND_STRING(SS_UP(X_LGUI));
|
||||
mac_gui_on = false;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case KC_RALT:
|
||||
if (!record->event.pressed && mac_alt_tab_on && is_mac_with_base_layer_off()) {
|
||||
unregister_mods(MOD_LCTL);
|
||||
mac_alt_tab_on = false;
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case KC_LCTL:
|
||||
case KC_RCTL:
|
||||
if (!record->event.pressed && mac_ctrl_on && is_mac_with_base_layer_off()) {
|
||||
SEND_STRING(SS_UP(X_LGUI) SS_UP(X_LALT));
|
||||
mac_ctrl_on = false;
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
case KC_HOME:
|
||||
if (record->event.pressed && is_mac_with_base_layer_off()) {
|
||||
SEND_STRING(SS_LCTL(SS_TAP(X_LEFT)));
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case KC_END:
|
||||
if (record->event.pressed && is_mac_with_base_layer_off()) {
|
||||
SEND_STRING(SS_LCTL(SS_TAP(X_RIGHT)));
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case KC_BSPC:
|
||||
if (record->event.pressed) {
|
||||
if (char_to_del > 1) {
|
||||
layer_off(GIT_C);
|
||||
layer_off(GIT_S);
|
||||
backspace_n_times(char_to_del);
|
||||
char_to_del = 1;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (is_mac_with_base_layer_off()) {
|
||||
uint8_t mod_state = get_mods() & MOD_MASK_CTRL;
|
||||
if (get_mods() & mod_state) {
|
||||
del_mods(mod_state);
|
||||
add_mods(MOD_LALT);
|
||||
mac_ctrl_on = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
/* -------------------------------------------------------------------------
|
||||
* CUSTOM MACROS
|
||||
* ------------------------------------------------------------------------ */
|
||||
case CTRL_CTV:
|
||||
if (record->event.pressed) {
|
||||
if ( get_mods() & MOD_MASK_SHIFT ) {
|
||||
clear_mods();
|
||||
SEND_STRING(SS_LCTL("ctv"));
|
||||
} else {
|
||||
SEND_STRING(SS_LCTL("ctv") SS_TAP(X_ENTER));
|
||||
}
|
||||
}
|
||||
break;
|
||||
case CTRL_LCTV:
|
||||
if (record->event.pressed) {
|
||||
if ( get_mods() & MOD_MASK_SHIFT ) {
|
||||
//Firefox
|
||||
clear_mods();
|
||||
SEND_STRING(SS_LCTL("lcP"));
|
||||
wait_ms(200);
|
||||
SEND_STRING(SS_LCTL("v") SS_TAP(X_ENTER));
|
||||
} else if ( get_mods() & MOD_MASK_CTRL ) {
|
||||
//Chrome
|
||||
clear_mods();
|
||||
SEND_STRING(SS_LCTL("lcNv") SS_TAP(X_ENTER));
|
||||
} else {
|
||||
SEND_STRING(SS_LCTL("lctv"));
|
||||
}
|
||||
}
|
||||
break;
|
||||
case CTRL_CAV:
|
||||
if (record->event.pressed) {
|
||||
SEND_STRING(SS_LCTL("c" SS_TAP(X_TAB)));
|
||||
wait_ms(50);
|
||||
SEND_STRING(SS_LCTL("av"));
|
||||
}
|
||||
break;
|
||||
case SARCASM:
|
||||
if (record->event.pressed) {
|
||||
sarcasm_on = !sarcasm_on;
|
||||
}
|
||||
break;
|
||||
|
||||
/* -------------------------------------------------------------------------
|
||||
* OS TOGGLING
|
||||
* ------------------------------------------------------------------------ */
|
||||
case TOG_OS:
|
||||
if (record->event.pressed) {
|
||||
is_win = ! is_win;
|
||||
led_show_current_os();
|
||||
}
|
||||
break;
|
||||
case CTR_ALT:
|
||||
if (record->event.pressed) {
|
||||
send_string(key_down[is_win]);
|
||||
} else {
|
||||
send_string(key_up[is_win]);
|
||||
}
|
||||
break;
|
||||
case OS_CTRL:
|
||||
if (is_win) {
|
||||
if (record->event.pressed) {
|
||||
SEND_STRING(SS_DOWN(X_LCTL));
|
||||
} else {
|
||||
SEND_STRING(SS_UP(X_LCTL));
|
||||
}
|
||||
} else {
|
||||
if (record->event.pressed) {
|
||||
SEND_STRING(SS_DOWN(X_LGUI));
|
||||
} else {
|
||||
SEND_STRING(SS_UP(X_LGUI));
|
||||
}
|
||||
}
|
||||
break;
|
||||
case OS_WIN:
|
||||
if (is_win) {
|
||||
if (record->event.pressed) {
|
||||
SEND_STRING(SS_DOWN(X_LGUI));
|
||||
} else {
|
||||
SEND_STRING(SS_UP(X_LGUI));
|
||||
}
|
||||
} else {
|
||||
if (record->event.pressed) {
|
||||
SEND_STRING(SS_DOWN(X_LCTL));
|
||||
} else {
|
||||
SEND_STRING(SS_UP(X_LCTL));
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
/* -------------------------------------------------------------------------
|
||||
* STRING MACROS
|
||||
* ------------------------------------------------------------------------ */
|
||||
// case :
|
||||
// if (record->event.pressed) {
|
||||
// send_string_remembering_length("");
|
||||
// }
|
||||
// break;
|
||||
// case :
|
||||
// if (record->event.pressed) {
|
||||
// send_string_remembering_length("", "");
|
||||
// }
|
||||
// break;
|
||||
case TILD_BLOCK:
|
||||
if (record->event.pressed) {
|
||||
SEND_STRING("```" SS_LSFT(SS_TAP(X_ENTER) SS_TAP(X_ENTER)) "```" SS_TAP(X_UP));
|
||||
char_to_del = 4;
|
||||
}
|
||||
break;
|
||||
case ADMINS:
|
||||
if (record->event.pressed) {
|
||||
send_shifted_strings_add("admin", "/aurora/status");
|
||||
}
|
||||
break;
|
||||
case PRESCRIPTION:
|
||||
if (record->event.pressed) {
|
||||
SEND_STRING("55\t12122019\t");
|
||||
char_to_del = 8;
|
||||
}
|
||||
break;
|
||||
case FOURS:
|
||||
if (record->event.pressed) {
|
||||
SEND_STRING("4444333322221111\t1\t12\t21\t123\n");
|
||||
char_to_del = 16;
|
||||
}
|
||||
break;
|
||||
|
||||
case G_ADD:
|
||||
if (record->event.pressed) {
|
||||
send_string_remembering_length("git add ");
|
||||
}
|
||||
break;
|
||||
case G_BRCH:
|
||||
if (record->event.pressed) {
|
||||
send_shifted_strings_add("git branch ", "-d ");
|
||||
}
|
||||
break;
|
||||
case G_C:
|
||||
if (record->event.pressed) {
|
||||
send_string_remembering_length("git c[Heckout/Ommit]");
|
||||
layer_on(GIT_C);
|
||||
}
|
||||
break;
|
||||
case G_CHEC:
|
||||
if (!record->event.pressed) {
|
||||
bool shifted = get_mods() & MOD_MASK_SHIFT;
|
||||
clear_mods();
|
||||
|
||||
backspace_n_times(15);
|
||||
SEND_STRING("heckout ");
|
||||
char_to_del = 13;
|
||||
if (shifted) {
|
||||
SEND_STRING("-b ");
|
||||
char_to_del = 16;
|
||||
}
|
||||
layer_off(GIT_C);
|
||||
}
|
||||
break;
|
||||
case G_COMM:
|
||||
if (!record->event.pressed) {
|
||||
bool shifted = get_mods() & MOD_MASK_SHIFT;
|
||||
clear_mods();
|
||||
|
||||
backspace_n_times(15);
|
||||
SEND_STRING("ommit -");
|
||||
char_to_del = 15;
|
||||
if (shifted) {
|
||||
SEND_STRING("a");
|
||||
char_to_del = 16;
|
||||
}
|
||||
SEND_STRING("m \"\"" SS_TAP(X_LEFT));
|
||||
layer_off(GIT_C);
|
||||
}
|
||||
break;
|
||||
case G_DEV:
|
||||
if (record->event.pressed) {
|
||||
send_shifted_strings("develop", "master");
|
||||
}
|
||||
break;
|
||||
case G_DIFF:
|
||||
if (record->event.pressed) {
|
||||
send_string_remembering_length("git diff ");
|
||||
}
|
||||
break;
|
||||
case G_FTCH:
|
||||
if (record->event.pressed) {
|
||||
send_string_remembering_length("git fetch ");
|
||||
}
|
||||
break;
|
||||
case G_LOG:
|
||||
if (record->event.pressed) {
|
||||
send_string_remembering_length("git log ");
|
||||
}
|
||||
break;
|
||||
case G_MERG:
|
||||
if (record->event.pressed) {
|
||||
send_string_remembering_length("git merge ");
|
||||
}
|
||||
break;
|
||||
case G_P:
|
||||
if (record->event.pressed) {
|
||||
send_shifted_strings_add("git pu", "sh -u ");
|
||||
}
|
||||
break;
|
||||
case G_RST:
|
||||
if (record->event.pressed) {
|
||||
send_string_remembering_length("git reset ");
|
||||
}
|
||||
break;
|
||||
case G_S:
|
||||
if (!record->event.pressed) {
|
||||
send_string_remembering_length("git s[taSh/How/taTus]");
|
||||
layer_on(GIT_S);
|
||||
}
|
||||
break;
|
||||
case G_SHOW:
|
||||
if (!record->event.pressed) {
|
||||
backspace_n_times(16);
|
||||
SEND_STRING("how ");
|
||||
char_to_del = 9;
|
||||
layer_off(GIT_S);
|
||||
}
|
||||
break;
|
||||
case G_STSH:
|
||||
if (!record->event.pressed) {
|
||||
bool shifted = get_mods() & MOD_MASK_SHIFT;
|
||||
clear_mods();
|
||||
|
||||
backspace_n_times(16);
|
||||
SEND_STRING("tash ");
|
||||
char_to_del = 10;
|
||||
|
||||
if (shifted) {
|
||||
clear_mods();
|
||||
SEND_STRING("apply ");
|
||||
|
||||
char_to_del = 16;
|
||||
}
|
||||
|
||||
layer_off(GIT_S);
|
||||
}
|
||||
break;
|
||||
case G_STAT:
|
||||
if (!record->event.pressed) {
|
||||
backspace_n_times(16);
|
||||
SEND_STRING("tatus ");
|
||||
char_to_del = 11;
|
||||
layer_off(GIT_S);
|
||||
}
|
||||
break;
|
||||
|
||||
case CTL_ALT_START ... CTL_ALT_END:
|
||||
if (record->event.pressed) {
|
||||
if (is_win) {
|
||||
tap_code16(LCTL(keycode - CTL_ALT_START));
|
||||
} else {
|
||||
tap_code16(LALT(keycode - CTL_ALT_START));
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return process_record_keymap(keycode, record);
|
||||
}
|
||||
69
users/art/art.h
Normal file
69
users/art/art.h
Normal file
@@ -0,0 +1,69 @@
|
||||
#pragma once
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
#define CTL_ALT(kc) (CTL_ALT_START + ((kc) & 0xff))
|
||||
|
||||
extern bool is_win;
|
||||
|
||||
enum layer_names {
|
||||
QWERTY,
|
||||
WORKMAN,
|
||||
BASE, //only specific for split75
|
||||
#if defined(KEYBOARD_wheatfield_split75)
|
||||
QWERTY_MOD,
|
||||
LAYOUT_CHG,
|
||||
#elif defined(KEYBOARD_ergodone)
|
||||
FKEYS,
|
||||
CTRL_NAV,
|
||||
SHIFT_NAV,
|
||||
#endif
|
||||
|
||||
MEDIA,
|
||||
COMBOS,
|
||||
STRINGS,
|
||||
CONFIG,
|
||||
NAV,
|
||||
NUMPAD,
|
||||
GIT,
|
||||
GIT_C,
|
||||
GIT_S
|
||||
};
|
||||
|
||||
enum custom_keycodes_art {
|
||||
CTRL_CTV = SAFE_RANGE,
|
||||
CTRL_LCTV,
|
||||
CTRL_CAV,
|
||||
SARCASM,
|
||||
|
||||
TOG_OS,
|
||||
CTR_ALT,
|
||||
OS_CTRL,
|
||||
OS_WIN,
|
||||
|
||||
TILD_BLOCK,
|
||||
ADMINS,
|
||||
PRESCRIPTION,
|
||||
FOURS,
|
||||
|
||||
G_ADD,
|
||||
G_BRCH,
|
||||
G_C,
|
||||
G_CHEC,
|
||||
G_COMM,
|
||||
G_DEV,
|
||||
G_DIFF,
|
||||
G_FTCH,
|
||||
G_LOG,
|
||||
G_MERG,
|
||||
G_P,
|
||||
G_RST,
|
||||
G_S,
|
||||
G_STAT,
|
||||
G_STSH,
|
||||
G_SHOW,
|
||||
|
||||
CTL_ALT_START,
|
||||
CTL_ALT_END = CTL_ALT_START + 0xff,
|
||||
|
||||
NEW_SAFE_RANGE //for keymap specific codes
|
||||
};
|
||||
4
users/art/config.h
Normal file
4
users/art/config.h
Normal file
@@ -0,0 +1,4 @@
|
||||
#pragma once
|
||||
|
||||
#undef TAPPING_TOGGLE
|
||||
#define TAPPING_TOGGLE 2
|
||||
1
users/art/rules.mk
Normal file
1
users/art/rules.mk
Normal file
@@ -0,0 +1 @@
|
||||
SRC += art.c
|
||||
@@ -1,7 +1,5 @@
|
||||
#!/bin/sh
|
||||
util_dir=$(dirname "$0")
|
||||
pkg update
|
||||
pkg install -y \
|
||||
packages=$(cat <<EOF
|
||||
git \
|
||||
wget \
|
||||
gmake \
|
||||
@@ -13,9 +11,29 @@ pkg install -y \
|
||||
avr-libc \
|
||||
dfu-programmer \
|
||||
dfu-util \
|
||||
avrdude \
|
||||
arm-none-eabi-gcc \
|
||||
arm-none-eabi-binutils \
|
||||
arm-none-eabi-newlib \
|
||||
diffutils \
|
||||
python3
|
||||
pip3 install -r ${util_dir}/../requirements.txt
|
||||
EOF
|
||||
)
|
||||
util_dir=$(dirname "$0")
|
||||
if [ $(id -u) = 0 ]; then
|
||||
pkg update
|
||||
pkg install -y ${packages}
|
||||
echo ""
|
||||
echo "Re-run the setup as your normal user to install the qmk python dependencies"
|
||||
exit 1
|
||||
else
|
||||
if command -v sudo > /dev/null 2>&1; then
|
||||
sudo pkg update
|
||||
sudp pkg install -y ${packages}
|
||||
else
|
||||
echo "Make sure you run setup as root first to install base OS dependencies..."
|
||||
echo ""
|
||||
fi
|
||||
|
||||
python3 -m pip install --user -r ${util_dir}/../requirements.txt
|
||||
fi
|
||||
|
||||
@@ -19,7 +19,11 @@ function install_avr {
|
||||
mv avr-gcc-8.3.0-x86-mingw avr8-gnu-toolchain
|
||||
rm avr8-gnu-toolchain/bin/make.exe
|
||||
rm avr-gcc-8.3.0-x86-mingw.zip
|
||||
pacman --needed --disable-download-timeout -S mingw-w64-x86_64-avrdude
|
||||
|
||||
# FIXME: As of 2020-05-19, the MSYS2 avrdude cannot flash USBaspLoader devices, for some reason
|
||||
# (warning: cannot set sck period)
|
||||
# However, the avr-gcc toolchain above contains an avrdude which can, so let's just not install this for now
|
||||
#pacman --needed --disable-download-timeout -S mingw-w64-x86_64-avrdude
|
||||
}
|
||||
|
||||
function install_arm {
|
||||
|
||||
Reference in New Issue
Block a user