mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-08-21 13:52:17 +00:00
Compare commits
56 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
7222e3691b | ||
![]() |
7e1b57add4 | ||
![]() |
f4094930a3 | ||
![]() |
8efe8b498d | ||
![]() |
fc1c692f71 | ||
![]() |
480651cf9d | ||
![]() |
53a43dbe99 | ||
![]() |
db03b76910 | ||
![]() |
14bdd5ed2a | ||
![]() |
f45bc9b362 | ||
![]() |
4a7baaaf50 | ||
![]() |
dad79cafcd | ||
![]() |
d08f9cb6e4 | ||
![]() |
397d404ce0 | ||
![]() |
9de4ace6f2 | ||
![]() |
1f13254460 | ||
![]() |
1d03af876c | ||
![]() |
8ce9e3255e | ||
![]() |
1dc1e12fec | ||
![]() |
6cf9402cbc | ||
![]() |
76aa2baf3e | ||
![]() |
423b419138 | ||
![]() |
4e2817eff1 | ||
![]() |
31d12662bd | ||
![]() |
44a348d56f | ||
![]() |
85f315ad65 | ||
![]() |
2c3e617fba | ||
![]() |
088b476343 | ||
![]() |
4c9372a081 | ||
![]() |
4930e22dda | ||
![]() |
0beb945554 | ||
![]() |
bf0bb1a4db | ||
![]() |
64459fedbf | ||
![]() |
47e29754c2 | ||
![]() |
ec86141a4a | ||
![]() |
f0f9283d02 | ||
![]() |
9fbd7eb7a5 | ||
![]() |
d7dea0e6d9 | ||
![]() |
533f684887 | ||
![]() |
d81d216d72 | ||
![]() |
e5c315f961 | ||
![]() |
0793abfd19 | ||
![]() |
52ecc76e28 | ||
![]() |
4bb0fb2ffc | ||
![]() |
ec59556cd7 | ||
![]() |
661e304033 | ||
![]() |
ae489efee4 | ||
![]() |
8a778d656d | ||
![]() |
a7d05820a6 | ||
![]() |
43757cd985 | ||
![]() |
0e4374042c | ||
![]() |
6c55e8cab5 | ||
![]() |
0e142138aa | ||
![]() |
d17421d074 | ||
![]() |
7d156263ab | ||
![]() |
79bff50247 |
@@ -110,8 +110,28 @@ ifneq ("$(wildcard $(KEYBOARD_C_1))","")
|
||||
KEYBOARD_SRC += $(KEYBOARD_C_1)
|
||||
endif
|
||||
|
||||
OPT_DEFS += -DKEYBOARD_$(KEYBOARD_FILESAFE)
|
||||
# Generate KEYBOARD_name_subname for all levels of the keyboard folder
|
||||
KEYBOARD_FILESAFE_1 := $(subst .,,$(subst /,_,$(KEYBOARD_FOLDER_PATH_1)))
|
||||
KEYBOARD_FILESAFE_2 := $(subst .,,$(subst /,_,$(KEYBOARD_FOLDER_PATH_2)))
|
||||
KEYBOARD_FILESAFE_3 := $(subst .,,$(subst /,_,$(KEYBOARD_FOLDER_PATH_3)))
|
||||
KEYBOARD_FILESAFE_4 := $(subst .,,$(subst /,_,$(KEYBOARD_FOLDER_PATH_4)))
|
||||
KEYBOARD_FILESAFE_5 := $(subst .,,$(subst /,_,$(KEYBOARD_FOLDER_PATH_5)))
|
||||
|
||||
ifneq ("$(wildcard $(KEYBOARD_PATH_5)/)","")
|
||||
OPT_DEFS += -DKEYBOARD_$(KEYBOARD_FILESAFE_5)
|
||||
endif
|
||||
ifneq ("$(wildcard $(KEYBOARD_PATH_4)/)","")
|
||||
OPT_DEFS += -DKEYBOARD_$(KEYBOARD_FILESAFE_4)
|
||||
endif
|
||||
ifneq ("$(wildcard $(KEYBOARD_PATH_3)/)","")
|
||||
OPT_DEFS += -DKEYBOARD_$(KEYBOARD_FILESAFE_3)
|
||||
endif
|
||||
ifneq ("$(wildcard $(KEYBOARD_PATH_2)/)","")
|
||||
OPT_DEFS += -DKEYBOARD_$(KEYBOARD_FILESAFE_2)
|
||||
endif
|
||||
ifneq ("$(wildcard $(KEYBOARD_PATH_1)/)","")
|
||||
OPT_DEFS += -DKEYBOARD_$(KEYBOARD_FILESAFE_1)
|
||||
endif
|
||||
|
||||
# Setup the define for QMK_KEYBOARD_H. This is used inside of keymaps so
|
||||
# that the same keymap may be used on multiple keyboards.
|
||||
|
@@ -3,6 +3,8 @@
|
||||
* [Building Your First Firmware](newbs_building_firmware.md)
|
||||
* [Flashing Firmware](newbs_flashing.md)
|
||||
* [Testing and Debugging](newbs_testing_debugging.md)
|
||||
* [Best Practices](newbs_best_practices.md)
|
||||
* [Learning Resources](newbs_learn_more_resources.md)
|
||||
|
||||
* [QMK Basics](README.md)
|
||||
* [QMK Introduction](getting_started_introduction.md)
|
||||
@@ -47,6 +49,7 @@
|
||||
* [Backlight](feature_backlight.md)
|
||||
* [Bluetooth](feature_bluetooth.md)
|
||||
* [Bootmagic](feature_bootmagic.md)
|
||||
* [Combos](feature_combo)
|
||||
* [Command](feature_command.md)
|
||||
* [Dynamic Macros](feature_dynamic_macros.md)
|
||||
* [Grave Escape](feature_grave_esc.md)
|
||||
|
@@ -3,6 +3,8 @@
|
||||
* [Building Your First Firmware](newbs_building_firmware.md)
|
||||
* [Flashing Firmware](newbs_flashing.md)
|
||||
* [Testing and Debugging](newbs_testing_debugging.md)
|
||||
* [Best Practices](newbs_best_practices.md)
|
||||
* [Learning Resources](newbs_learn_more_resources.md)
|
||||
|
||||
* [QMK Basics](README.md)
|
||||
* [QMK Introduction](getting_started_introduction.md)
|
||||
@@ -47,6 +49,7 @@
|
||||
* [Backlight](feature_backlight.md)
|
||||
* [Bluetooth](feature_bluetooth.md)
|
||||
* [Bootmagic](feature_bootmagic.md)
|
||||
* [Combos](feature_combo)
|
||||
* [Command](feature_command.md)
|
||||
* [Dynamic Macros](feature_dynamic_macros.md)
|
||||
* [Grave Escape](feature_grave_esc.md)
|
||||
|
@@ -155,6 +155,10 @@ If you define these options you will enable the associated feature, which may in
|
||||
going to produce the 500 keystrokes a second needed to actually get more than a
|
||||
few ms of delay from this. But if you're doing chording on something with 3-4ms
|
||||
scan times? You probably want this.
|
||||
* `#define COMBO_COUNT 2`
|
||||
* Set this to the number of combos that you're using in the [Combo](feature_combo.md) feature.
|
||||
* `#define COMBO_TERM 200`
|
||||
* how long for the Combo keys to be detected. Defaults to `TAPPING_TERM` if not defined.
|
||||
|
||||
## RGB Light Configuration
|
||||
|
||||
@@ -234,6 +238,8 @@ Use these to enable or disable building certain features. The more you have enab
|
||||
* Console for debug(+400)
|
||||
* `COMMAND_ENABLE`
|
||||
* Commands for debug and configuration
|
||||
* `COMBO_ENABLE`
|
||||
* Key combo feature
|
||||
* `NKRO_ENABLE`
|
||||
* USB N-Key Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
* `AUDIO_ENABLE`
|
||||
|
@@ -117,12 +117,12 @@ void led_set_user(uint8_t usb_led) {
|
||||
} else {
|
||||
PORTB &= ~(1<<2);
|
||||
}
|
||||
if (usb_led & (1<<USB_LED_COMPOSE_LOCK)) {
|
||||
if (usb_led & (1<<USB_LED_COMPOSE)) {
|
||||
PORTB |= (1<<3);
|
||||
} else {
|
||||
PORTB &= ~(1<<3);
|
||||
}
|
||||
if (usb_led & (1<<USB_LED_KANA_LOCK)) {
|
||||
if (usb_led & (1<<USB_LED_KANA)) {
|
||||
PORTB |= (1<<4);
|
||||
} else {
|
||||
PORTB &= ~(1<<4);
|
||||
|
88
docs/feature_combo.md
Normal file
88
docs/feature_combo.md
Normal file
@@ -0,0 +1,88 @@
|
||||
# Combos
|
||||
|
||||
The Combo feature is a chording type solution for adding custom actions. It lets you hit multiple keys at once and produce a different effect. For instance, hitting `A` and `S` within the tapping term would hit `ESC` instead, or have it perform even more complex tasks.
|
||||
|
||||
To enable this feature, yu need to add `COMBO_ENABLE = yes` to your `rules.mk`.
|
||||
|
||||
Additionally, in your `config.h`, you'll need to specify the number of combos that you'll be using, by adding `#define COMBO_COUNT 1` (replacing 1 with the number that you're using).
|
||||
<!-- At this time, this is necessary -->
|
||||
|
||||
Also, by default, the tapping term for the Combos is set to the same value as `TAPPING_TERM` (200 by default on most boards). But you can specify a different value by defining it in your `config.h`. For instance: `#define COMBO_TERM 300` would set the time out period for combos to 300ms.
|
||||
|
||||
Then, your `keymap.c` file, you'll need to define a sequence of keys, terminated with `COMBO_END`, and a structure to list the combination of keys, and it's resulting action.
|
||||
|
||||
```c
|
||||
const uint16_t PROGMEM test_combo[] = {KC_A, KC_B, COMBO_END};
|
||||
combo_t key_combos[COMBO_COUNT] = {COMBO(test_combo, KC_ESC)};
|
||||
```
|
||||
|
||||
This will send "Escape" if you hit the A and B keys.
|
||||
|
||||
!> This method only supports [basic keycodes](keycodes_basic.md). See the examples for more control.
|
||||
|
||||
## Examples
|
||||
|
||||
If you want to add a list, then you'd use something like this:
|
||||
|
||||
```c
|
||||
enum combos {
|
||||
AB_ESC,
|
||||
JK_TAB
|
||||
}
|
||||
const uint16_t PROGMEM ab_combo[] = {KC_A, KC_B, COMBO_END};
|
||||
const uint16_t PROGMEM jk_combo[] = {KC_J, KC_K, COMBO_END};
|
||||
|
||||
combo_t key_combos[COMBO_COUNT] = {
|
||||
[AB_ESC] = COMBO(ab_combo, KC_ESC),
|
||||
[JK_TAB] = COMBO(jk_combo, KC_TAB)
|
||||
};
|
||||
```
|
||||
|
||||
For a more complicated implementation, you can use the `process_combo_event` function to add custom handling.
|
||||
|
||||
```c
|
||||
enum combo_events {
|
||||
ZC_COPY,
|
||||
ZV_PASTE
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM copy_combo[] = {KC_Z, KC_C, COMBO_END};
|
||||
const uint16_t PROGMEM paste_combo[] = {KC_Z, KC_V, COMBO_END};
|
||||
|
||||
combo_t key_combos[COMBO_COUNT] = {
|
||||
[ZC_COPY] = COMBO_ACTION(copy_combo),
|
||||
[ZV_PASTE] = COMBO_ACTION(paste_combo),
|
||||
};
|
||||
|
||||
void process_combo_event(uint8_t combo_index, bool pressed) {
|
||||
switch(combo_index) {
|
||||
case ZC_COPY:
|
||||
if (pressed) {
|
||||
register_code(KC_LCTL);
|
||||
register_code(KC_C);
|
||||
unregister_code(KC_C);
|
||||
unregister_code(KC_LCTL);
|
||||
}
|
||||
break;
|
||||
|
||||
case ZV_PASTE:
|
||||
if (pressed) {
|
||||
register_code(KC_LCTL);
|
||||
register_code(KC_V);
|
||||
unregister_code(KC_V);
|
||||
unregister_code(KC_LCTL);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
This will send Ctrl+C if you hit Z and C, and Ctrl+V if you hit Z and V. But you could change this to do stuff like change layers, play sounds, or change settings.
|
||||
|
||||
## Additional Configuration
|
||||
|
||||
If you're using long combos, or even longer combos, you may run into issues with this, as the structure may not be large enough to accommodate what you're doing.
|
||||
|
||||
In this case, you can add either `#define EXTRA_LONG_COMBOS` or `#define EXTRA_EXTRA_LONG_COMBOS` in your `config.h` file.
|
||||
|
||||
You may also be able to enable action keys by defining `COMBO_ALLOW_ACTION_KEYS`.
|
@@ -96,9 +96,10 @@ if `RGBLIGHT_EFFECT_xxxx` or `RGBLIGHT_ANIMATIONS` is defined, you also have a n
|
||||
|`RGBLIGHT_MODE_RGB_TEST` | *None* |RGB Test |
|
||||
|`RGBLIGHT_MODE_ALTERNATING` | *None* |Alternating |
|
||||
|
||||
|
||||
Check out [this video](https://youtube.com/watch?v=VKrpPAHlisY) for a demonstration.
|
||||
|
||||
Note: For versions older than 0.6.117, The mode numbers were written directly. In `quantum/rgblight.h` there is a contrast table between the old mode number and the current symbol.
|
||||
|
||||
The following options can be used to tweak the various animations:
|
||||
|
||||
|Define |Default |Description |
|
||||
|
@@ -8,7 +8,7 @@ Start on the [QMK Github page](https://github.com/qmk/qmk_firmware), and you'll
|
||||
|
||||

|
||||
|
||||
If you're apart of an organization, you'll need to choose which account to fork it to. In most circumstances, you'll want to fork it to your personal account. Once your fork is completed (sometimes this takes a little while), click the "Clone or Download" button:
|
||||
If you're a part of an organization, you'll need to choose which account to fork it to. In most circumstances, you'll want to fork it to your personal account. Once your fork is completed (sometimes this takes a little while), click the "Clone or Download" button:
|
||||
|
||||

|
||||
|
||||
|
@@ -8,7 +8,7 @@ If you have not yet you should read the [Keyboard Guidelines](hardware_keyboard_
|
||||
|
||||
QMK has a number of features to simplify working with AVR keyboards. For most keyboards you don't have to write a single line of code. To get started run the `util/new_project.sh` script:
|
||||
|
||||
```
|
||||
```bash
|
||||
$ util/new_project.sh my_awesome_keyboard
|
||||
######################################################
|
||||
# /keyboards/my_awesome_keyboard project created. To start
|
||||
@@ -30,7 +30,7 @@ This is where all the custom logic for your keyboard goes. Many keyboards do not
|
||||
|
||||
This is the file you define your [Layout Macro(s)](feature_layouts.md) in. At minimum you should have a `#define LAYOUT` for your keyboard that looks something like this:
|
||||
|
||||
```
|
||||
```c
|
||||
#define LAYOUT( \
|
||||
k00, k01, k02, \
|
||||
k10, k11 \
|
||||
@@ -57,7 +57,7 @@ At the top of the `config.h` you'll find USB related settings. These control how
|
||||
|
||||
Do change the `MANUFACTURER`, `PRODUCT`, and `DESCRIPTION` lines to accurately reflect your keyboard.
|
||||
|
||||
```
|
||||
```c
|
||||
#define VENDOR_ID 0xFEED
|
||||
#define PRODUCT_ID 0x6060
|
||||
#define DEVICE_VER 0x0001
|
||||
@@ -72,14 +72,14 @@ Do change the `MANUFACTURER`, `PRODUCT`, and `DESCRIPTION` lines to accurately r
|
||||
|
||||
The next section of the `config.h` file deals with your keyboard's matrix. The first thing you should set is the matrix's size. This is usually, but not always, the same number of rows and columns as the physical key arrangement.
|
||||
|
||||
```
|
||||
```c
|
||||
#define MATRIX_ROWS 2
|
||||
#define MATRIX_COLS 3
|
||||
```
|
||||
|
||||
Once you've defined the size of your matrix you need to define which pins on your MCU are connected to rows and columns. To do so simply specify the names of those pins:
|
||||
|
||||
```
|
||||
```c
|
||||
#define MATRIX_ROW_PINS { D0, D5 }
|
||||
#define MATRIX_COL_PINS { F1, F0, B0 }
|
||||
#define UNUSED_PINS
|
||||
@@ -89,7 +89,7 @@ The number of `MATRIX_ROW_PINS` entries must be the same as the number you assig
|
||||
|
||||
Finally, you can specify the direction your diodes point. This can be `COL2ROW`, `ROW2COL`, or `CUSTOM_MATRIX`.
|
||||
|
||||
```
|
||||
```c
|
||||
#define DIODE_DIRECTION COL2ROW
|
||||
```
|
||||
|
||||
@@ -97,16 +97,14 @@ Finally, you can specify the direction your diodes point. This can be `COL2ROW`,
|
||||
|
||||
By default QMK supports backlighting on pins `B5`, `B6`, and `B7`. If you are using one of those you can simply enable it here. For more details see the [Backlight Documentation](feature_backlight.md).
|
||||
|
||||
```
|
||||
```c
|
||||
#define BACKLIGHT_PIN B7
|
||||
#define BACKLIGHT_LEVELS 3
|
||||
#define BACKLIGHT_BREATHING
|
||||
#define BREATHING_PERIOD 6
|
||||
```
|
||||
|
||||
{% hint style='info' %}
|
||||
You can use backlighting on any pin you like, but you will have to do more work to support that. See the [Backlight Documentation](feature_backlight.md) for more details.
|
||||
{% endhint %}
|
||||
?> You can use backlighting on any pin you like, but you will have to do more work to support that. See the [Backlight Documentation](feature_backlight.md) for more details.
|
||||
|
||||
### Other Configuration Options
|
||||
|
||||
@@ -120,7 +118,7 @@ You use the `rules.mk` file to tell QMK what files to build and what features to
|
||||
|
||||
These options tell the build system what CPU to build for. Be very careful if you change any of these settings, you can render your keyboard inoperable.
|
||||
|
||||
```
|
||||
```make
|
||||
MCU = atmega32u4
|
||||
F_CPU = 16000000
|
||||
ARCH = AVR8
|
||||
@@ -128,26 +126,26 @@ F_USB = $(F_CPU)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
```
|
||||
|
||||
### Bootloader Size
|
||||
### Bootloaders
|
||||
|
||||
The bootloader is a special section of your MCU that allows you to upgrade the code stored on the MCU. Think of it like a Rescue Partition for your keyboard. If you are using a teensy 2.0, or a device like the Ergodox EZ that uses the teensy bootloader you should set this to `512`. Most other bootloaders should be set to `4096`, but `1024` and `2048` are other possible values you may encounter.
|
||||
The bootloader is a special section of your MCU that allows you to upgrade the code stored on the MCU. Think of it like a Rescue Partition for your keyboard.
|
||||
|
||||
#### Teensy 2.0 Bootloader Example
|
||||
#### Teensy Bootloader Example
|
||||
|
||||
```
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=512
|
||||
```
|
||||
|
||||
#### Teensy 2.0++ Bootloader Example
|
||||
|
||||
```
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=1024
|
||||
```make
|
||||
BOOTLOADER = halfkay
|
||||
```
|
||||
|
||||
#### Atmel DFU Loader Example
|
||||
|
||||
```make
|
||||
BOOTLOADER = atmel-dfu
|
||||
```
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
|
||||
#### Pro Micro Bootloader Example
|
||||
|
||||
```make
|
||||
BOOTLOADER = caterina
|
||||
```
|
||||
|
||||
### Build Options
|
||||
|
@@ -27,17 +27,17 @@ This usually happens with a periodic scan of key presses. This speed often is li
|
||||
|
||||
## 2. What the Firmware Sends
|
||||
|
||||
The [HID specification](http://www.usb.org/developers/hidpage/Hut1_12v2.pdf) tells what a keyboard can actually send through USB to have a chance to be properly recognised. This includes a pre-defined list of scancodes which are simple numbers from `0x00` to `0xE7`. The firmware assigns a scancode to each key of the keyboard.
|
||||
The [HID specification](https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf) tells what a keyboard can actually send through USB to have a chance to be properly recognised. This includes a pre-defined list of scancodes which are simple numbers from `0x00` to `0xE7`. The firmware assigns a scancode to each key of the keyboard.
|
||||
|
||||
The firmware does not send actually letters or characters, but only scancodes.
|
||||
Thus, by modifying the firmware, you only can modify what scancode is sent over
|
||||
The firmware does not send actual letters or characters, but only scancodes.
|
||||
Thus, by modifying the firmware, you can only modify what scancode is sent over
|
||||
USB for a given key.
|
||||
|
||||
## 3. What the Operating System Does
|
||||
|
||||
Once the keycode reaches the operating system, a piece of software has to have
|
||||
it match an actual character thanks to a keyboard layout. For example, if your
|
||||
layout is set to QWERTY, a sample of the matching table is as follow:
|
||||
layout is set to QWERTY, a sample of the matching table is as follows:
|
||||
|
||||
| keycode | character |
|
||||
|---------|-----------|
|
||||
@@ -55,11 +55,11 @@ As the layout is generally fixed (unless you create your own), the firmware can
|
||||
|
||||
## List of Characters You Can Send
|
||||
|
||||
Putting aside shortcuts, having a limited set of keycodes mapped to a limited layout means that **the list of characters you can assign to a given key only is the ones present in the layout**.
|
||||
Putting aside shortcuts, having a limited set of keycodes mapped to a limited layout means that **the list of characters you can assign to a given key are only the ones present in the layout**.
|
||||
|
||||
For example, this means that if you have a QWERTY US layout, and you want to assign 1 key to produce `€` (euro currency symbol), you are unable to do so, because the QWERTY US layout does not have such mapping. You could fix that by using a QWERTY UK layout, or a QWERTY US International.
|
||||
For example, this means that if you have a QWERTY US layout, and you want to assign one key to produce `€` (euro currency symbol), you are unable to do so, because the QWERTY US layout does not have such mapping. You could fix that by using a QWERTY UK layout, or a QWERTY US International.
|
||||
|
||||
You may wonder why a keyboard layout containing all of Unicode is not devised then? The limited number of keycode available through USB simply disallow such a thing.
|
||||
You may wonder why a keyboard layout containing all of Unicode is not devised then? The limited number of keycodes available through USB simply disallows such a thing.
|
||||
|
||||
## How to (Maybe) Enter Unicode Characters
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
# Basic Keycodes
|
||||
|
||||
The basic set of keycodes are based on the [HID Keyboard/Keypad Usage Page (0x07)](http://www.usb.org/developers/hidpage/Hut1_12v2.pdf) with the exception of `KC_NO`, `KC_TRNS` and keycodes in the `0xA5-DF` range. See below for more details.
|
||||
The basic set of keycodes are based on the [HID Keyboard/Keypad Usage Page (0x07)](https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf) with the exception of `KC_NO`, `KC_TRNS` and keycodes in the `0xA5-DF` range. See below for more details.
|
||||
|
||||
## Letters and Numbers
|
||||
|
||||
|
@@ -6,13 +6,13 @@ Not sure if your keyboard can run QMK? If it's a mechanical keyboard you built y
|
||||
|
||||
## Overview
|
||||
|
||||
There are 4 main sections to this guide:
|
||||
There are 5 main sections to this guide:
|
||||
|
||||
* [Getting Started](newbs_getting_started.md)
|
||||
* [Building Your First Firmware](newbs_building_firmware.md)
|
||||
* [Flashing Firmware](newbs_flashing.md)
|
||||
* [Testing and Debugging](newbs_testing_debugging.md)
|
||||
* [Best Practices](newbs_best_practices.md)
|
||||
* [Learn More with these Resources](newbs_learn_more_resources.md)
|
||||
|
||||
This guide is focused on helping someone who has never compiled software before. It makes choices and recommendations based on that viewpoint. There are alternative methods for many of these procedures, and we support most of those alternatives. If you have any doubt about how to accomplish a task you can [ask us for guidance](getting_started_getting_help.md).
|
||||
|
||||
|
163
docs/newbs_best_practices.md
Normal file
163
docs/newbs_best_practices.md
Normal file
@@ -0,0 +1,163 @@
|
||||
# Best Practices
|
||||
|
||||
## Or, "How I Learned to Stop Worrying and Love Git."
|
||||
|
||||
This document aims to instruct novices in the best ways to have a smooth experience in contributing to QMK. We will walk through the process of contributing to QMK, detailing some ways to make this task easier, and then later we'll break some things in order to teach you how to fix them.
|
||||
|
||||
This document assumes a few things:
|
||||
|
||||
1. You have a GitHub account, and have [forked the qmk_firmware repository](getting_started_github.md) to your account.
|
||||
2. You've [set up your build environment](newbs_getting_started.md?id=environment-setup).
|
||||
|
||||
|
||||
## Your fork's master: Update Often, Commit Never
|
||||
|
||||
It is highly recommended for QMK development, regardless of what is being done or where, to keep your `master` branch updated, but ***never*** commit to it. Instead, do all your changes in a development branch and issue pull requests from your branches when you're developing.
|
||||
|
||||
To reduce the chances of merge conflicts — instances where two or more users have edited the same part of a file concurrently — keep your `master` branch relatively up-to-date, and start any new developments by creating a new branch.
|
||||
|
||||
### Updating your master branch
|
||||
|
||||
To keep your `master` branch updated, it is recommended to add the QMK Firmware repository ("repo") as a remote repository in git. To do this, open your Git command line interface and enter:
|
||||
|
||||
```
|
||||
git remote add upstream https://github.com/qmk/qmk_firmware.git
|
||||
```
|
||||
|
||||
To verify that the repository has been added, run `git remote -v`, which should return the following:
|
||||
|
||||
```
|
||||
$ git remote -v
|
||||
origin https://github.com/<your_username>/qmk_firmware.git (fetch)
|
||||
origin https://github.com/<your_username>/qmk_firmware.git (push)
|
||||
upstream https://github.com/qmk/qmk_firmware.git (fetch)
|
||||
upstream https://github.com/qmk/qmk_firmware.git (push)
|
||||
```
|
||||
|
||||
Now that this is done, you can check for updates to the repo by running `git fetch upstream`. This retrieves the branches and tags — collectively referred to as "refs" — from the QMK repo, which now has the nickname `upstream`. We can now compare the data on our fork `origin` to that held by QMK.
|
||||
|
||||
To update your fork's master, run the following, hitting the Enter key after each line:
|
||||
|
||||
```
|
||||
git checkout master
|
||||
git fetch upstream
|
||||
git pull upstream master
|
||||
git push origin master
|
||||
```
|
||||
|
||||
This switches you to your `master` branch, retrieves the refs from the QMK repo, downloads the current QMK `master` branch to your computer, and then uploads it to your fork.
|
||||
|
||||
### Making Changes
|
||||
|
||||
To make changes, create a new branch by entering:
|
||||
|
||||
```
|
||||
git checkout -b dev_branch
|
||||
git push --set-upstream origin dev_branch
|
||||
```
|
||||
|
||||
This creates a new branch named `dev_branch`, checks it out, and then saves the new branch to your fork. The `--set-upstream` argument tells git to use your fork and the `dev_branch` branch every time you use `git push` or `git pull` from this branch. It only needs to be used on the first push; after that, you can safely use `git push` or `git pull`, without the rest of the arguments.
|
||||
|
||||
!> With `git push`, you can use `-u` in place of `--set-upstream` — `-u` is an alias for `--set-upstream`.
|
||||
|
||||
You can name your branch nearly anything you want, though it is recommended to name it something related to the changes you are going to make.
|
||||
|
||||
By default `git checkout -b` will base your new branch on the branch that is checked out. You can base your new branch on an existing branch that is not checked out by adding the name of the existing branch to the command:
|
||||
|
||||
```
|
||||
git checkout -b dev_branch master
|
||||
```
|
||||
|
||||
Now that you have a development branch, open your text editor and make whatever changes you need to make. It is recommended to make many small commits to your branch; that way, any change that causes issues can be more easily traced and undone if needed. To make your changes, edit and save any files that need to be updated, add them to Git's *staging area*, and then commit them to your branch:
|
||||
|
||||
```
|
||||
git add path/to/updated_file
|
||||
git commit -m "My commit message."
|
||||
```
|
||||
|
||||
`git add` adds files that have been changed to Git's *staging area*, which is Git's "loading zone." This contains the changes that are going to be *committed* by `git commit`, which saves the changes to the repo. Use descriptive commit messages so you can know what was changed at a glance.
|
||||
|
||||
!> If you've changed a lot of files, but all the files are part of the same change, you can use `git add .` to add all the changed files that are in your current directory, rather than having to add each file individually.
|
||||
|
||||
### Publishing Your Changes
|
||||
|
||||
The last step is to push your changes to your fork. To do this, enter `git push`. Git now publishes the current state of `dev_branch` to your fork.
|
||||
|
||||
|
||||
## Resolving Merge Conflicts
|
||||
|
||||
Sometimes when your work in a branch takes a long time to complete, changes that have been made by others conflict with changes you have made to your branch when you open a pull request. This is called a *merge conflict*, and is what happens when multiple people edit the same parts of the same files.
|
||||
|
||||
### Rebasing Your Changes
|
||||
|
||||
A *rebase* is Git's way of taking changes that were applied at one point, reversing them, and then applying the same changes to another point. In the case of a merge conflict, you can rebase your branch to grab the changes that were made between when you created your branch and the present time.
|
||||
|
||||
To start, run the following:
|
||||
|
||||
```
|
||||
git fetch upstream
|
||||
git rev-list --left-right --count HEAD...upstream/master
|
||||
```
|
||||
|
||||
The `git rev-list` command entered here returns the number of commits that differ between the current branch and QMK's master branch. We run `git fetch` first to make sure we have the refs that represent the current state of the upstream repo. The output of the `git rev-list` command entered returns two numbers:
|
||||
|
||||
```
|
||||
$ git rev-list --left-right --count HEAD...upstream/master
|
||||
7 35
|
||||
```
|
||||
|
||||
The first number represents the number of commits on the current branch since it was created, and the second number is the number of commits made to `upstream/master` since the current branch was created, and thus, the changes that are not recorded in the current branch.
|
||||
|
||||
Now that the current states of both the current branch and the upstream repo are known, we can start a rebase operation:
|
||||
|
||||
```
|
||||
git rebase upstream/master
|
||||
```
|
||||
|
||||
This tells Git to undo the commits on the current branch, and then reapply them against QMK's master branch.
|
||||
|
||||
```
|
||||
$ git rebase upstream/master
|
||||
First, rewinding head to replay your work on top of it...
|
||||
Applying: Commit #1
|
||||
Using index info to reconstruct a base tree...
|
||||
M conflicting_file_1.txt
|
||||
Falling back to patching base and 3-way merge...
|
||||
Auto-merging conflicting_file_1.txt
|
||||
CONFLICT (content): Merge conflict in conflicting_file_1.txt
|
||||
error: Failed to merge in the changes.
|
||||
hint: Use 'git am --show-current-patch' to see the failed patch
|
||||
Patch failed at 0001 Commit #1
|
||||
|
||||
Resolve all conflicts manually, mark them as resolved with
|
||||
"git add/rm <conflicted_files>", then run "git rebase --continue".
|
||||
You can instead skip this commit: run "git rebase --skip".
|
||||
To abort and get back to the state before "git rebase", run "git rebase --abort".
|
||||
```
|
||||
|
||||
This tells us that we have a merge conflict, and gives the name of the file with the conflict. Open the conflicting file in your text editor, and somewhere in the file, you'll find something like this:
|
||||
|
||||
```
|
||||
<<<<<<< HEAD
|
||||
<p>For help with any issues, email us at support@webhost.us.</p>
|
||||
=======
|
||||
<p>Need help? Email support@webhost.us.</p>
|
||||
>>>>>>> Commit #1
|
||||
```
|
||||
|
||||
The line `<<<<<<< HEAD` marks the beginning of a merge conflict, and the `>>>>>>> Commit #1` line marks the end, with the conflicting sections separated by `=======`. The part on the `HEAD` side is from the QMK master version of the file, and the part marked with the commit message is from the current branch and commit.
|
||||
|
||||
Because Git tracks *changes to files* rather than the contents of the files directly, if Git can't find the text that was in the file previous to the commit that was made, it won't know how to edit the file. Re-editing the file will solve the conflict. Make your changes, and then save the file.
|
||||
|
||||
```
|
||||
<p>Need help? Email support@webhost.us.</p>
|
||||
```
|
||||
|
||||
Now run:
|
||||
|
||||
```
|
||||
git add conflicting_file_1.txt
|
||||
git rebase --continue
|
||||
```
|
||||
|
||||
Git logs the changes to the conflicting file, and continues applying the commits from our branch until it reaches the end.
|
@@ -1,13 +1,15 @@
|
||||
# Learning Resources
|
||||
These resources are aimed at giving new members in the qmk community more understanding to the information provided in the newbs docs.
|
||||
|
||||
These resources are aimed at giving new members in the QMK community more understanding to the information provided in the Newbs docs.
|
||||
|
||||
Git resources:
|
||||
*
|
||||
*[Great General Tutorial](https://www.codecademy.com/learn/learn-git)
|
||||
*[Git Game To Learn From Examples](https://learngitbranching.js.org/)
|
||||
*[Git Resources to Learn More About Github](getting_started_github.md)
|
||||
*[Git Resources Aimed Specificly toward QMK](contributing.md)
|
||||
|
||||
* [Great General Tutorial](https://www.codecademy.com/learn/learn-git)
|
||||
* [Git Game To Learn From Examples](https://learngitbranching.js.org/)
|
||||
* [Git Resources to Learn More About Github](getting_started_github.md)
|
||||
* [Git Resources Aimed Specifically toward QMK](contributing.md)
|
||||
|
||||
|
||||
Command Line resources:
|
||||
*[Good General Tutorial on Command Line](https://www.codecademy.com/learn/learn-the-command-line)
|
||||
|
||||
* [Good General Tutorial on Command Line](https://www.codecademy.com/learn/learn-the-command-line)
|
||||
|
@@ -1,28 +1,79 @@
|
||||
# List of Useful Core Functions To Make Your Keyboard Better
|
||||
|
||||
There are a lot of hidden functions in QMK that are incredible useful, or may add a bit of functionality that you've been wanting. Functions that are specific to certain features are not included here, as those will be on their respective feature page.
|
||||
There are a lot of hidden functions in QMK that are incredible useful, or may add a bit of functionality that you've been wanting. Functions that are specific to certain features are not included here, as those will be on their respective feature page.
|
||||
|
||||
## (OLKB) Tri Layers
|
||||
|
||||
There are actually separate functions that you can use there, depending on what you're after.
|
||||
There are actually separate functions that you can use there, depending on what you're after.
|
||||
|
||||
The first is the `update_tri_layer(x, y, z)` function. This function check to see if layers `x` and `y` are both on. If they are both on, then it runs on layer `z`. Otherwise, if both `x` and `y` are not both on (either only one is, or neither is), then it runs off layer `z`.
|
||||
### `update_tri_layer(x, y, z)`
|
||||
|
||||
This function is useful if you want to create specific keys that have this functionality, but other layer keycodes won't do this.
|
||||
The first is the `update_tri_layer(x, y, z)` function. This function check to see if layers `x` and `y` are both on. If they are both on, then it runs on layer `z`. Otherwise, if both `x` and `y` are not both on (either only one is, or neither is), then it runs off layer `z`.
|
||||
|
||||
The other function is `update_tri_layer_state(state, x, y, z)`. This function is meant to be called from they [`layer_state_set_*` functions](custom_quantum_functions.md#layer-change-code). This means that any time that you use a keycode to change the layer, this will be checked. So you could use `LT(layer, kc)` to change the layer and it will trigger the same layer check.
|
||||
This function is useful if you want to create specific keys that have this functionality, but other layer keycodes won't do this.
|
||||
|
||||
The caveat to this method is that you cannot access the `z` layer without having `x` and `y` layers on, since if you try to activate just layer `z`, it will run this code and turn off layer `z` before you could use it.
|
||||
#### Example
|
||||
|
||||
```c
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
switch (keycode) {
|
||||
case LOWER:
|
||||
if (record->event.pressed) {
|
||||
layer_on(_LOWER);
|
||||
update_tri_layer(_LOWER, _RAISE, _ADJUST);
|
||||
} else {
|
||||
layer_off(_LOWER);
|
||||
update_tri_layer(_LOWER, _RAISE, _ADJUST);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case RAISE:
|
||||
if (record->event.pressed) {
|
||||
layer_on(_RAISE);
|
||||
update_tri_layer(_LOWER, _RAISE, _ADJUST);
|
||||
} else {
|
||||
layer_off(_RAISE);
|
||||
update_tri_layer(_LOWER, _RAISE, _ADJUST);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
```
|
||||
|
||||
### `update_tri_layer_state(state, x, y, z)`
|
||||
The other function is `update_tri_layer_state(state, x, y, z)`. This function is meant to be called from they [`layer_state_set_*` functions](custom_quantum_functions.md#layer-change-code). This means that any time that you use a keycode to change the layer, this will be checked. So you could use `LT(layer, kc)` to change the layer and it will trigger the same layer check.
|
||||
|
||||
The caveat to this method is that you cannot access the `z` layer without having `x` and `y` layers on, since if you try to activate just layer `z`, it will run this code and turn off layer `z` before you could use it.
|
||||
|
||||
#### Example
|
||||
|
||||
```c
|
||||
uint32_t layer_state_set_user(uint32_t state) {
|
||||
return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST);
|
||||
}
|
||||
```
|
||||
|
||||
Alternatively, you don't have to immediately "return" the value. This is useful if you want to add multiple tri layers, or if you want to add additional effects.
|
||||
|
||||
```c
|
||||
uint32_t layer_state_set_user(uint32_t state) {
|
||||
state = update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST);
|
||||
state = update_tri_layer_state(state, _RAISE, _SYMB, _SPECIAL);
|
||||
return state;
|
||||
}
|
||||
```
|
||||
|
||||
## Setting the Persistent Default Layer
|
||||
|
||||
Do you want to set the default layer, so that it's retained even after you unplug the board? If so, this is the function for you.
|
||||
Do you want to set the default layer, so that it's retained even after you unplug the board? If so, this is the function for you.
|
||||
|
||||
To use this, you would use `set_single_persistent_default_layer(layer)`. If you have a name defined for your layer, you can use that instead (such as _QWERTY, _DVORAK or _COLEMAK).
|
||||
To use this, you would use `set_single_persistent_default_layer(layer)`. If you have a name defined for your layer, you can use that instead (such as _QWERTY, _DVORAK or _COLEMAK).
|
||||
|
||||
This will set the default layer, update the persistent settings, and play a tune if you have [Audio](feature_audio.md) enabled on your board, and the default layer sounds set.
|
||||
This will set the default layer, update the persistent settings, and play a tune if you have [Audio](feature_audio.md) enabled on your board, and the default layer sounds set.
|
||||
|
||||
To configure the default layer sounds, you would want to define this in your `config.h` file, like this:
|
||||
To configure the default layer sounds, you would want to define this in your `config.h` file, like this:
|
||||
|
||||
```c
|
||||
#define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \
|
||||
@@ -36,13 +87,12 @@ To configure the default layer sounds, you would want to define this in your `co
|
||||
|
||||
## Reseting the keyboard
|
||||
|
||||
There is the `RESET` quantum keycode that you can use. But if you want to reset the board as part of a macro, rather than hitting a key separately, you can do that.
|
||||
There is the `RESET` quantum keycode that you can use. But if you want to reset the board as part of a macro, rather than hitting a key separately, you can do that.
|
||||
|
||||
And to do so, add `reset_keyboard()` to your function or macro, and this will reset to bootloader.
|
||||
|
||||
## Wiping the EEPROM (Persistent Storage)
|
||||
|
||||
If you're having issues with Audio, RGB Underglow, backlighting or keys acting weird, then you can reset the EEPROM (persistent setting storage). Bootmagic is one way to do this, but if that isn't enabled, then you can use a custom macro to do so.
|
||||
|
||||
To wipe the EEPROM, run `eeconfig_init()` from your function or macro to reset most of the settings to default.
|
||||
If you're having issues with Audio, RGB Underglow, backlighting or keys acting weird, then you can reset the EEPROM (persistent setting storage). Bootmagic is one way to do this, but if that isn't enabled, then you can use a custom macro to do so.
|
||||
|
||||
To wipe the EEPROM, run `eeconfig_init()` from your function or macro to reset most of the settings to default.
|
||||
|
@@ -128,7 +128,7 @@ The standard Deutsche (German) keyboard layout. Named for the first 6 letters on
|
||||
The term for pressing a key while a key is already held down. Variants include 2KRO, 6KRO, and NKRO.
|
||||
|
||||
## Scancode
|
||||
A 1 byte number that is sent as part of a HID report over USB that represents a single key. These numbers are documented in the [HID Usage Tables](http://www.usb.org/developers/hidpage/Hut1_12v2.pdf) published by the [USB-IF](http://www.usb.org/).
|
||||
A 1 byte number that is sent as part of a HID report over USB that represents a single key. These numbers are documented in the [HID Usage Tables](https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf) published by the [USB-IF](http://www.usb.org/).
|
||||
|
||||
## Space Cadet Shift
|
||||
A special set of shift keys which allow you to type various types of braces by tapping the left or right shift one or more times.
|
||||
|
6
keyboards/atreus62/keymaps/194h/config.h
Normal file
6
keyboards/atreus62/keymaps/194h/config.h
Normal file
@@ -0,0 +1,6 @@
|
||||
#pragma once
|
||||
#define ONESHOT_TIMEOUT 3000
|
||||
#define TAPPING_TERM 200
|
||||
#define FORCE_NKRO
|
||||
#define LEADER_TIMEOUT 1000
|
||||
#define TAPPING_TOGGLE 3
|
160
keyboards/atreus62/keymaps/194h/keymap.c
Normal file
160
keyboards/atreus62/keymaps/194h/keymap.c
Normal file
@@ -0,0 +1,160 @@
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
//The current Nordic and Norwegian layout files are a mess. I'll do it myself:
|
||||
//Norwegian
|
||||
#define NO_AE KC_QUOT // Æ
|
||||
#define NO_AO KC_LBRC // Å
|
||||
#define NO_BSLS KC_EQL // Backslash
|
||||
#define NO_LT KC_NUBS // <
|
||||
#define NO_MINS KC_SLSH // -
|
||||
#define NO_OE KC_SCLN // Ø
|
||||
#define NO_PIPE KC_GRV // |
|
||||
#define NO_PLUS KC_MINS // +
|
||||
#define NO_QUOT KC_NUHS // '
|
||||
#define NO_UMLA KC_RBRC // ¨
|
||||
//Norwegian - Modifier dependant definitions
|
||||
#define NO_EXLM LSFT(KC_1) // !
|
||||
#define NO_DQT LSFT(KC_2) // "
|
||||
#define NO_AT RALT(KC_2) // @
|
||||
#define NO_HASH LSFT(KC_3) // #
|
||||
#define NO_EUR LSFT(KC_4) // €
|
||||
#define NO_DLR RALT(KC_4) // $
|
||||
#define NO_PERC LSFT(KC_5) // %
|
||||
#define NO_AND LSFT(KC_6) // &
|
||||
#define NO_SLSH LSFT(KC_7) // /
|
||||
#define NO_PO LSFT(KC_8) // (
|
||||
#define NO_PC LSFT(KC_9) // )
|
||||
#define NO_EQL LSFT(KC_0) // =
|
||||
#define NO_LCBR RALT(KC_7) // {
|
||||
#define NO_LBRC RALT(KC_8) // [
|
||||
#define NO_RBRC RALT(KC_9) // ]
|
||||
#define NO_RCBR RALT(KC_0) // }
|
||||
#define NO_COLN LSFT(KC_DOT) // :
|
||||
#define NO_SCLN LSFT(KC_COMM) // ;
|
||||
#define NO_MU RALT(KC_M) // µ
|
||||
#define NO_EURO RALT(KC_E) // €
|
||||
#define NO_SECT LSFT(KC_GRV) // §
|
||||
#define NO_GERC RALT(KC_COMM) // ¸
|
||||
#define NO_QUAR LSFT(RALT(KC_4)) // ¼
|
||||
//Norwegian layout - dependant on previous definitions
|
||||
#define NO_UNDS LSFT(NO_MINS) // _
|
||||
#define NO_QUES LSFT(NO_PLUS) // ?
|
||||
#define NO_GRAV LSFT(NO_BSLS) // `
|
||||
#define NO_GT LSFT(NO_LT) // >
|
||||
#define NO_HALF RALT(NO_LT) // ½
|
||||
#define NO_HAT LSFT(NO_UMLA) // ^
|
||||
#define NO_ASTR LSFT(NO_QUOT) // *
|
||||
#define NO_TILD RALT(NO_UMLA) // ~
|
||||
|
||||
//One Shot Modifier
|
||||
#define OSM_LCTL OSM(MOD_LCTL)
|
||||
#define OSM_LALT OSM(MOD_LALT)
|
||||
#define OSM_LSFT OSM(MOD_LSFT)
|
||||
#define OSM_LGUI OSM(MOD_LGUI)
|
||||
#define OSM_RCTL OSM(MOD_RCTL)
|
||||
#define OSM_RALT OSM(MOD_RALT)
|
||||
#define OSM_RSFT OSM(MOD_RSFT)
|
||||
#define OSM_RGUI OSM(MOD_RGUI)
|
||||
|
||||
//Layers
|
||||
#define L1 0
|
||||
#define L2 1
|
||||
#define L3 2
|
||||
#define L4 3
|
||||
#define L5 4
|
||||
|
||||
// Momentary switch to layer - One Shot Layer
|
||||
#define OSL_L3 OSL(L3)
|
||||
#define OSL_L4 OSL(L4)
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
[L1] = LAYOUT(
|
||||
KC_LGUI, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_RGUI,
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, NO_DQT,
|
||||
KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, NO_SCLN, NO_QUOT,
|
||||
OSM_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, NO_MINS, OSM_RSFT,
|
||||
CTL_T(KC_ESC), MO(L5), KC_LEAD, OSM_LALT, MO(L4), OSL_L3, KC_SPC, KC_ENT, OSL_L3, MO(L4), OSM_RALT, NO_EQL, NO_PLUS, KC_RCTL
|
||||
),
|
||||
[L2] = LAYOUT(
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, NO_AO,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, NO_OE, NO_AE,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
),
|
||||
[L3] = LAYOUT(
|
||||
NO_LBRC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, NO_RBRC,
|
||||
NO_LCBR, XXXXXXX, XXXXXXX, NO_AT, XXXXXXX, NO_TILD, NO_QUES, NO_EXLM, NO_PIPE, XXXXXXX, XXXXXXX, NO_RCBR,
|
||||
_______, NO_ASTR, NO_BSLS, NO_DLR, NO_HASH, XXXXXXX, NO_HAT, XXXXXXX, NO_COLN, NO_SLSH, NO_SCLN, NO_QUOT,
|
||||
NO_PO, KC_0, NO_SECT, NO_PERC, XXXXXXX, NO_GRAV, NO_AND, NO_UMLA, NO_LT, NO_GT, NO_UNDS, NO_PC,
|
||||
XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX
|
||||
),
|
||||
[L4] = LAYOUT(
|
||||
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||
XXXXXXX, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_HOME, KC_PGDN, KC_PGUP, KC_END, XXXXXXX, XXXXXXX,
|
||||
_______, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, XXXXXXX, KC_DEL,
|
||||
XXXXXXX, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, XXXXXXX, KC_APP, XXXXXXX, XXXXXXX, KC_VOLD, XXXXXXX,
|
||||
OSM_LCTL, _______, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MUTE, KC_VOLU, OSM_RCTL
|
||||
),
|
||||
[L5] = LAYOUT(
|
||||
XXXXXXX, TO(L1), TO(L2), TO(L3), TO(L4), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, NO_AO,
|
||||
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, NO_OE, NO_AE,
|
||||
XXXXXXX, XXXXXXX, XXXXXXX, KC_CAPS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||
XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX
|
||||
)
|
||||
};
|
||||
|
||||
|
||||
// Unicode Linux
|
||||
void matrix_init_user(void) {
|
||||
set_unicode_input_mode(UC_LNX);
|
||||
};
|
||||
|
||||
|
||||
#define TAP_ONCE(code) \
|
||||
register_code (code); \
|
||||
unregister_code (code)
|
||||
|
||||
|
||||
LEADER_EXTERNS();
|
||||
|
||||
// Runs constantly in the background, in a loop. Only supports basic keycodes.
|
||||
void matrix_scan_user(void) {
|
||||
LEADER_DICTIONARY() {
|
||||
leading = false;
|
||||
leader_end();
|
||||
|
||||
//probably useless in practice, but cool
|
||||
SEQ_ONE_KEY (KC_P) {
|
||||
tap_random_base64();
|
||||
tap_random_base64();
|
||||
tap_random_base64();
|
||||
tap_random_base64();
|
||||
tap_random_base64();
|
||||
tap_random_base64();
|
||||
tap_random_base64();
|
||||
tap_random_base64();
|
||||
}
|
||||
|
||||
SEQ_ONE_KEY (KC_G) {
|
||||
SEND_STRING("grep something !");
|
||||
register_code(KC_RALT);
|
||||
TAP_ONCE(KC_4);
|
||||
unregister_code(KC_RALT);
|
||||
}
|
||||
SEQ_ONE_KEY (KC_T) {
|
||||
SEND_STRING("tail ");
|
||||
TAP_ONCE(KC_SLSH);
|
||||
SEND_STRING("f !");
|
||||
register_code(KC_RALT);
|
||||
TAP_ONCE(KC_4);
|
||||
unregister_code(KC_RALT);
|
||||
}
|
||||
SEQ_ONE_KEY (KC_S) {
|
||||
SEND_STRING("sudo !!");
|
||||
TAP_ONCE(KC_ENT);
|
||||
}
|
||||
}
|
||||
}
|
8
keyboards/atreus62/keymaps/194h/rules.mk
Normal file
8
keyboards/atreus62/keymaps/194h/rules.mk
Normal file
@@ -0,0 +1,8 @@
|
||||
TAP_DANCE_ENABLE = no
|
||||
NKRO_ENABLE = true
|
||||
MOUSEKEY_ENABLE = no
|
||||
EXTRAKEY_ENABLE = yes
|
||||
CONSOLE_ENABLE = no
|
||||
KEY_LOCK_ENABLE = no
|
||||
AUTO_SHIFT_ENABLE = no
|
||||
LEADER_ENABLE = yes
|
@@ -20,13 +20,17 @@
|
||||
enum contra_layers {
|
||||
_QWERTZ,
|
||||
_FUNC,
|
||||
_NUMROW
|
||||
_NUMROW,
|
||||
_NUMROW_L3,
|
||||
_GAMING
|
||||
};
|
||||
|
||||
#define KC_I3 LM(_NUMROW, MOD_LALT)
|
||||
#define KC_NR MO(_NUMROW)
|
||||
#define NR_L3 SAFE_RANGE
|
||||
#define FUN MO(_FUNC)
|
||||
#define G_1 TO(_GAMING)
|
||||
#define G_0 TG(_GAMING)
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
@@ -52,7 +56,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
* ,-----------------------------------------------------------------------------------.
|
||||
* | | | | | | | | Ü | | Ö | | Del |
|
||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* | Lock | Ä | ß | | | | | RGBS | RGBB | RGBS | | |
|
||||
* | Lock | Ä | ß | | | GAME | | RGBS | RGBB | RGBS | | |
|
||||
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
* | | | | | | | | RGBH-| RGBT | RGBH+| PgUp | |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
@@ -61,14 +65,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
*/
|
||||
[_FUNC] = {
|
||||
{_______, _______, _______, _______, _______, _______, _______, DE_UE, _______, DE_OE, _______, KC_DEL },
|
||||
{KC_LOCK, DE_AE, DE_SS, _______, _______, _______, _______, RGB_M_P, RGB_M_B, RGB_M_SW,_______, _______},
|
||||
{KC_LOCK, DE_AE, DE_SS, _______, _______, G_1, _______, RGB_M_P, RGB_M_B, RGB_M_SW,_______, _______},
|
||||
{_______, _______, _______, _______, _______, _______, _______, RGB_HUD, RGB_TOG, RGB_HUI, KC_PGUP, _______},
|
||||
{_______, _______, _______, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, KC_HOME, KC_PGDN, KC_END }
|
||||
},
|
||||
|
||||
/* Numrow layer (special characters with Shift and ISO_L3_Shift)
|
||||
* ,-----------------------------------------------------------------------------------.
|
||||
* | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | ß |
|
||||
* | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | |
|
||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* | | | | | | | | | | | #' | |
|
||||
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
@@ -78,25 +82,61 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
* `-----------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_NUMROW] = {
|
||||
{_______, DE_1, DE_2, DE_3, DE_4, DE_5, DE_6, DE_7, DE_8, DE_9, DE_0, DE_SS },
|
||||
{_______, DE_1, DE_2, DE_3, DE_4, DE_5, DE_6, DE_7, DE_8, DE_9, DE_0, _______},
|
||||
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, DE_HASH, _______},
|
||||
{_______, DE_LESS, _______, _______, _______, _______, _______, _______, _______, _______, DE_MINS, _______},
|
||||
{_______, _______, _______, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, _______, _______, _______}
|
||||
},
|
||||
[_NUMROW_L3] = {
|
||||
{_______, DE_1, DE_2, DE_3, DE_4, DE_5, DE_6, DE_7, DE_8, DE_9, DE_0, _______},
|
||||
{_______, DE_Q, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
|
||||
{_______, DE_LESS, _______, _______, _______, _______, _______, _______, _______, _______, DE_MINS, _______},
|
||||
{_______, _______, _______, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, _______, _______, _______}
|
||||
},
|
||||
|
||||
/* Gaming
|
||||
* ,-----------------------------------------------------------------------------------.
|
||||
* | | | | | | | | | | | | |
|
||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* | | | | | | | | | | | | |
|
||||
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
* | | | | | | | | | | | | |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | Space| | | | | | | | Reset| | | |
|
||||
* `-----------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_GAMING] = {
|
||||
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
|
||||
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
|
||||
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
|
||||
{KC_SPC, _______, _______, _______, _______, _______, _______, _______, G_0, _______, _______, _______}
|
||||
}
|
||||
};
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
if (keycode == NR_L3) {
|
||||
if (record->event.pressed) {
|
||||
register_code(DE_ALGR);
|
||||
layer_on(_NUMROW);
|
||||
} else {
|
||||
layer_off(_NUMROW);
|
||||
unregister_code(DE_ALGR);
|
||||
}
|
||||
return false;
|
||||
switch(keycode) {
|
||||
case KC_BSPC:
|
||||
if (record->event.pressed) {
|
||||
if (get_mods() & (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT))) {
|
||||
register_code(DE_SS);
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
unregister_code(DE_SS);
|
||||
}
|
||||
return true;
|
||||
case NR_L3:
|
||||
if (record->event.pressed) {
|
||||
register_code(DE_ALGR);
|
||||
layer_on(_NUMROW_L3);
|
||||
} else {
|
||||
layer_off(_NUMROW_L3);
|
||||
unregister_code(DE_ALGR);
|
||||
}
|
||||
return false;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void led_set_user(uint8_t usb_led) {
|
||||
|
64
keyboards/converter/sun_usb/command_extra.c
Normal file
64
keyboards/converter/sun_usb/command_extra.c
Normal file
@@ -0,0 +1,64 @@
|
||||
#include QMK_KEYBOARD_H
|
||||
#include "protocol/serial.h"
|
||||
|
||||
bool sun_bell = false;
|
||||
bool sun_click = false;
|
||||
|
||||
|
||||
bool command_extra(uint8_t code)
|
||||
{
|
||||
switch (code) {
|
||||
case KC_H:
|
||||
case KC_SLASH: /* ? */
|
||||
print("\n\n----- Sun converter Help -----\n");
|
||||
print("Home: Toggle Bell\n");
|
||||
print("End: Toggle Click\n");
|
||||
print("PgUp: LED all On\n");
|
||||
print("PgDown: LED all Off\n");
|
||||
print("Insert: Layout\n");
|
||||
print("Delete: Reset\n");
|
||||
return false;
|
||||
case KC_DEL:
|
||||
print("Reset\n");
|
||||
serial_send(0x01);
|
||||
break;
|
||||
case KC_HOME:
|
||||
sun_bell = !sun_bell;
|
||||
if (sun_bell) {
|
||||
print("Bell On\n");
|
||||
serial_send(0x02);
|
||||
} else {
|
||||
print("Bell Off\n");
|
||||
serial_send(0x03);
|
||||
}
|
||||
break;
|
||||
case KC_END:
|
||||
sun_click = !sun_click;
|
||||
if (sun_click) {
|
||||
print("Click On\n");
|
||||
serial_send(0x0A);
|
||||
} else {
|
||||
print("Click Off\n");
|
||||
serial_send(0x0B);
|
||||
}
|
||||
break;
|
||||
case KC_PGUP:
|
||||
print("LED all on\n");
|
||||
serial_send(0x0E);
|
||||
serial_send(0xFF);
|
||||
break;
|
||||
case KC_PGDOWN:
|
||||
print("LED all off\n");
|
||||
serial_send(0x0E);
|
||||
serial_send(0x00);
|
||||
break;
|
||||
case KC_INSERT:
|
||||
print("layout\n");
|
||||
serial_send(0x0F);
|
||||
break;
|
||||
default:
|
||||
xprintf("Unknown extra command: %02X\n", code);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
88
keyboards/converter/sun_usb/config.h
Normal file
88
keyboards/converter/sun_usb/config.h
Normal file
@@ -0,0 +1,88 @@
|
||||
/*
|
||||
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/>.
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_H
|
||||
#define CONFIG_H
|
||||
|
||||
#define CUSTOM_MATRIX 2
|
||||
|
||||
#define VENDOR_ID 0xFEED
|
||||
#define PRODUCT_ID 0x3333
|
||||
#define DEVICE_VER 0x0100
|
||||
#define MANUFACTURER QMK
|
||||
#define PRODUCT Sun keyboard converter
|
||||
#define DESCRIPTION USB converter for Sun type 5 keyboard
|
||||
|
||||
/* matrix size */
|
||||
#define MATRIX_ROWS 16
|
||||
#define MATRIX_COLS 8
|
||||
|
||||
/* key combination for command */
|
||||
#define IS_COMMAND() ( \
|
||||
keyboard_report->mods == (MOD_BIT(KC_LALT) | MOD_BIT(KC_RALT)) || \
|
||||
keyboard_report->mods == (MOD_BIT(KC_LGUI) | MOD_BIT(KC_RGUI)) || \
|
||||
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
|
||||
)
|
||||
|
||||
|
||||
/* Serial(USART) configuration
|
||||
* asynchronous, negative logic, 1200baud, no flow control
|
||||
* 1-start bit, 8-data bit, non parity, 1-stop bit
|
||||
*/
|
||||
#define SERIAL_SOFT_BAUD 1200
|
||||
#define SERIAL_SOFT_PARITY_NONE
|
||||
#define SERIAL_SOFT_BIT_ORDER_LSB
|
||||
#define SERIAL_SOFT_LOGIC_NEGATIVE
|
||||
/* RXD Port */
|
||||
#define SERIAL_SOFT_RXD_ENABLE
|
||||
#define SERIAL_SOFT_RXD_DDR DDRD
|
||||
#define SERIAL_SOFT_RXD_PORT PORTD
|
||||
#define SERIAL_SOFT_RXD_PIN PIND
|
||||
#define SERIAL_SOFT_RXD_BIT 2
|
||||
#define SERIAL_SOFT_RXD_VECT INT2_vect
|
||||
/* RXD Interupt */
|
||||
#define SERIAL_SOFT_RXD_INIT() do { \
|
||||
/* pin configuration: input with pull-up */ \
|
||||
SERIAL_SOFT_RXD_DDR &= ~(1<<SERIAL_SOFT_RXD_BIT); \
|
||||
SERIAL_SOFT_RXD_PORT |= (1<<SERIAL_SOFT_RXD_BIT); \
|
||||
/* enable interrupt: INT2(rising edge) */ \
|
||||
EICRA |= ((1<<ISC21)|(1<<ISC20)); \
|
||||
EIMSK |= (1<<INT2); \
|
||||
sei(); \
|
||||
} while (0)
|
||||
#define SERIAL_SOFT_RXD_INT_ENTER()
|
||||
#define SERIAL_SOFT_RXD_INT_EXIT() do { \
|
||||
/* clear interrupt flag */ \
|
||||
EIFR = (1<<INTF2); \
|
||||
} while (0)
|
||||
#define SERIAL_SOFT_RXD_READ() (SERIAL_SOFT_RXD_PIN&(1<<SERIAL_SOFT_RXD_BIT))
|
||||
/* TXD Port */
|
||||
#define SERIAL_SOFT_TXD_ENABLE
|
||||
#define SERIAL_SOFT_TXD_DDR DDRD
|
||||
#define SERIAL_SOFT_TXD_PORT PORTD
|
||||
#define SERIAL_SOFT_TXD_PIN PIND
|
||||
#define SERIAL_SOFT_TXD_BIT 3
|
||||
#define SERIAL_SOFT_TXD_HI() do { SERIAL_SOFT_TXD_PORT |= (1<<SERIAL_SOFT_TXD_BIT); } while (0)
|
||||
#define SERIAL_SOFT_TXD_LO() do { SERIAL_SOFT_TXD_PORT &= ~(1<<SERIAL_SOFT_TXD_BIT); } while (0)
|
||||
#define SERIAL_SOFT_TXD_INIT() do { \
|
||||
/* pin configuration: output */ \
|
||||
SERIAL_SOFT_TXD_DDR |= (1<<SERIAL_SOFT_TXD_BIT); \
|
||||
/* idle */ \
|
||||
SERIAL_SOFT_TXD_ON(); \
|
||||
} while (0)
|
||||
|
||||
#endif
|
32
keyboards/converter/sun_usb/led.c
Normal file
32
keyboards/converter/sun_usb/led.c
Normal file
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
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/>.
|
||||
*/
|
||||
|
||||
#include QMK_KEYBOARD_H
|
||||
#include "protocol/serial.h"
|
||||
|
||||
void led_set(uint8_t usb_led)
|
||||
{
|
||||
uint8_t sun_led = 0;
|
||||
if (usb_led & (1<<USB_LED_NUM_LOCK)) sun_led |= (1<<0);
|
||||
if (usb_led & (1<<USB_LED_COMPOSE)) sun_led |= (1<<1);
|
||||
if (usb_led & (1<<USB_LED_SCROLL_LOCK)) sun_led |= (1<<2);
|
||||
if (usb_led & (1<<USB_LED_CAPS_LOCK)) sun_led |= (1<<3);
|
||||
xprintf("LED: %02X\n", usb_led);
|
||||
|
||||
serial_send(0x0E);
|
||||
serial_send(sun_led);
|
||||
}
|
197
keyboards/converter/sun_usb/matrix.c
Normal file
197
keyboards/converter/sun_usb/matrix.c
Normal file
@@ -0,0 +1,197 @@
|
||||
/*
|
||||
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/>.
|
||||
*/
|
||||
|
||||
#include QMK_KEYBOARD_H
|
||||
#include "protocol/serial.h"
|
||||
|
||||
/*
|
||||
* Matrix Array usage:
|
||||
*
|
||||
* ROW: 16(4bits)
|
||||
* COL: 8(3bits)
|
||||
*
|
||||
* 8bit wide
|
||||
* +---------+
|
||||
* 0|00 ... 07|
|
||||
* 1|08 ... 0F|
|
||||
* :| ... |
|
||||
* :| ... |
|
||||
* E|70 ... 77|
|
||||
* F|78 ... 7F|
|
||||
* +---------+
|
||||
*/
|
||||
static uint8_t matrix[MATRIX_ROWS];
|
||||
#define ROW(code) ((code>>3)&0xF)
|
||||
#define COL(code) (code&0x07)
|
||||
|
||||
static bool is_modified = false;
|
||||
|
||||
__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)
|
||||
{
|
||||
/* DDRD |= (1<<6); */
|
||||
/* PORTD |= (1<<6); */
|
||||
debug_enable = true;
|
||||
|
||||
serial_init();
|
||||
|
||||
// initialize matrix state: all keys off
|
||||
for (uint8_t i=0; i < MATRIX_ROWS; i++) matrix[i] = 0x00;
|
||||
|
||||
/* // wait for keyboard coming up */
|
||||
/* // otherwise LED status update fails */
|
||||
/* print("Reseting "); */
|
||||
/* while (1) { */
|
||||
/* print("."); */
|
||||
/* while (serial_recv()); */
|
||||
/* serial_send(0x01); */
|
||||
/* _delay_ms(500); */
|
||||
/* if (serial_recv() == 0xFF) { */
|
||||
/* _delay_ms(500); */
|
||||
/* if (serial_recv() == 0x04) */
|
||||
/* break; */
|
||||
/* } */
|
||||
/* } */
|
||||
/* print(" Done\n"); */
|
||||
|
||||
/* PORTD &= ~(1<<6); */
|
||||
|
||||
matrix_init_quantum();
|
||||
return;
|
||||
}
|
||||
|
||||
uint8_t matrix_scan(void)
|
||||
{
|
||||
uint8_t code;
|
||||
code = serial_recv();
|
||||
if (!code) return 0;
|
||||
|
||||
debug_hex(code); debug(" ");
|
||||
|
||||
switch (code) {
|
||||
case 0xFF: // reset success: FF 04
|
||||
print("reset: ");
|
||||
_delay_ms(500);
|
||||
code = serial_recv();
|
||||
xprintf("%02X\n", code);
|
||||
if (code == 0x04) {
|
||||
// LED status
|
||||
led_set(host_keyboard_leds());
|
||||
}
|
||||
return 0;
|
||||
case 0xFE: // layout: FE <layout>
|
||||
print("layout: ");
|
||||
_delay_ms(500);
|
||||
xprintf("%02X\n", serial_recv());
|
||||
return 0;
|
||||
case 0x7E: // reset fail: 7E 01
|
||||
print("reset fail: ");
|
||||
_delay_ms(500);
|
||||
xprintf("%02X\n", serial_recv());
|
||||
return 0;
|
||||
case 0x7F:
|
||||
// all keys up
|
||||
for (uint8_t i=0; i < MATRIX_ROWS; i++) matrix[i] = 0x00;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (code&0x80) {
|
||||
// break code
|
||||
if (matrix_is_on(ROW(code), COL(code))) {
|
||||
matrix[ROW(code)] &= ~(1<<COL(code));
|
||||
}
|
||||
} else {
|
||||
// make code
|
||||
if (!matrix_is_on(ROW(code), COL(code))) {
|
||||
matrix[ROW(code)] |= (1<<COL(code));
|
||||
}
|
||||
}
|
||||
|
||||
matrix_scan_quantum();
|
||||
return code;
|
||||
}
|
||||
|
||||
bool matrix_is_modified(void)
|
||||
{
|
||||
return is_modified;
|
||||
}
|
||||
|
||||
inline
|
||||
bool matrix_has_ghost(void)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
inline
|
||||
bool matrix_is_on(uint8_t row, uint8_t col)
|
||||
{
|
||||
return (matrix[row] & (1<<col));
|
||||
}
|
||||
|
||||
inline
|
||||
uint8_t matrix_get_row(uint8_t row)
|
||||
{
|
||||
return matrix[row];
|
||||
}
|
||||
|
||||
void matrix_print(void)
|
||||
{
|
||||
print("\nr/c 01234567\n");
|
||||
for (uint8_t row = 0; row < matrix_rows(); row++) {
|
||||
phex(row); print(": ");
|
||||
pbin_reverse(matrix_get_row(row));
|
||||
print("\n");
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t matrix_key_count(void)
|
||||
{
|
||||
uint8_t count = 0;
|
||||
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
|
||||
count += bitpop(matrix[i]);
|
||||
}
|
||||
return count;
|
||||
}
|
89
keyboards/converter/sun_usb/readme.md
Normal file
89
keyboards/converter/sun_usb/readme.md
Normal file
@@ -0,0 +1,89 @@
|
||||
# Sun to USB keyboard protocol converter
|
||||
|
||||
A converter for using non-USB Sun keyboards.
|
||||
|
||||
Original code from the [TMK firmware](https://github.com/tmk/tmk_keyboard/tree/master/converter/sun_usb). Ported to QMK by [Yann Hodique](https://github.com/sigma).
|
||||
|
||||
Keyboard Maintainer: [Yann Hodique](https://github.com/sigma)
|
||||
Hardware Supported: See hardware section below
|
||||
Hardware Availability: self-built
|
||||
|
||||
Make example for this keyboard (after setting up your build environment):
|
||||
|
||||
make converter/sun_usb/type5:default
|
||||
|
||||
See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information.
|
||||
|
||||
|
||||
## Hardware
|
||||
|
||||
Target MCU is ATMega32u4 but other USB capable AVR will also work. The maintainer mostly uses Teensy 2.0 boards.
|
||||
Supported keyboards: Sun Type 3 and 5 Keyboards,
|
||||
|
||||
### Connector
|
||||
|
||||
8Pin mini DIN
|
||||
|
||||
___ ___
|
||||
/ |_| \
|
||||
/ 8 7 6 \
|
||||
| 5 4 3 |
|
||||
\_ 2 1 _/
|
||||
\_____/
|
||||
(receptacle)
|
||||
|
||||
|
||||
Wiring:
|
||||
|
||||
Pin mini DIN MCU
|
||||
----------------------------------
|
||||
1 GND GND
|
||||
2 GND GND
|
||||
3 5V
|
||||
4 RX/TX(Mouse)
|
||||
5 RX PD3
|
||||
6 TX PD2
|
||||
7 GND GND
|
||||
8 5V VCC
|
||||
|
||||
|
||||
### Protocol
|
||||
|
||||
Signal: Asynchronous, Negative logic, 1200baud, No Flow control
|
||||
Frame format: 1-Start bit, 8-Data bits, No-Parity, 1-Stop bit
|
||||
|
||||
AVR USART engine expects positive logic while Sun keyboard signal is negative.
|
||||
To use AVR UART engine you need external inverter in front of RX and TX pin.
|
||||
Otherwise you can software serial routine to communicate the keyboard.
|
||||
|
||||
This converter uses software method, you doesn't need any inverter part.
|
||||
|
||||
|
||||
Commands From System To Keyboard
|
||||
|
||||
0x01 Reset
|
||||
Keyboard responds with following byte sequence:
|
||||
Success: 0xFF 0x04 0x7F
|
||||
Fail: 0x7E 0x01 0x7F
|
||||
0x02 Bell On
|
||||
0x03 Bell Off
|
||||
0x0A Click On
|
||||
0x0B Click Off
|
||||
0x0E LED
|
||||
followed by LED status byte:
|
||||
bit: 3 2 1 0
|
||||
LED: CapsLk ScrLk Compose NumLk
|
||||
0x0F Layout
|
||||
Keyboard responds with 'Layout Response' 0xFE 0xXX
|
||||
|
||||
Commands From Keyboard To System
|
||||
|
||||
0x7F Idle
|
||||
means no keys pressed.
|
||||
0xFE Layout Response
|
||||
0xFF Reset Response(followed by 0x04)
|
||||
|
||||
References
|
||||
|
||||
* http://kentie.net/article/sunkbd/page2.htm
|
||||
* http://kentie.net/article/sunkbd/KBD.pdf
|
44
keyboards/converter/sun_usb/rules.mk
Normal file
44
keyboards/converter/sun_usb/rules.mk
Normal file
@@ -0,0 +1,44 @@
|
||||
MCU = atmega32u4 # Teensy 2.0
|
||||
F_CPU = 16000000
|
||||
ARCH = AVR8
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
BOOTLOADER = lufa-dfu
|
||||
|
||||
# Build Options
|
||||
# change to "no" to disable the options, or define them in the Makefile in
|
||||
# the appropriate keymap folder that will get included automatically
|
||||
#
|
||||
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE = yes # Console for debug(+400)
|
||||
COMMAND_ENABLE = yes # Commands for debug and configuration
|
||||
NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
|
||||
MIDI_ENABLE = no # MIDI controls
|
||||
AUDIO_ENABLE = no # Audio output on port C6
|
||||
UNICODE_ENABLE = no # Unicode
|
||||
UNICODEMAP_ENABLE = yes
|
||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
|
||||
CUSTOM_MATRIX = yes
|
||||
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||
|
||||
#HARDWARE_SERIAL = yes
|
||||
|
||||
SRC += matrix.c led.c
|
||||
|
||||
ifdef HARDWARE_SERIAL
|
||||
SRC += protocol/serial_uart.c
|
||||
OPT_DEFS += -DHARDWARE_SERIAL
|
||||
else
|
||||
SRC += protocol/serial_soft.c
|
||||
endif
|
||||
|
||||
DEFAULT_FOLDER = converter/sun_usb/type5
|
29
keyboards/converter/sun_usb/type3/keymaps/default/keymap.c
Normal file
29
keyboards/converter/sun_usb/type3/keymaps/default/keymap.c
Normal file
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
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/>.
|
||||
*/
|
||||
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
LAYOUT(
|
||||
KC_F10,KC_F11, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_BSPC, KC_VOLD, KC_MUTE, KC_VOLU,
|
||||
KC_F12,KC_F13, KC_ESC,KC_1,KC_2,KC_3,KC_4,KC_5,KC_6,KC_7,KC_8,KC_9,KC_0,KC_MINS,KC_EQL,KC_BSLS,KC_GRV, KC_MPRV, KC_MPLY, KC_MNXT,
|
||||
KC_F14,KC_F15, 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_DEL, KC_HOME, KC_UP, KC_PGUP,
|
||||
KC_F16,KC_F17, KC_LCTL, KC_A,KC_S,KC_D,KC_F,KC_G,KC_H,KC_J,KC_K,KC_L,KC_SCLN,KC_QUOT, KC_ENT, KC_LEFT,KC_INSERT,KC_RIGHT,
|
||||
KC_F18,KC_F19, 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_RCTL, KC_END, KC_DOWN,KC_PGDOWN,
|
||||
KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI
|
||||
),
|
||||
};
|
0
keyboards/converter/sun_usb/type3/rules.mk
Normal file
0
keyboards/converter/sun_usb/type3/rules.mk
Normal file
66
keyboards/converter/sun_usb/type3/type3.h
Normal file
66
keyboards/converter/sun_usb/type3/type3.h
Normal file
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
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/>.
|
||||
*/
|
||||
|
||||
#ifndef TYPE3_H
|
||||
#define TYPE3_H
|
||||
|
||||
#include "quantum.h"
|
||||
|
||||
/* Sun type 3 keyboard
|
||||
,-------. ,-----------------------------------------------------------. ,-----------.
|
||||
| 01| 03| | 05| 06| 08| 0A| 0C| 0E| 10| 11| 12| 2B| | 15| 16| 17|
|
||||
|-------| |-----------------------------------------------------------| |-----------|
|
||||
| 19| 1A| | 1D| 1E| 1F| 20| 21| 22| 23| 24| 25| 26| 27| 28| 29| 58| 2A| | 2D| 2E| 2F|
|
||||
|-------| |-----------------------------------------------------------| |-----------|
|
||||
| 31| 33| | 35 | 36| 37| 38| 39| 3A| 3B| 3C| 3D| 3E| 3F| 40| 41| 42 | | 44| 45| 46|
|
||||
|-------| |-----------------------------------------------------------| |-----------|
|
||||
| 48| 49| | 4C | 4D| 4E| 4F| 50| 51| 52| 53| 54| 55| 56| 57| 59 | | 5B| 5C| 5D|
|
||||
|-------| |-----------------------------------------------------------| |-----------|
|
||||
| 5F| 61| | 63 | 64| 65| 66| 67| 68| 69| 6A| 6B| 6C| 6D| 6E| 6F| | 70| 71| 72|
|
||||
`-------' |-----------------------------------------------------------| `-----------'
|
||||
| 77 | 78 | 79 | 7A | 13 |
|
||||
`-----------------------------------------------------------'
|
||||
*/
|
||||
|
||||
|
||||
#define LAYOUT( \
|
||||
K01,K03, K05,K06, K08, K0A, K0C, K0E, K10,K11,K12,K2B, K15,K16,K17, \
|
||||
K19,K1A, K1D,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K28,K29,K58,K2A, K2D,K2E,K2F, \
|
||||
K31,K33, K35, K36,K37,K38,K39,K3A,K3B,K3C,K3D,K3E,K3F,K40,K41, K42, K44,K45,K46, \
|
||||
K48,K49, K4C, K4D,K4E,K4F,K50,K51,K52,K53,K54,K55,K56,K57, K59, K5B,K5C,K5D, \
|
||||
K5F,K61, K63, K64,K65,K66,K67,K68,K69,K6A,K6B,K6C,K6D, K6E,K6F, K70,K71,K72, \
|
||||
K77,K78, K79, K7A,K13 \
|
||||
) { \
|
||||
{ KC_NO, K01 , KC_NO, K03 , KC_NO, K05 , K06 , KC_NO }, \
|
||||
{ K08 , KC_NO, K0A , KC_NO, K0C , KC_NO, K0E , KC_NO }, \
|
||||
{ K10 , K11 , K12 , K13 , KC_NO, K15 , K16 , K17 }, \
|
||||
{ KC_NO, K19 , K1A , KC_NO, KC_NO, K1D , K1E , K1F }, \
|
||||
{ K20 , K21 , K22 , K23 , K24 , K25 , K26 , K27 }, \
|
||||
{ K28 , K29 , K2A , K2B , KC_NO, K2D , K2E , K2F }, \
|
||||
{ KC_NO, K31 , KC_NO, K33 , KC_NO, K35 , K36 , K37 }, \
|
||||
{ K38 , K39 , K3A , K3B , K3C , K3D , K3E , K3F }, \
|
||||
{ K40 , K41 , K42 , KC_NO, K44 , K45 , K46 , KC_NO }, \
|
||||
{ K48 , K49 , KC_NO, KC_NO, K4C , K4D , K4E , K4F }, \
|
||||
{ K50 , K51 , K52 , K53 , K54 , K55 , K56 , K57 }, \
|
||||
{ K58 , K59 , KC_NO, K5B , K5C , K5D , KC_NO, K5F }, \
|
||||
{ KC_NO, K61 , KC_NO, K63 , K64 , K65 , K66 , K67 }, \
|
||||
{ K68 , K69 , K6A , K6B , K6C , K6D , K6E , K6F }, \
|
||||
{ K70 , K71 , K72 , KC_NO, KC_NO, KC_NO, KC_NO, K77 }, \
|
||||
{ K78 , K79 , K7A , KC_NO, KC_NO, KC_NO, KC_NO, KC_NO } \
|
||||
}
|
||||
|
||||
#endif
|
30
keyboards/converter/sun_usb/type5/keymaps/default/keymap.c
Normal file
30
keyboards/converter/sun_usb/type5/keymaps/default/keymap.c
Normal file
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
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/>.
|
||||
*/
|
||||
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/* LAYOUT_jp_unix is a superset of the other layouts, hence the default */
|
||||
LAYOUT_jp_unix(
|
||||
KC_HELP, KC_NO, 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_SLCK,KC_PAUS, KC_MUTE,KC_VOLD,KC_VOLU,KC_PWR,
|
||||
KC_STOP, KC_AGAIN, KC_ESC,KC_1,KC_2,KC_3,KC_4,KC_5,KC_6,KC_7,KC_8,KC_9,KC_0,KC_MINS,KC_EQL,KC_BSLS,KC_GRV, KC_INS, KC_HOME,KC_PGUP, KC_NLCK,KC_PSLS,KC_PAST,KC_PMNS,
|
||||
KC_MENU, KC_UNDO, 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_BSPC, KC_DEL, KC_END, KC_PGDN, KC_P7, KC_P8, KC_P9, KC_PPLS,
|
||||
KC_SELECT, KC_COPY, KC_LCTL, KC_A,KC_S,KC_D,KC_F,KC_G,KC_H,KC_J,KC_K,KC_L,KC_SCLN,KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6,
|
||||
KC_EXECUTE,KC_PASTE, 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_P1, KC_P2, KC_P3, KC_PENT,
|
||||
KC_FIND, KC_CUT, KC_CAPS,KC_LALT,KC_LGUI,KC_HENK, KC_SPC, KC_MHEN,KC_KANA,KC_RGUI,KC_APP,KC_RALT, KC_LEFT,KC_DOWN,KC_RGHT, KC_P0, KC_PDOT
|
||||
),
|
||||
};
|
31
keyboards/converter/sun_usb/type5/keymaps/sigma/keymap.c
Normal file
31
keyboards/converter/sun_usb/type5/keymaps/sigma/keymap.c
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
Copyright 2018 Yann Hodique <yann.hodique@gmail.com> @sigma
|
||||
|
||||
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
|
||||
#include "sigma.h"
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] =
|
||||
{
|
||||
[_QWERTY] = LAYOUT_us_unix(
|
||||
KC_LEAD, KC_SCRT, 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_SLCK,KC_PAUS, KC_MUTE,KC_VOLD,KC_VOLU,KC_OS_LOCK,
|
||||
KC_STOP, KC_OS_REDO, KC_ESC,KC_1,KC_2,KC_3,KC_4,KC_5,KC_6,KC_7,KC_8,KC_9,KC_0,KC_MINS,KC_EQL,KC_BSLS,KC_GRV, KC_INS, KC_HOME,KC_PGUP, KC_NLCK,KC_PSLS,KC_PAST,KC_PMNS,
|
||||
VRSN, KC_OS_UNDO, 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_BSPC, KC_DEL, KC_END, KC_PGDN, KC_P7, KC_P8, KC_P9, KC_PPLS,
|
||||
KC_MAKE, KC_OS_COPY, KC_LCTL, KC_A,KC_S,KC_D,KC_F,KC_G,KC_H,KC_J,KC_K,KC_L,KC_SCLN,KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6,
|
||||
KC_EXECUTE,KC_OS_PASTE, 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_P1, KC_P2, KC_P3, KC_PENT,
|
||||
KC_FIND, KC_OS_CUT, KC_CAPS,KC_LGUI,KC_LALT, KC_SPC, KC_RGUI,KC_APP,KC_RALT, KC_LEFT,KC_DOWN,KC_RGHT, KC_P0, KC_PDOT
|
||||
),
|
||||
};
|
12
keyboards/converter/sun_usb/type5/keymaps/sigma/readme.md
Normal file
12
keyboards/converter/sun_usb/type5/keymaps/sigma/readme.md
Normal file
@@ -0,0 +1,12 @@
|
||||
Overview
|
||||
========
|
||||
|
||||
This is my personal Sun Type 5 configuration.
|
||||
|
||||
How to build
|
||||
------------
|
||||
|
||||
make converter/sun_usb/type5:sigma:teensy
|
||||
|
||||
Layers
|
||||
------
|
1
keyboards/converter/sun_usb/type5/keymaps/sigma/rules.mk
Normal file
1
keyboards/converter/sun_usb/type5/keymaps/sigma/rules.mk
Normal file
@@ -0,0 +1 @@
|
||||
BOOTLOADER = halfkay
|
0
keyboards/converter/sun_usb/type5/rules.mk
Normal file
0
keyboards/converter/sun_usb/type5/rules.mk
Normal file
148
keyboards/converter/sun_usb/type5/type5.h
Normal file
148
keyboards/converter/sun_usb/type5/type5.h
Normal file
@@ -0,0 +1,148 @@
|
||||
/*
|
||||
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/>.
|
||||
*/
|
||||
|
||||
#ifndef TYPE5_H
|
||||
#define TYPE5_H
|
||||
|
||||
#include "quantum.h"
|
||||
|
||||
/* sun type 5 keyboard, JP Unix-style
|
||||
,-------. ,---, ,---------------. ,---------------. ,---------------. ,-----------. ,---------------.
|
||||
| 76 | | 0F| | 05| 06| 08| 0A| | 0C| 0E| 10| 11| | 12| 07| 09| 0B| | 16| 17| 15| | 2D| 02| 04| 30|
|
||||
`-------' `---' `---------------' `---------------' `---------------' `-----------' `---------------'
|
||||
,-------. ,-----------------------------------------------------------. ,-----------. ,---------------.
|
||||
| 01| 03| | 1D| 1E| 1F| 20| 21| 22| 23| 24| 25| 26| 27| 28| 29| 58| 2A| | 2C| 34| 60| | 62| 2E| 2F| 47|
|
||||
|-------| |-----------------------------------------------------------| |------------ |---------------|
|
||||
| 19| 1A| | 35 | 36| 37| 38| 39| 3A| 3B| 3C| 3D| 3E| 3F| 40| 41| 2B | | 42| 4A| 7B| | 44| 45| 46| |
|
||||
|-------| |-----------------------------------------------------------| `-----------' |-----------| 7D|
|
||||
| 31| 33| | 4C | 4D| 4E| 4F| 50| 51| 52| 53| 54| 55| 56| 57| 59 | | 5B| 5C| 5D| |
|
||||
|-------| |-----------------------------------------------------------| ,---. |-----------|---|
|
||||
| 48| 49| | 63 | 64| 65| 66| 67| 68| 69| 6A| 6B| 6C| 6D| 6E | | 14| | 70| 71| 72| |
|
||||
|-------| |-----------------------------------------------------------| .-----------. |-----------| 5A|
|
||||
| 5F| 61| | 77 | 13| 78 |*73 | 79 |*74 |*75| 7A | 43| 0D| | 18| 1B| 1C| | 5E | 32| |
|
||||
`-------' `-----------------------------------------------------------' `-----------' `---------------'
|
||||
*/
|
||||
#define LAYOUT_jp_unix( \
|
||||
K76, K0F, K05,K06,K08,K0A, K0C,K0E,K10,K11, K12,K07,K09,K0B, K16,K17,K15, K2D,K02,K04,K30, \
|
||||
K01,K03, K1D,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K28,K29,K58,K2A, K2C,K34,K60, K62,K2E,K2F,K47, \
|
||||
K19,K1A, K35, K36,K37,K38,K39,K3A,K3B,K3C,K3D,K3E,K3F,K40,K41, K2B, K42,K4A,K7B, K44,K45,K46,K7D, \
|
||||
K31,K33, K4C, K4D,K4E,K4F,K50,K51,K52,K53,K54,K55,K56,K57, K59, K5B,K5C,K5D, \
|
||||
K48,K49, K63, K64,K65,K66,K67,K68,K69,K6A,K6B,K6C,K6D, K6E, K14, K70,K71,K72,K5A, \
|
||||
K5F,K61, K77,K13, K78, K73, K79, K74, K75, K7A, K43, K0D, K18,K1B,K1C, K5E, K32 \
|
||||
) { \
|
||||
{ KC_NO, K01 , K02 , K03 , K04 , K05 , K06 , K07 }, \
|
||||
{ K08 , K09 , K0A , K0B , K0C , K0D , K0E , K0F ,}, \
|
||||
{ K10 , K11 , K12 , K13 , K14 , K15 , K16 , K17 }, \
|
||||
{ K18 , K19 , K1A , K1B , K1C , K1D , K1E , K1F }, \
|
||||
{ K20 , K21 , K22 , K23 , K24 , K25 , K26 , K27 }, \
|
||||
{ K28 , K29 , K2A , K2B , K2C , K2D , K2E , K2F }, \
|
||||
{ K30 , K31 , K32 , K33 , K34 , K35 , K36 , K37 }, \
|
||||
{ K38 , K39 , K3A , K3B , K3C , K3D , K3E , K3F }, \
|
||||
{ K40 , K41 , K42 , K43 , K44 , K45 , K46 , K47 }, \
|
||||
{ K48 , K49 , K4A , KC_NO, K4C , K4D , K4E , K4F }, \
|
||||
{ K50 , K51 , K52 , K53 , K54 , K55 , K56 , K57 }, \
|
||||
{ K58 , K59 , K5A , K5B , K5C , K5D , K5E , K5F }, \
|
||||
{ K60 , K61 , K62 , K63 , K64 , K65 , K66 , K67 }, \
|
||||
{ K68 , K69 , K6A , K6B , K6C , K6D , K6E , KC_NO }, \
|
||||
{ K70 , K71 , K72 , K73 , K74 , K75 , K76 , K77 }, \
|
||||
{ K78 , K79 , K7A , K7B , KC_NO, K7D , KC_NO, KC_NO } \
|
||||
}
|
||||
|
||||
/* Sun type 5 keyboard, US Unix-style
|
||||
,-------. ,---, ,---------------. ,---------------. ,---------------. ,-----------. ,---------------.
|
||||
| 76 | | 0F| | 05| 06| 08| 0A| | 0C| 0E| 10| 11| | 12| 07| 09| 0B| | 16| 17| 15| | 2D| 02| 04| 30|
|
||||
`-------' `---' `---------------' `---------------' `---------------' `-----------' `---------------'
|
||||
,-------. ,-----------------------------------------------------------. ,-----------. ,---------------.
|
||||
| 01| 03| | 1D| 1E| 1F| 20| 21| 22| 23| 24| 25| 26| 27| 28| 29| 58| 2A| | 2C| 34| 60| | 62| 2E| 2F| 47|
|
||||
|-------| |-----------------------------------------------------------| |------------ |---------------|
|
||||
| 19| 1A| | 35 | 36| 37| 38| 39| 3A| 3B| 3C| 3D| 3E| 3F| 40| 41| 2B | | 42| 4A| 7B| | 44| 45| 46| |
|
||||
|-------| |-----------------------------------------------------------| `-----------' |-----------| 7D|
|
||||
| 31| 33| | 4C | 4D| 4E| 4F| 50| 51| 52| 53| 54| 55| 56| 57| 59 | | 5B| 5C| 5D| |
|
||||
|-------| |-----------------------------------------------------------| ,---. |-----------|---|
|
||||
| 48| 49| | 63 | 64| 65| 66| 67| 68| 69| 6A| 6B| 6C| 6D| 6E | | 14| | 70| 71| 72| |
|
||||
|-------| |-----------------------------------------------------------| .-----------. |-----------| 5A|
|
||||
| 5F| 61| | 77 | 13| 78 | 79 | 7A | 43| 0D| | 18| 1B| 1C| | 5E | 32| |
|
||||
`-------' `-----------------------------------------------------------' `-----------' `---------------'
|
||||
*/
|
||||
#define LAYOUT_us_unix( \
|
||||
K76, K0F, K05,K06,K08,K0A, K0C,K0E,K10,K11, K12,K07,K09,K0B, K16,K17,K15, K2D,K02,K04,K30, \
|
||||
K01,K03, K1D,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K28,K29,K58,K2A, K2C,K34,K60, K62,K2E,K2F,K47, \
|
||||
K19,K1A, K35, K36,K37,K38,K39,K3A,K3B,K3C,K3D,K3E,K3F,K40,K41, K2B, K42,K4A,K7B, K44,K45,K46,K7D, \
|
||||
K31,K33, K4C, K4D,K4E,K4F,K50,K51,K52,K53,K54,K55,K56,K57, K59, K5B,K5C,K5D, \
|
||||
K48,K49, K63, K64,K65,K66,K67,K68,K69,K6A,K6B,K6C,K6D, K6E, K14, K70,K71,K72,K5A, \
|
||||
K5F,K61, K77,K13, K78, K79, K7A, K43, K0D, K18,K1B,K1C, K5E, K32 \
|
||||
) { \
|
||||
{ KC_NO, K01 , K02 , K03 , K04 , K05 , K06 , K07 }, \
|
||||
{ K08 , K09 , K0A , K0B , K0C , K0D , K0E , K0F ,}, \
|
||||
{ K10 , K11 , K12 , K13 , K14 , K15 , K16 , K17 }, \
|
||||
{ K18 , K19 , K1A , K1B , K1C , K1D , K1E , K1F }, \
|
||||
{ K20 , K21 , K22 , K23 , K24 , K25 , K26 , K27 }, \
|
||||
{ K28 , K29 , K2A , K2B , K2C , K2D , K2E , K2F }, \
|
||||
{ K30 , K31 , K32 , K33 , K34 , K35 , K36 , K37 }, \
|
||||
{ K38 , K39 , K3A , K3B , K3C , K3D , K3E , K3F }, \
|
||||
{ K40 , K41 , K42 , K43 , K44 , K45 , K46 , K47 }, \
|
||||
{ K48 , K49 , K4A , KC_NO, K4C , K4D , K4E , K4F }, \
|
||||
{ K50 , K51 , K52 , K53 , K54 , K55 , K56 , K57 }, \
|
||||
{ K58 , K59 , K5A , K5B , K5C , K5D , K5E , K5F }, \
|
||||
{ K60 , K61 , K62 , K63 , K64 , K65 , K66 , K67 }, \
|
||||
{ K68 , K69 , K6A , K6B , K6C , K6D , K6E , KC_NO }, \
|
||||
{ K70 , K71 , K72 , KC_NO, KC_NO, KC_NO, K76 , K77 }, \
|
||||
{ K78 , K79 , K7A , K7B , KC_NO, K7D , KC_NO, KC_NO } \
|
||||
}
|
||||
|
||||
/* Sun type 5 keyboard, US ANSI-style
|
||||
,-------. ,---, ,---------------. ,---------------. ,---------------. ,-----------. ,---------------.
|
||||
| 76 | | 1D| | 05| 06| 08| 0A| | 0C| 0E| 10| 11| | 12| 07| 09| 0B| | 16| 17| 15| | 2D| 02| 04| 30|
|
||||
`-------' `---' `---------------' `---------------' `---------------' `-----------' `---------------'
|
||||
,-------. ,-----------------------------------------------------------. ,-----------. ,---------------.
|
||||
| 01| 03| | 2A| 1E| 1F| 20| 21| 22| 23| 24| 25| 26| 27| 28| 29| 2B | | 2C| 34| 60| | 62| 2E| 2F| 47|
|
||||
|-------| |-----------------------------------------------------------| |------------ |---------------|
|
||||
| 19| 1A| | 35 | 36| 37| 38| 39| 3A| 3B| 3C| 3D| 3E| 3F| 40| 41| 58 | | 42| 4A| 7B| | 44| 45| 46| |
|
||||
|-------| |-----------------------------------------------------------| `-----------' |-----------| 7D|
|
||||
| 31| 33| | 77 | 4D| 4E| 4F| 50| 51| 52| 53| 54| 55| 56| 57| 59 | | 5B| 5C| 5D| |
|
||||
|-------| |-----------------------------------------------------------| ,---. |-----------|---|
|
||||
| 48| 49| | 63 | 64| 65| 66| 67| 68| 69| 6A| 6B| 6C| 6D| 6E | | 14| | 70| 71| 72| |
|
||||
|-------| |-----------------------------------------------------------| .-----------. |-----------| 5A|
|
||||
| 5F| 61| | 4C | 13| 78 | 79 | 7A | 43| 0D| | 18| 1B| 1C| | 5E | 32| |
|
||||
`-------' `-----------------------------------------------------------' `-----------' `---------------'
|
||||
*/
|
||||
#define LAYOUT_ansi( \
|
||||
K76, K1D, K05,K06,K08,K0A, K0C,K0E,K10,K11, K12,K07,K09,K0B, K16,K17,K15, K2D,K02,K04,K30, \
|
||||
K01,K03, K2A,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K28,K29, K2B, K2C,K34,K60, K62,K2E,K2F,K47, \
|
||||
K19,K1A, K35, K36,K37,K38,K39,K3A,K3B,K3C,K3D,K3E,K3F,K40,K41, K58, K42,K4A,K7B, K44,K45,K46,K7D, \
|
||||
K31,K33, K77, K4D,K4E,K4F,K50,K51,K52,K53,K54,K55,K56,K57, K59, K5B,K5C,K5D, \
|
||||
K48,K49, K63, K64,K65,K66,K67,K68,K69,K6A,K6B,K6C,K6D, K6E, K14, K70,K71,K72,K5A, \
|
||||
K5F,K61, K4C,K13, K78, K79, K7A, K43, K0D, K18,K1B,K1C, K5E, K32 \
|
||||
) { \
|
||||
{ KC_NO, K01 , K02 , K03 , K04 , K05 , K06 , K07 }, \
|
||||
{ K08 , K09 , K0A , K0B , K0C , K0D , K0E , KC_NO,}, \
|
||||
{ K10 , K11 , K12 , K13 , K14 , K15 , K16 , K17 }, \
|
||||
{ K18 , K19 , K1A , K1B , K1C , K1D , K1E , K1F }, \
|
||||
{ K20 , K21 , K22 , K23 , K24 , K25 , K26 , K27 }, \
|
||||
{ K28 , K29 , K2A , K2B , K2C , K2D , K2E , K2F }, \
|
||||
{ K30 , K31 , K32 , K33 , K34 , K35 , K36 , K37 }, \
|
||||
{ K38 , K39 , K3A , K3B , K3C , K3D , K3E , K3F }, \
|
||||
{ K40 , K41 , K42 , K43 , K44 , K45 , K46 , K47 }, \
|
||||
{ K48 , K49 , K4A , KC_NO, K4C , K4D , K4E , K4F }, \
|
||||
{ K50 , K51 , K52 , K53 , K54 , K55 , K56 , K57 }, \
|
||||
{ K58 , K59 , K5A , K5B , K5C , K5D , K5E , K5F }, \
|
||||
{ K60 , K61 , K62 , K63 , K64 , K65 , K66 , K67 }, \
|
||||
{ K68 , K69 , K6A , K6B , K6C , K6D , K6E , KC_NO }, \
|
||||
{ K70 , K71 , K72 , KC_NO, KC_NO, KC_NO, K76 , K77 }, \
|
||||
{ K78 , K79 , K7A , K7B , KC_NO, K7D , KC_NO, KC_NO } \
|
||||
}
|
||||
#endif
|
@@ -34,10 +34,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
// #define TAPPING_FORCE_HOLD
|
||||
// #define TAPPING_TERM 100
|
||||
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
#undef RGBLED_NUM
|
||||
#define RGBLIGHT_ANIMATIONS
|
||||
#define RGBLED_NUM 27
|
||||
|
||||
#define RGBLIGHT_HUE_STEP 8
|
||||
#define RGBLIGHT_SAT_STEP 8
|
||||
#define RGBLIGHT_VAL_STEP 8
|
||||
#define RGBLIGHT_LIMIT_VAL 120
|
||||
#define RGBLIGHT_HUE_STEP 10
|
||||
#define RGBLIGHT_SAT_STEP 17
|
||||
#define RGBLIGHT_VAL_STEP 17
|
||||
#endif
|
||||
|
@@ -20,37 +20,48 @@ enum crkbd_keycodes {
|
||||
RGBRST = NEW_SAFE_RANGE
|
||||
};
|
||||
|
||||
#define LAYOUT_crkbd_base( \
|
||||
K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \
|
||||
K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \
|
||||
K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A \
|
||||
) \
|
||||
LAYOUT_wrapper( \
|
||||
KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_BSPC, \
|
||||
KC_TAB, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_QUOT, \
|
||||
KC_MLSF, CTL_T(K21), K22, K23, K24, K25, K26, K27, K28, K29, CTL_T(K2A), KC_MRSF, \
|
||||
LT(_LOWER,KC_GRV), KC_SPC, KC_BSPC, KC_DEL, KC_ENT, RAISE \
|
||||
)
|
||||
#define LAYOUT_crkbd_base_wrapper(...) LAYOUT_crkbd_base(__VA_ARGS__)
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[_QWERTY] = LAYOUT_wrapper(
|
||||
KC_ESC, _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, KC_BSPC,
|
||||
KC_TAB, _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, KC_QUOT,
|
||||
KC_MLSF, _________________QWERTY_L3_________________, _________________QWERTY_R3_________________, KC_MRSF,
|
||||
LT(_LOWER,KC_GRV), KC_SPC, KC_BSPC, KC_DEL, KC_ENT, RAISE
|
||||
[_QWERTY] = LAYOUT_crkbd_base_wrapper(
|
||||
_________________QWERTY_L1_________________, _________________QWERTY_R1_________________,
|
||||
_________________QWERTY_L2_________________, _________________QWERTY_R2_________________,
|
||||
_________________QWERTY_L3_________________, _________________QWERTY_R3_________________
|
||||
),
|
||||
[_COLEMAK] = LAYOUT_wrapper(
|
||||
KC_ESC, _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, KC_BSPC,
|
||||
KC_TAB, _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, KC_QUOT,
|
||||
KC_MLSF, _________________QWERTY_L3_________________, _________________QWERTY_R3_________________, KC_MRSF,
|
||||
LT(_LOWER,KC_GRV), KC_SPC, KC_BSPC, KC_DEL, KC_ENT, RAISE
|
||||
|
||||
[_COLEMAK] = LAYOUT_crkbd_base_wrapper(
|
||||
_________________COLEMAK_L1________________, _________________COLEMAK_R1________________,
|
||||
_________________COLEMAK_L2________________, _________________COLEMAK_R2________________,
|
||||
_________________COLEMAK_L3________________, _________________COLEMAK_R3________________
|
||||
),
|
||||
[_DVORAK] = LAYOUT_wrapper(
|
||||
KC_ESC, _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, KC_BSPC,
|
||||
KC_TAB, _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, KC_QUOT,
|
||||
KC_MLSF, _________________QWERTY_L3_________________, _________________QWERTY_R3_________________, KC_MRSF,
|
||||
LT(_LOWER,KC_GRV), KC_SPC, KC_BSPC, KC_DEL, KC_ENT, RAISE
|
||||
|
||||
[_DVORAK] = LAYOUT_crkbd_base_wrapper(
|
||||
_________________DVORAK_L1_________________, _________________DVORAK_R1_________________,
|
||||
_________________DVORAK_L2_________________, _________________DVORAK_R2_________________,
|
||||
_________________DVORAK_L3_________________, _________________DVORAK_R3_________________
|
||||
),
|
||||
[_WORKMAN] = LAYOUT_wrapper(
|
||||
KC_ESC, _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, KC_BSPC,
|
||||
KC_TAB, _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, KC_QUOT,
|
||||
KC_MLSF, _________________QWERTY_L3_________________, _________________QWERTY_R3_________________, KC_MRSF,
|
||||
LT(_LOWER,KC_GRV), KC_SPC, KC_BSPC, KC_DEL, KC_ENT, RAISE
|
||||
|
||||
[_WORKMAN] = LAYOUT_crkbd_base_wrapper(
|
||||
_________________WORKMAN_L1________________, _________________WORKMAN_R1________________,
|
||||
_________________WORKMAN_L2________________, _________________WORKMAN_R2________________,
|
||||
_________________WORKMAN_L3________________, _________________WORKMAN_R3________________
|
||||
),
|
||||
|
||||
[_MODS] = LAYOUT_wrapper(
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
KC_LSFT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_RSFT,
|
||||
_______, ___________________BLANK___________________, ___________________BLANK___________________, _______,
|
||||
_______, ___________________BLANK___________________, ___________________BLANK___________________, _______,
|
||||
KC_LSFT, ___________________BLANK___________________, ___________________BLANK___________________, KC_RSFT,
|
||||
_______, _______, _______, _______, _______, _______
|
||||
),
|
||||
|
||||
@@ -65,7 +76,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
KC_GRV, _________________RAISE_L1__________________, _________________RAISE_R1__________________, KC_BSPC,
|
||||
_______, _________________RAISE_L2__________________, _________________RAISE_R2__________________, KC_BSLS,
|
||||
_______, _________________RAISE_L3__________________, _________________RAISE_R3__________________, _______,
|
||||
_______, _______, _______, _______, _______, _______ //`--------------------' `--------------------'
|
||||
_______, _______, _______, _______, _______, _______
|
||||
),
|
||||
|
||||
[_ADJUST] = LAYOUT_wrapper( \
|
||||
|
18
keyboards/dz60/keymaps/60_ansi/keymap.c
Normal file
18
keyboards/dz60/keymaps/60_ansi/keymap.c
Normal file
@@ -0,0 +1,18 @@
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
LAYOUT_60_ansi(
|
||||
KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC,
|
||||
KC_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_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
|
||||
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(1), KC_RCTL),
|
||||
|
||||
LAYOUT_60_ansi(
|
||||
KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL,
|
||||
KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, RESET,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_INS, KC_HOME, KC_PGUP, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, BL_DEC, BL_TOGG, BL_INC, BL_STEP, KC_TRNS, KC_DEL, KC_END, KC_PGDN, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS)
|
||||
};
|
9
keyboards/dz60/keymaps/60_ansi/readme.md
Normal file
9
keyboards/dz60/keymaps/60_ansi/readme.md
Normal file
@@ -0,0 +1,9 @@
|
||||

|
||||
|
||||

|
||||
|
||||
# 60_ansi DZ60 Layout
|
||||
|
||||
This is a basic keymap for the 60_ansi layout of the DZ60.
|
||||
The default layer is normal ANSI and the Fn layer is used for RGB
|
||||
and backlighting functions.
|
52
keyboards/dz60/keymaps/boris_burger/README.md
Normal file
52
keyboards/dz60/keymaps/boris_burger/README.md
Normal file
@@ -0,0 +1,52 @@
|
||||
### boris_burger's DZ60 layout
|
||||
|
||||
This layout is for a DZ60 with a 2U left shift, 1U right shift and an arrow cluster in
|
||||
the bottom right.
|
||||
|
||||
It is based off stephengrier's layout adding support for Home/End/PgUp/PgDn using Fn+arrows
|
||||
as used on macOS and Microsoft Surface. It has Insert instead of Fn near the arrow cluster
|
||||
and other smaller tweaks:
|
||||
- CapsLock is the only Fn key (CapsLock by itself is not available)
|
||||
- Del is available as Fn+Backspace
|
||||
- Ctrl+Del is available as Ctrl+Backspace (e.g. deleting word to the right of the cursor)
|
||||
- Shift+Del is available as Shift+Backspace (e.g. permanently deleting file or e-mail)
|
||||
- PgUp = Fn+Up
|
||||
- PgDn = Fn+Down
|
||||
- Home = Fn+Left
|
||||
- End = Fn+Right
|
||||
- Tilde = Shift+Esc
|
||||
- Backtick = Fn+Esc
|
||||
- Underglow toggle and mode selection are available as Fn+Q and Fn+W
|
||||
- Reset (bootloader mode) = Fn+B
|
||||
|
||||
### 0 Qwerty
|
||||
```
|
||||
,-----------------------------------------------------------------------------------------.
|
||||
| Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Bkspc |
|
||||
|-----------------------------------------------------------------------------------------+
|
||||
| Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ |
|
||||
|-----------------------------------------------------------------------------------------+
|
||||
| Fn | A | S | D | F | G | H | J | K | L | ; | ' | Enter |
|
||||
|-----------------------------------------------------------------------------------------+
|
||||
| Shift | Z | X | C | V | B | N | M | , | . | / | RSh | U | Ins |
|
||||
|-----------------------------------------------------------------------------------------+
|
||||
| Ctrl | Win | Alt | Space | Alt | Menu | L | D | R |
|
||||
`-----------------------------------------------------------------------------------------'
|
||||
```
|
||||
|
||||
### 1 Fn Layer
|
||||
```
|
||||
FN Layer
|
||||
,-----------------------------------------------------------------------------------------.
|
||||
| ` | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | DEL |
|
||||
|-----------------------------------------------------------------------------------------+
|
||||
| |RBB T|RGB M| Hue+| Hue-| Sat+| Sat-| Val+| Val-| | | | | |
|
||||
|-----------------------------------------------------------------------------------------+
|
||||
| | BL T| BL M| BL+ | BL- | | | | | | | | |
|
||||
|-----------------------------------------------------------------------------------------+
|
||||
| | | | | |RESET| | | | | | | PgUp| |
|
||||
|-----------------------------------------------------------------------------------------+
|
||||
| | | | | | | Home| PgDn| End |
|
||||
`-----------------------------------------------------------------------------------------'
|
||||
```
|
||||
|
1
keyboards/dz60/keymaps/boris_burger/config.h
Normal file
1
keyboards/dz60/keymaps/boris_burger/config.h
Normal file
@@ -0,0 +1 @@
|
||||
#define GRAVE_ESC_GUI_OVERRIDE # Always send Escape if GUI is pressed
|
87
keyboards/dz60/keymaps/boris_burger/keymap.c
Normal file
87
keyboards/dz60/keymaps/boris_burger/keymap.c
Normal file
@@ -0,0 +1,87 @@
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
/* Holds state of modifiers when Backspace was pressed.
|
||||
* Used to ensure that the correct keycode is unregistered when Backspace is released.
|
||||
*/
|
||||
static uint8_t bspc_mods = 0;
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
/* Qwerty
|
||||
* ,-----------------------------------------------------------------------------------------.
|
||||
* | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Bkspc |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | Fn | A | S | D | F | G | H | J | K | L | ; | ' | Enter |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | Shift | Z | X | C | V | B | N | M | , | . | / | RSh | U | Ins |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | Ctrl | Win | Alt | Space | Alt | Menu | L | D | R |
|
||||
* `-----------------------------------------------------------------------------------------'
|
||||
*/
|
||||
LAYOUT_directional(
|
||||
KC_GESC, KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_MINS, KC_EQL , _______, KC_BSPC,
|
||||
KC_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,
|
||||
MO(1) , KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN, KC_QUOT, KC_ENT ,
|
||||
KC_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_INS ,
|
||||
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC , KC_SPC , KC_SPC , KC_RALT, KC_RGUI, KC_LEFT, KC_DOWN, KC_RIGHT
|
||||
),
|
||||
|
||||
/* FN Layer
|
||||
* ,-----------------------------------------------------------------------------------------.
|
||||
* | ` | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | DEL |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | |RBB T|RGB M| Hue+| Hue-| Sat+| Sat-| Val+| Val-| | | | | |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | | BL T| BL M| BL+ | BL- | | | | | | | | |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | | | | | |RESET| | | | | | | PgUp| |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | | | | | | | Home| PgDn| End |
|
||||
* `-----------------------------------------------------------------------------------------'
|
||||
*/
|
||||
LAYOUT_directional(
|
||||
KC_GRV , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 , KC_F12 , _______, KC_DEL ,
|
||||
_______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______,
|
||||
_______, BL_TOGG, BL_STEP, BL_INC , BL_DEC , _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, RESET , _______, _______, _______, _______, _______, _______, KC_PGUP, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END
|
||||
),
|
||||
};
|
||||
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
switch(keycode) {
|
||||
case KC_BSPC: {
|
||||
if (record->event.pressed) {
|
||||
const uint8_t current_mods = get_mods();
|
||||
const uint8_t shift = current_mods & (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT));
|
||||
const uint8_t ctrl = current_mods & (MOD_BIT(KC_LCTL)|MOD_BIT(KC_RCTL));
|
||||
bspc_mods = current_mods;
|
||||
if(shift || ctrl) {
|
||||
add_key(KC_DEL);
|
||||
add_mods(current_mods);
|
||||
send_keyboard_report();
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(bspc_mods & (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)|MOD_BIT(KC_LCTL)|MOD_BIT(KC_RCTL))) {
|
||||
// if Shift or Ctrl was pressed with Backspace, than that was intepreted as Del, so we need
|
||||
// to unregister the Del key
|
||||
del_key(KC_DEL);
|
||||
} else {
|
||||
// Either Backspace was pressed without mods, or with a modifier other than Shift or Ctrl
|
||||
// so it is simply taken as Backspace
|
||||
del_key(KC_BSPC);
|
||||
}
|
||||
send_keyboard_report();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
}
|
70
keyboards/dz60/keymaps/crd/keymap.c
Normal file
70
keyboards/dz60/keymaps/crd/keymap.c
Normal file
@@ -0,0 +1,70 @@
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
/* Qwerty
|
||||
* ,-----------------------------------------------------------------------------------------.
|
||||
* | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Bkspc |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | Ctrl/Esc| A | S | D | F | G | H | J | K | L | ; | ' | Enter |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | Shift | Z | X | C | V | B | N | M | , | . | / | RSh | U | DEL |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | FN1 | Alt | Cmd | Space | Cmd | FN2 | L | D | R |
|
||||
* `-----------------------------------------------------------------------------------------'
|
||||
*/
|
||||
|
||||
LAYOUT_directional(
|
||||
KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, _______, KC_BSPC,
|
||||
KC_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,
|
||||
CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
|
||||
KC_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_DEL,
|
||||
MO(1), KC_LALT, KC_LGUI, KC_SPC, KC_SPC, KC_SPC, KC_RGUI, MO(2), KC_LEFT, KC_DOWN, KC_RIGHT
|
||||
),
|
||||
|
||||
/* FN1 Layer
|
||||
* ,-----------------------------------------------------------------------------------------.
|
||||
* | ` ~ | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | | | | | | | | | | | | | | |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | | | | | | | L | D | U | R | | | |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | | | | | | | | | | | | |PgUp | |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | | | | | | |Home |PgDn | End |
|
||||
* `-----------------------------------------------------------------------------------------'
|
||||
*/
|
||||
|
||||
LAYOUT_directional(
|
||||
KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PGUP, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDOWN, KC_END
|
||||
),
|
||||
|
||||
/* FN2 Layer (Media)
|
||||
* ,-----------------------------------------------------------------------------------------.
|
||||
* | | | | | | | | | | | | | | RESET |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | |RBB T|RGB M| Hue+| Hue-| Sat+| Sat-| Val+| Val-| | | | | |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | | | | | | | | | | | | | |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | | | | | | | | | | | |Pl/Ps|Vol+ |Mute |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | | | | | | |Prev |Vol- |Next |
|
||||
* `-----------------------------------------------------------------------------------------'
|
||||
*/
|
||||
|
||||
LAYOUT_directional(
|
||||
KC_SLEP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET,
|
||||
_______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, KC_VOLU, KC_MUTE,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_MNXT
|
||||
),
|
||||
};
|
@@ -1,71 +1,553 @@
|
||||
#include QMK_KEYBOARD_H
|
||||
#include "keymap.h"
|
||||
|
||||
enum marianas_layers {
|
||||
BASE,
|
||||
QWERTY,
|
||||
/*
|
||||
COLEMAK,
|
||||
DVORAK,
|
||||
*/
|
||||
NAV_CLUSTER,
|
||||
RGB,
|
||||
MOUSE,
|
||||
GAMING,
|
||||
FN_LAYER,
|
||||
LAYER_SEL
|
||||
SQLMACROS,
|
||||
SQLNAMES,
|
||||
FN_LAYER
|
||||
};
|
||||
|
||||
enum sql_macros {
|
||||
S_LFTJN = SAFE_RANGE, // L
|
||||
S_INRJN, // I
|
||||
S_SLCT, // S
|
||||
S_FROM, // F
|
||||
S_DSNCT, // D
|
||||
S_ORDER, // O
|
||||
S_WHERE, // W
|
||||
S_ALTER, // Esc
|
||||
S_ASTRK, // *
|
||||
|
||||
TD_A,
|
||||
TD_B,
|
||||
TD_C, // Corp, Corporation, Company
|
||||
TD_D, // Distribution, Dist, Distributor
|
||||
TD_E,
|
||||
TD_F,
|
||||
TD_G, // GlobalLookup
|
||||
TD_H,
|
||||
TD_I, // Instance, Item
|
||||
TD_J,
|
||||
TD_K,
|
||||
TD_L,
|
||||
TD_M,
|
||||
TD_N, // NadRate
|
||||
TD_O,
|
||||
TD_P, // Product, Person,
|
||||
TD_Q, // Darden
|
||||
TD_R,
|
||||
TD_S, // Supplier, Step
|
||||
TD_T, // Task, Type
|
||||
TD_U,
|
||||
TD_V,
|
||||
TD_W, // Workflow,
|
||||
TD_X,
|
||||
TD_Y,
|
||||
TD_Z,
|
||||
TD_BSPC,
|
||||
TD_ENT,
|
||||
TD_ESC
|
||||
};
|
||||
|
||||
uint16_t *macroTaps = 0;
|
||||
|
||||
char *tableNameList = 0;
|
||||
|
||||
uint8_t *charCount = 0;
|
||||
uint8_t countPointer = 0;
|
||||
|
||||
bool shifted = false;
|
||||
|
||||
bool sendAbbr = false;
|
||||
|
||||
|
||||
void initStringData(void)
|
||||
{
|
||||
if (macroTaps == 0)
|
||||
{
|
||||
macroTaps = malloc(macroTapsLen*sizeof(uint16_t));
|
||||
for(int i = 0; i < macroTapsLen; i++)
|
||||
{
|
||||
macroTaps[i] = 0;
|
||||
}
|
||||
}
|
||||
if (tableNameList == 0)
|
||||
{
|
||||
tableNameList = malloc(tableNameListLen*sizeof(char));
|
||||
for(int i = 0; i < tableNameListLen; i++)
|
||||
{
|
||||
tableNameList[i] = 0;
|
||||
}
|
||||
}
|
||||
if (charCount == 0)
|
||||
{
|
||||
charCount = malloc(charCountLen*sizeof(uint8_t));
|
||||
for (int i = 0; i < charCountLen; i++)
|
||||
{
|
||||
charCount[i] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
uint32_t layer_state_set_user(uint32_t state)
|
||||
{
|
||||
switch (biton32(state))
|
||||
{
|
||||
case QWERTY:
|
||||
rgblight_mode(9);
|
||||
break;
|
||||
case NAV_CLUSTER:
|
||||
rgblight_mode(29);
|
||||
break;
|
||||
case GAMING:
|
||||
rgblight_mode(26);
|
||||
break;
|
||||
case SQLMACROS:
|
||||
rgblight_mode(1);
|
||||
rgblight_setrgb(0x00, 0xFF, 0x80);
|
||||
break;
|
||||
case SQLNAMES:
|
||||
rgblight_mode(1);
|
||||
rgblight_setrgb(0x80, 0xFF, 0x00);
|
||||
break;
|
||||
case FN_LAYER:
|
||||
rgblight_mode(1);
|
||||
rgblight_setrgb(0x00, 0x80, 0xFF);
|
||||
break;
|
||||
}
|
||||
return state;
|
||||
}
|
||||
|
||||
bool containsCode(uint16_t kc)
|
||||
{
|
||||
for (int i = 0; i < macroTapsLen && macroTaps[i] > 0; i++)
|
||||
{
|
||||
if (macroTaps[i] == kc) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool lastCodeIs(uint16_t kc)
|
||||
{
|
||||
for (int i = 0; i < macroTapsLen-1 && macroTaps[i] > 0; i++)
|
||||
{
|
||||
if (macroTaps[i] == kc && macroTaps[i+1] == 0) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool last2CodeAre(uint16_t kc)
|
||||
{
|
||||
for (int i = 0; i < macroTapsLen-2 && macroTaps[i] > 0; i++)
|
||||
{
|
||||
if (macroTaps[i] == kc && macroTaps[i+1] == kc && macroTaps[i+2] == 0) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool last2CodesAre(uint16_t kc, uint16_t kc2)
|
||||
{
|
||||
for (int i = 0; i < macroTapsLen-2 && macroTaps[i] > 0; i++)
|
||||
{
|
||||
if (macroTaps[i] == kc && macroTaps[i+1] == kc2 && macroTaps[i+2] == 0) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void addKeyCode(uint16_t kc)
|
||||
{
|
||||
int i = 0;
|
||||
while (i < macroTapsLen-2 && macroTaps[i] > 0) i++;
|
||||
if (macroTaps[i] == 0)
|
||||
{
|
||||
macroTaps[i] = kc;
|
||||
macroTaps[i+1] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void eraseKeyCodes(void)
|
||||
{
|
||||
int i = 0;
|
||||
while (i < macroTapsLen && macroTaps[i] > 0) macroTaps[i++] = 0;
|
||||
}
|
||||
|
||||
void eraseCharCounts(void)
|
||||
{
|
||||
int i = 0;
|
||||
while (i < charCountLen)
|
||||
{
|
||||
charCount[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void printTableAbbreviation(void)
|
||||
{
|
||||
initStringData();
|
||||
if (tableNameList[0] == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
send_char(0x20);
|
||||
int i = 0;
|
||||
for (i = 0; i < tableNameListLen && tableNameList[i] > 0; i++)
|
||||
{
|
||||
if (tableNameList[i] >= 65 && tableNameList[i] <= 90)
|
||||
{
|
||||
send_char(tableNameList[i]+32);
|
||||
}
|
||||
else
|
||||
{
|
||||
send_char(tableNameList[i]);
|
||||
}
|
||||
}
|
||||
send_char(0x20);
|
||||
}
|
||||
|
||||
void eraseTableAbbreviation(void)
|
||||
{
|
||||
initStringData();
|
||||
for (int i = 0; i < tableNameListLen && tableNameList[i] > 0; i++)
|
||||
{
|
||||
tableNameList[i] = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
void printString(char* str)
|
||||
{
|
||||
|
||||
if (str[0] != '\0')
|
||||
{
|
||||
int i = 0;
|
||||
while (true)
|
||||
{
|
||||
if (str[i] == 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
send_char(str[i++]);
|
||||
charCount[countPointer]++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void printStringAndQueueChar(char* str)
|
||||
{
|
||||
initStringData();
|
||||
if (charCount[countPointer] != 0)
|
||||
{
|
||||
countPointer++;
|
||||
}
|
||||
sendAbbr = true;
|
||||
if (str[0] != '\0')
|
||||
{
|
||||
printString(str);
|
||||
|
||||
for (int i = 0; i < tableNameListLen-1; i++)
|
||||
{
|
||||
if (tableNameList[i] == '\0')
|
||||
{
|
||||
tableNameList[i] = str[0];
|
||||
tableNameList[i+1] = '\0';
|
||||
break;
|
||||
}
|
||||
else if (i == tableNameListLen-2)
|
||||
{
|
||||
printTableAbbreviation();
|
||||
break;
|
||||
}
|
||||
}
|
||||
//for (i = 0; i < tableNameListLen && tableNameList[i] > 0; i++)
|
||||
//{
|
||||
// send_char(tableNameList[i]);
|
||||
//}
|
||||
//send_string_P("Darden");
|
||||
//send_string_P(&myarray);
|
||||
//send_string_P(str);
|
||||
}
|
||||
}
|
||||
|
||||
void ReplaceString(char *orig, char *repl)
|
||||
{
|
||||
int i = 0;
|
||||
while((orig[i] != 0x0 && repl[i] != 0x0) && orig[i] == repl[i])
|
||||
i++;
|
||||
|
||||
if(orig[i] != 0x0)
|
||||
{
|
||||
int o = i;
|
||||
while (orig[o++] != 0x0) {
|
||||
charCount[countPointer]--;
|
||||
register_code(KC_BSPC);
|
||||
unregister_code(KC_BSPC);
|
||||
}
|
||||
}
|
||||
printString(repl+i);
|
||||
}
|
||||
|
||||
void deletePrev(void)
|
||||
{
|
||||
for (int i = 0; i < charCount[countPointer]; i++)
|
||||
{
|
||||
register_code(KC_BSPC);
|
||||
unregister_code(KC_BSPC);
|
||||
}
|
||||
charCount[countPointer] = 0;
|
||||
countPointer--;
|
||||
int i = 1;
|
||||
for (;i < tableNameListLen-1; i++)
|
||||
{
|
||||
if (tableNameList[i] == 0x0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
tableNameList[i-1] = 0x0;
|
||||
}
|
||||
|
||||
void processSmartMacroTap(uint16_t kc)
|
||||
{
|
||||
initStringData();
|
||||
switch(kc)
|
||||
{
|
||||
case TD_C:
|
||||
if (containsCode(TD_D))
|
||||
{
|
||||
printString("ribution");
|
||||
printStringAndQueueChar("Center");
|
||||
}
|
||||
else if (last2CodeAre(TD_C))
|
||||
{
|
||||
ReplaceString("Corporation", "Contact");
|
||||
}
|
||||
else if(lastCodeIs(TD_C))
|
||||
{
|
||||
printString("oration");
|
||||
}
|
||||
else
|
||||
{
|
||||
printStringAndQueueChar("Corp");
|
||||
}
|
||||
break;
|
||||
case TD_D:
|
||||
if (last2CodeAre(TD_D))
|
||||
{
|
||||
ReplaceString("Distribution", "Distributor");
|
||||
}
|
||||
else if(lastCodeIs(TD_D))
|
||||
{
|
||||
printString("ribution");
|
||||
}
|
||||
else
|
||||
{
|
||||
printStringAndQueueChar("Dist");
|
||||
}
|
||||
break;
|
||||
case TD_G:
|
||||
printStringAndQueueChar("Global");
|
||||
printStringAndQueueChar("Lookup");
|
||||
break;
|
||||
case TD_I:
|
||||
if (containsCode(TD_W))
|
||||
printStringAndQueueChar("Instance");
|
||||
else
|
||||
printStringAndQueueChar("Item");
|
||||
break;
|
||||
case TD_N:
|
||||
printStringAndQueueChar("NadRate");
|
||||
break;
|
||||
case TD_P:
|
||||
if (last2CodesAre(TD_D, TD_C))
|
||||
{
|
||||
ReplaceString("DistributionCenter", "DistCenter");
|
||||
printStringAndQueueChar("Pricing");
|
||||
}
|
||||
else if (last2CodeAre(TD_P))
|
||||
{
|
||||
}
|
||||
else if(lastCodeIs(TD_P))
|
||||
{
|
||||
ReplaceString("Product", "Person");
|
||||
}
|
||||
else
|
||||
{
|
||||
printStringAndQueueChar("Product");
|
||||
}
|
||||
break;
|
||||
case TD_Q:
|
||||
printStringAndQueueChar("Darden");
|
||||
break;
|
||||
case TD_S:
|
||||
if (containsCode(TD_W))
|
||||
if (containsCode(TD_S) || containsCode(TD_D))
|
||||
printStringAndQueueChar("Step");
|
||||
else
|
||||
printStringAndQueueChar("Session");
|
||||
else
|
||||
printStringAndQueueChar("Supplier");
|
||||
break;
|
||||
case TD_T:
|
||||
if (containsCode(TD_W))
|
||||
printStringAndQueueChar("Task");
|
||||
else
|
||||
printStringAndQueueChar("Type");
|
||||
break;
|
||||
case TD_W:
|
||||
printStringAndQueueChar("Workflow");
|
||||
break;
|
||||
}
|
||||
addKeyCode(kc);
|
||||
}
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record)
|
||||
{
|
||||
if (record->event.pressed)
|
||||
{
|
||||
switch (keycode)
|
||||
{
|
||||
case KC_LSPO:
|
||||
case KC_RSPC:
|
||||
shifted = true;
|
||||
return true;
|
||||
|
||||
case S_LFTJN: SEND_STRING("LEFT JOIN"); return false;
|
||||
case S_INRJN: SEND_STRING("INNER JOIN "); return false;
|
||||
case S_SLCT: SEND_STRING("SELECT "); return false;
|
||||
case S_FROM: SEND_STRING("FROM "); return false;
|
||||
case S_DSNCT: SEND_STRING("DISTINCT "); return false;
|
||||
case S_ORDER: SEND_STRING("ORDER "); return false;
|
||||
case S_WHERE: SEND_STRING("WHERE "); return false;
|
||||
case S_ALTER: SEND_STRING("ALTER SESSION SET CURRENT_SCHEMA = "); return false;
|
||||
case S_ASTRK: SEND_STRING("* "); return false;
|
||||
|
||||
case KC_BSLS:
|
||||
initStringData();
|
||||
layer_on(SQLNAMES);
|
||||
return false;
|
||||
|
||||
case TD_BSPC:
|
||||
if (!shifted){
|
||||
deletePrev();
|
||||
}
|
||||
else {
|
||||
register_code(KC_BSPC);
|
||||
unregister_code(KC_BSPC);
|
||||
}
|
||||
return false;
|
||||
|
||||
case TD_A:
|
||||
case TD_B:
|
||||
case TD_C:
|
||||
case TD_D:
|
||||
case TD_E:
|
||||
case TD_F:
|
||||
case TD_G:
|
||||
case TD_H:
|
||||
case TD_I:
|
||||
case TD_J:
|
||||
case TD_K:
|
||||
case TD_L:
|
||||
case TD_M:
|
||||
case TD_N:
|
||||
case TD_O:
|
||||
case TD_P:
|
||||
case TD_Q:
|
||||
case TD_R:
|
||||
case TD_S:
|
||||
case TD_T:
|
||||
case TD_U:
|
||||
case TD_V:
|
||||
case TD_W:
|
||||
case TD_X:
|
||||
case TD_Y:
|
||||
case TD_Z:
|
||||
processSmartMacroTap(keycode);
|
||||
return false;
|
||||
|
||||
case TD_ENT:
|
||||
printTableAbbreviation();
|
||||
case TD_ESC:
|
||||
eraseKeyCodes();
|
||||
eraseTableAbbreviation();
|
||||
layer_off(SQLNAMES);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (keycode)
|
||||
{
|
||||
|
||||
case KC_BSLS:
|
||||
if (macroTaps[0] == 0)
|
||||
{
|
||||
SEND_STRING("\\");
|
||||
layer_off(SQLNAMES);
|
||||
}
|
||||
return true;
|
||||
case KC_LSPO:
|
||||
case KC_RSPC:
|
||||
shifted = false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
[BASE]=
|
||||
LAYOUT(
|
||||
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_NO, 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_BSLS,
|
||||
MO(FN_LAYER), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
|
||||
KC_LSPO, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, KC_NO,
|
||||
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, KC_LGUI, KC_NO, KC_APP, KC_RCTL),
|
||||
[QWERTY]=
|
||||
LAYOUT_60_ansi(
|
||||
ESCAP, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, MNUS, EQUL, BACKSPC,
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, LBRC, RBRC, BSLASH,
|
||||
MO_FNLR, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, COLN, QUOT, ENTER_OR_SQL,
|
||||
LEFTSHFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, CMMA, PRRD, SLSH, RIGHT_SHIFT__PAREN,
|
||||
CTLL, WINL, ALTL, SPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACE, ALTR, WINR, APPR, CTLR),
|
||||
|
||||
[NAV_CLUSTER]=
|
||||
LAYOUT(
|
||||
KC_TRNS, KC_PSCREEN, KC_SCROLLLOCK, KC_PAUSE, KC_INSERT, KC_HOME, KC_PGUP, KC_NUMLOCK, KC_KP_SLASH, KC_KP_ASTERISK, KC_KP_MINUS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_DELETE, KC_END, KC_PGDOWN, KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_PLUS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_UP, KC_UP, KC_KP_4, KC_KP_5, KC_KP_6, KC_KP_PLUS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, KC_KP_1, KC_KP_2, KC_KP_3, KC_KP_ENTER, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_KP_0, KC_KP_0, KC_KP_0, KC_KP_DOT, KC_KP_ENTER, KC_TRNS, KC_TRNS, KC_TRNS),
|
||||
|
||||
[RGB]=
|
||||
LAYOUT(
|
||||
KC_TRNS, RGB_TOG, RGB_MOD, RGB_M_P, RGB_M_B, RGB_M_R, RGB_M_SW, RGB_M_SN, RGB_M_K, RGB_M_X, RGB_M_G, RGB_SPD, RGB_SPI, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, RGB_HUI, RGB_HUD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, RGB_SAI, RGB_SAD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, RGB_VAI, RGB_VAD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
|
||||
|
||||
[MOUSE]=
|
||||
LAYOUT(
|
||||
KC_TRNS, KC_ACL0, KC_ACL1, KC_ACL2, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_WH_U, KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN3, KC_BTN1, KC_MS_U, KC_BTN2, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_WH_L, KC_WH_D, KC_WH_R, KC_TRNS, KC_TRNS, KC_BTN4, KC_MS_L, KC_MS_D, KC_MS_R, KC_BTN5, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
|
||||
LAYOUT_60_ansi(
|
||||
_____, PSCR, SCRL, PAUS, NSRT, HOME, PGUP, NMLK, KSSH, STAR, KMIN, ____, ____, ______,
|
||||
______, ____, ____, ____, DELT, END_, PGDN, KP_7, KP_8, KP_9, PLUS, ____, ____, _____,
|
||||
_______, ____, ____, ____, ____, UPUP, UPUP, KP_4, KP_5, KP_6, PLUS, ____, ___________,
|
||||
________, ____, ____, ____, LEFT, D_WN, RGHT, KP_1, KP_2, KP_3, KNTR, _________________,
|
||||
____, ____, ____, /*-----------------*/KC_KP_0/*-----------------*/, KDOT, KNTR, ____, ____),
|
||||
|
||||
[GAMING]=
|
||||
LAYOUT(
|
||||
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_NO, 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_BSLS,
|
||||
KC_TRNS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
|
||||
KC_LSHIFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSHIFT, KC_NO,
|
||||
KC_LCTL, KC_NO, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, KC_RCTL, KC_NO, KC_NO, TO(BASE)),
|
||||
LAYOUT_60_ansi(
|
||||
_____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ______,
|
||||
______, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, _____,
|
||||
KCNO, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ___________,
|
||||
________, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, _________________,
|
||||
____, KCNO, ____, /*------------------*/_____/*------------------*/, ____, KCNO, ____, QWRTY),
|
||||
|
||||
[SQLMACROS]=
|
||||
LAYOUT_60_ansi(
|
||||
S_ALTER, ____, ____, ____, ____, ____, ____, ____, S_ASTRK, ____, ____, ____, ____, ___________,
|
||||
______, ____, S_WHERE, ____, ____, ____, ____, ____, S_INRJN, S_ORDER, ____, ____, ____, ______,
|
||||
_______, KC_LBRC, S_SLCT, KC_PAST,S_FROM, ____, ____, ____, ____, S_LFTJN, ____, RBRC, ___________,
|
||||
________, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, _________________,
|
||||
____, ____, ____, /*------------------*/_____/*------------------*/, ____, ____, ____, ____),
|
||||
|
||||
[SQLNAMES]=
|
||||
LAYOUT_60_ansi(
|
||||
TD_ESC, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, TD_BSPC,
|
||||
________, TD_Q, TD_W, TD_E, TD_R, TD_T, TD_Y, TD_U, TD_I, TD_O, TD_P, ____, ____, _____,
|
||||
___________, TD_A, TD_S, TD_D, TD_F, TD_G, TD_H, TD_J, TD_K, TD_L, ____, ____, TD_ENT,
|
||||
___________, TD_Z, TD_X, TD_C, TD_V, TD_B, TD_N, TD_M, ____, ____, ____, _________________,
|
||||
____, ____, ____, /*----------------------*/TD_ENT/*-----------------------*/, ____, ____, ____, RESET),
|
||||
|
||||
[FN_LAYER]=
|
||||
LAYOUT(
|
||||
KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_DEL,
|
||||
KC_CAPSLOCK, KC_MPRV, KC_MPLY, KC_MNXT, LWIN(KC_R), KC_TRNS, KC_CALC, KC_PGUP, KC_UP, KC_PGDN, KC_PSCR, KC_SLCK, KC_BRK, KC_TRNS,
|
||||
KC_TRNS, KC_VOLD, KC_MUTE, KC_VOLU, KC_TRNS, KC_TRNS, KC_HOME, KC_LEFT, KC_DOWN, KC_RIGHT, KC_INS, KC_DEL, MO(LAYER_SEL),
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_END, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HYPR, KC_TRNS, KC_MEH, KC_TRNS),
|
||||
|
||||
[LAYER_SEL]=
|
||||
LAYOUT(
|
||||
TO(BASE), TO(NAV_CLUSTER), TO(RGB), TO(MOUSE), TO(GAMING), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS)
|
||||
|
||||
LAYOUT_60_ansi(
|
||||
KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL,
|
||||
KC_CAPSLOCK, KC_MPRV, KC_MPLY, KC_MNXT, LWIN(KC_R), ____, KC_CALC, KC_PGUP, KC_UP, KC_PGDN, KC_PSCR, KC_SLCK, KC_BRK, ____,
|
||||
____, KC_VOLD, KC_MUTE, KC_VOLU, ____, ____, KC_HOME, KC_LEFT, KC_DOWN, KC_RIGHT, KC_INS, KC_DEL, ____,
|
||||
____, ____, ____, ____, ____, ____, KC_END, ____, QWRTY, NAVS, GAME, ____,
|
||||
____, ____, ____, _________________, ____, KC_HYPR, KC_MEH, ____)
|
||||
};
|
||||
|
103
keyboards/dz60/keymaps/marianas/keymap.h
Normal file
103
keyboards/dz60/keymaps/marianas/keymap.h
Normal file
@@ -0,0 +1,103 @@
|
||||
//Control
|
||||
#define MO_FNLR MO(FN_LAYER)
|
||||
#define BACKSPC KC_BSPC
|
||||
#define ENTER_OR_SQL LT(SQLMACROS,KC_ENT)
|
||||
#define ESCAP KC_ESC
|
||||
#define PSCR KC_PSCREEN
|
||||
#define SCRL KC_SCROLLLOCK
|
||||
#define PAUS KC_PAUSE
|
||||
#define NSRT KC_INSERT
|
||||
#define HOME KC_HOME
|
||||
#define PGUP KC_PGUP
|
||||
#define PGDN KC_PGDN
|
||||
#define END_ KC_END
|
||||
#define DELT KC_DELETE
|
||||
#define UPUP KC_UP
|
||||
#define D_WN KC_DOWN
|
||||
#define LEFT KC_LEFT
|
||||
#define RGHT KC_RIGHT
|
||||
|
||||
//KEYPAD
|
||||
#define KP_1 KC_KP_1
|
||||
#define KP_2 KC_KP_2
|
||||
#define KP_3 KC_KP_3
|
||||
#define KP_4 KC_KP_4
|
||||
#define KP_5 KC_KP_5
|
||||
#define KP_6 KC_KP_6
|
||||
#define KP_7 KC_KP_7
|
||||
#define KP_8 KC_KP_8
|
||||
#define KP_9 KC_KP_9
|
||||
#define KP_0 KC_KP_0
|
||||
#define NMLK KC_NUMLOCK
|
||||
#define STAR KC_KP_ASTERISK
|
||||
#define KSSH KC_KP_SLASH
|
||||
#define KMIN KC_KP_MINUS
|
||||
#define PLUS KC_KP_PLUS
|
||||
#define KNTR KC_KP_ENTER
|
||||
#define KDOT KC_KP_DOT
|
||||
|
||||
//Modifiers
|
||||
#define CTLL KC_LCTL
|
||||
#define LEFTSHFT KC_LSPO
|
||||
#define WINL KC_LGUI
|
||||
#define ALTL KC_LALT
|
||||
#define CTLR KC_RCTL
|
||||
#define RIGHT_SHIFT__PAREN KC_RSPC
|
||||
#define WINR KC_RGUI
|
||||
#define ALTR KC_RALT
|
||||
#define APPR KC_APP
|
||||
|
||||
|
||||
//Punctuation
|
||||
#define CMMA KC_COMM
|
||||
#define PRRD KC_DOT
|
||||
#define SLSH KC_SLSH
|
||||
#define QUOT KC_QUOT
|
||||
#define COLN KC_SCLN
|
||||
#define LBRC KC_LBRC
|
||||
#define RBRC KC_RBRC
|
||||
#define EQUL KC_EQL
|
||||
#define MNUS KC_MINS
|
||||
#define BSLASH KC_BSLS
|
||||
|
||||
//Layers
|
||||
#define QWRTY TO(QWERTY)
|
||||
#define NAVS TO(NAV_CLUSTER)
|
||||
#define GAME TO(GAMING)
|
||||
|
||||
//Space
|
||||
#define ____ KC_TRNS
|
||||
#define _____ KC_TRNS
|
||||
#define ______ KC_TRNS
|
||||
#define _______ KC_TRNS
|
||||
#define ________ KC_TRNS
|
||||
#define ___________ KC_TRNS
|
||||
#define _________________ KC_TRNS
|
||||
#define SPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACE KC_SPC
|
||||
#define KCNO KC_NO
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#define macroTapsLen 32
|
||||
#define tableNameListLen 32
|
||||
#define charCountLen 32
|
||||
|
||||
void initStringData(void);
|
||||
uint32_t layer_state_set_user(uint32_t state);
|
||||
bool containsCode(uint16_t kc);
|
||||
bool lastCodeIs(uint16_t kc);
|
||||
bool last2CodeAre(uint16_t kc);
|
||||
bool last2CodesAre(uint16_t kc, uint16_t kc2);
|
||||
void addKeyCode(uint16_t kc);
|
||||
void eraseKeyCodes(void);
|
||||
void eraseCharCounts(void);
|
||||
void printTableAbbreviation(void);
|
||||
void eraseTableAbbreviation(void);
|
||||
void printString(char* str);
|
||||
void printStringAndQueueChar(char* str);
|
||||
void ReplaceString(char *orig, char *repl);
|
||||
void deletePrev(void);
|
||||
void processSmartMacroTap(uint16_t kc);
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record);
|
17
keyboards/dz60/keymaps/marianas/rules.mk
Normal file
17
keyboards/dz60/keymaps/marianas/rules.mk
Normal file
@@ -0,0 +1,17 @@
|
||||
# Build Options
|
||||
# comment out to disable the options.
|
||||
#
|
||||
|
||||
|
||||
BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE = no # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE = no # Console for debug(+400)
|
||||
COMMAND_ENABLE = no # Commands for debug and configuration
|
||||
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||
NKRO_ENABLE = no # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
|
||||
AUDIO_ENABLE = no
|
||||
RGBLIGHT_ENABLE = yes
|
||||
TAP_DANCE_ENABLE = no
|
||||
AUTO_SHIFT_ENABLE = no
|
@@ -1,5 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#define FORCE_NKRO
|
||||
|
||||
#undef LSPO_KEY
|
||||
#undef RSPC_KEY
|
||||
#define LSPO_KEY KC_8 // Nordic Left SpaceCadet
|
||||
|
@@ -22,8 +22,6 @@
|
||||
#include "version.h"
|
||||
#include "keymap_swedish.h"
|
||||
|
||||
#define _______ KC_TRNS
|
||||
|
||||
#define BASE 0 // default layer
|
||||
#define SYMB 1 // symbols
|
||||
#define MDIA 2 // media keys
|
||||
@@ -47,8 +45,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
* | | | | | | | | | | | | | | | |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | L4 | A | S | D | F | G |------| |------| H | J | K | L |Ö / L3| Ä/L2 |
|
||||
* | | | | | | | Hypr/| | Meh/ | | | | | | |
|
||||
* |--------+------+------+------+------+------| Esc | | Ent |------+------+------+------+------+--------|
|
||||
* | | | | | | | | | | | | | | | |
|
||||
* |--------+------+------+------+------+------| Back | |Forwd |------+------+------+------+------+--------|
|
||||
* | LShift/| Z | X | C | V | B | | | | N | M | ; | : | _ | RShift/|
|
||||
* | ( | | | | | | | | | | | , | . | - | ) |
|
||||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||
@@ -71,8 +69,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
NO_HALF, KC_1, KC_2, KC_3, KC_4, KC_5, KC_INS,
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB),
|
||||
MO(ARRW), KC_A, KC_S, KC_D, KC_F, KC_G,
|
||||
KC_LSPO, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_ESC),
|
||||
CTL_T(NO_APOS), NO_ACUT, KC_LALT, KC_BSPC, KC_SPC,
|
||||
KC_LSPO, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_WBAK,
|
||||
CTL_T(NO_APOS), NO_ACUT, KC_LALT, KC_BSPC, KC_SPC,
|
||||
NO_LESS, KC_END,
|
||||
KC_LEFT, KC_RIGHT, KC_PGDN,
|
||||
CTL_T(KC_ENT), ALT_T(KC_ESC), KC_LGUI,
|
||||
@@ -81,7 +79,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
TO(ARRW), KC_6, KC_7, KC_8, KC_9, KC_0, NO_PLUS,
|
||||
TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, NO_AA,
|
||||
KC_H, KC_J, KC_K, KC_L, LT(MDIA, NO_OSLH), LT(SYMB, NO_AE),
|
||||
MEH_T(KC_ENT), KC_N, KC_M, KC_COMM, KC_DOT, NO_MINS, KC_RSPC,
|
||||
KC_WFWD, KC_N, KC_M, KC_COMM, KC_DOT, NO_MINS, KC_RSPC,
|
||||
KC_SPC, KC_BSPC, NO_ALGR, NO_ASTR, CTL_T(NO_TILD),
|
||||
KC_HOME, NO_CIRC,
|
||||
KC_PGUP, KC_UP, KC_DOWN,
|
||||
@@ -101,11 +99,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
* | | | | | | | | . | 0 | = | |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* |Animat| | |Toggle|Solid |
|
||||
* | | | | | |
|
||||
* ,------|------|------| |------+------+------.
|
||||
* | | | | | | | |
|
||||
* |------|------|------| |------|------|------|
|
||||
* |BNess-|Bness+| | | |Hue- |Hue+ |
|
||||
* | | | | | | | |
|
||||
* `--------------------' `--------------------'
|
||||
*/
|
||||
// SYMBOLS
|
||||
@@ -116,18 +114,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
_______,KC_HASH,NO_DLR, NO_LPRN,NO_RPRN,NO_GRV,
|
||||
_______,KC_PERC,NO_CIRC,NO_LBRC,NO_RBRC,NO_TILD,_______,
|
||||
EPRM,_______,_______,_______,_______,
|
||||
RGB_MOD,_______,
|
||||
_______,_______,
|
||||
_______,_______,_______,
|
||||
_______,_______,_______,
|
||||
RGB_VAD,RGB_VAI,_______,
|
||||
// right hand
|
||||
_______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
|
||||
_______, KC_UP, KC_7, KC_8, KC_9, NO_ASTR, KC_F12,
|
||||
KC_DOWN, KC_4, KC_5, KC_6, NO_PLUS, _______,
|
||||
_______, NO_AMPR, KC_1, KC_2, KC_3, NO_MINS, _______,
|
||||
_______,KC_DOT, KC_0, NO_EQL, _______,
|
||||
RGB_TOG, RGB_SLD,
|
||||
_______, _______,
|
||||
_______, _______, _______,
|
||||
_______, RGB_HUD, RGB_HUI
|
||||
_______, _______, _______
|
||||
),
|
||||
|
||||
/* Keymap: Media and mouse keys
|
||||
@@ -183,10 +181,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
_______, _______, _______,
|
||||
// right hand
|
||||
TO(BASE), _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, KC_BTN4, KC_MS_U, KC_BTN5, _______, _______,
|
||||
_______, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______,
|
||||
KC_BTN1, KC_BTN3, KC_BTN2, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______,
|
||||
_______, _______,
|
||||
_______, _______, _______,
|
||||
_______, _______, _______
|
||||
|
@@ -15,76 +15,7 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef REV1_CONFIG_H
|
||||
#define REV1_CONFIG_H
|
||||
#pragma once
|
||||
|
||||
#include QMK_KEYBOARD_CONFIG_H
|
||||
#include "config_common.h"
|
||||
|
||||
/* USB Device descriptor parameter */
|
||||
#define VENDOR_ID 0xCEEB
|
||||
#define PRODUCT_ID 0x1256
|
||||
#define DEVICE_VER 0x0100
|
||||
#define MANUFACTURER JPConstantineau.com
|
||||
#define PRODUCT ErgoTravel Keyboard
|
||||
#define DESCRIPTION Split 45 percent ergonomic keyboard
|
||||
|
||||
/* key matrix size */
|
||||
// Rows are doubled-up
|
||||
#define MATRIX_ROWS 8
|
||||
#define MATRIX_COLS 7
|
||||
|
||||
// wiring of each half
|
||||
#define MATRIX_ROW_PINS { C6, D7, E6, B4 }
|
||||
#define MATRIX_COL_PINS { F5, F6, F7, B1, B3, B2, B6 }
|
||||
|
||||
/* COL2ROW or ROW2COL */
|
||||
#define DIODE_DIRECTION COL2ROW
|
||||
|
||||
/* define if matrix has ghost */
|
||||
//#define MATRIX_HAS_GHOST
|
||||
|
||||
/* number of backlight levels */
|
||||
// #define BACKLIGHT_LEVELS 3
|
||||
|
||||
/* Set 0 if debouncing isn't needed */
|
||||
#define DEBOUNCING_DELAY 5
|
||||
|
||||
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
|
||||
#define LOCKING_SUPPORT_ENABLE
|
||||
/* Locking resynchronize hack */
|
||||
#define LOCKING_RESYNC_ENABLE
|
||||
|
||||
/* key combination for command */
|
||||
#define IS_COMMAND() ( \
|
||||
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
|
||||
)
|
||||
|
||||
#define BACKLIGHT_PIN B5
|
||||
#define BACKLIGHT_LEVELS 5
|
||||
|
||||
/* ws2812 RGB LED */
|
||||
#define RGB_DI_PIN D3
|
||||
#define RGBLIGHT_TIMER
|
||||
#define RGBLED_NUM 12 // Number of LEDs
|
||||
#define ws2812_PORTREG PORTD
|
||||
#define ws2812_DDRREG DDRD
|
||||
|
||||
/*
|
||||
* 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
|
||||
|
||||
#endif
|
||||
|
@@ -1,5 +1,4 @@
|
||||
#ifndef ERGOTRAVEL_H
|
||||
#define ERGOTRAVEL_H
|
||||
#pragma once
|
||||
|
||||
#ifdef KEYBOARD_ergotravel_rev1
|
||||
#include "rev1.h"
|
||||
@@ -21,4 +20,3 @@
|
||||
KC_##L30, KC_##L31, KC_##L32, KC_##L33, KC_##L34, KC_##L35, KC_##R30, KC_##R31, KC_##R32, KC_##R33, KC_##R34, KC_##R35 \
|
||||
)
|
||||
|
||||
#endif
|
@@ -1,162 +0,0 @@
|
||||
#include <util/twi.h>
|
||||
#include <avr/io.h>
|
||||
#include <stdlib.h>
|
||||
#include <avr/interrupt.h>
|
||||
#include <util/twi.h>
|
||||
#include <stdbool.h>
|
||||
#include "i2c.h"
|
||||
|
||||
#ifdef USE_I2C
|
||||
|
||||
// Limits the amount of we wait for any one i2c transaction.
|
||||
// Since were running SCL line 100kHz (=> 10μs/bit), and each transactions is
|
||||
// 9 bits, a single transaction will take around 90μs to complete.
|
||||
//
|
||||
// (F_CPU/SCL_CLOCK) => # of μC cycles to transfer a bit
|
||||
// poll loop takes at least 8 clock cycles to execute
|
||||
#define I2C_LOOP_TIMEOUT (9+1)*(F_CPU/SCL_CLOCK)/8
|
||||
|
||||
#define BUFFER_POS_INC() (slave_buffer_pos = (slave_buffer_pos+1)%SLAVE_BUFFER_SIZE)
|
||||
|
||||
volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE];
|
||||
|
||||
static volatile uint8_t slave_buffer_pos;
|
||||
static volatile bool slave_has_register_set = false;
|
||||
|
||||
// Wait for an i2c operation to finish
|
||||
inline static
|
||||
void i2c_delay(void) {
|
||||
uint16_t lim = 0;
|
||||
while(!(TWCR & (1<<TWINT)) && lim < I2C_LOOP_TIMEOUT)
|
||||
lim++;
|
||||
|
||||
// easier way, but will wait slightly longer
|
||||
// _delay_us(100);
|
||||
}
|
||||
|
||||
// Setup twi to run at 100kHz
|
||||
void i2c_master_init(void) {
|
||||
// no prescaler
|
||||
TWSR = 0;
|
||||
// Set TWI clock frequency to SCL_CLOCK. Need TWBR>10.
|
||||
// Check datasheets for more info.
|
||||
TWBR = ((F_CPU/SCL_CLOCK)-16)/2;
|
||||
}
|
||||
|
||||
// Start a transaction with the given i2c slave address. The direction of the
|
||||
// transfer is set with I2C_READ and I2C_WRITE.
|
||||
// returns: 0 => success
|
||||
// 1 => error
|
||||
uint8_t i2c_master_start(uint8_t address) {
|
||||
TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWSTA);
|
||||
|
||||
i2c_delay();
|
||||
|
||||
// check that we started successfully
|
||||
if ( (TW_STATUS != TW_START) && (TW_STATUS != TW_REP_START))
|
||||
return 1;
|
||||
|
||||
TWDR = address;
|
||||
TWCR = (1<<TWINT) | (1<<TWEN);
|
||||
|
||||
i2c_delay();
|
||||
|
||||
if ( (TW_STATUS != TW_MT_SLA_ACK) && (TW_STATUS != TW_MR_SLA_ACK) )
|
||||
return 1; // slave did not acknowledge
|
||||
else
|
||||
return 0; // success
|
||||
}
|
||||
|
||||
|
||||
// Finish the i2c transaction.
|
||||
void i2c_master_stop(void) {
|
||||
TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWSTO);
|
||||
|
||||
uint16_t lim = 0;
|
||||
while(!(TWCR & (1<<TWSTO)) && lim < I2C_LOOP_TIMEOUT)
|
||||
lim++;
|
||||
}
|
||||
|
||||
// Write one byte to the i2c slave.
|
||||
// returns 0 => slave ACK
|
||||
// 1 => slave NACK
|
||||
uint8_t i2c_master_write(uint8_t data) {
|
||||
TWDR = data;
|
||||
TWCR = (1<<TWINT) | (1<<TWEN);
|
||||
|
||||
i2c_delay();
|
||||
|
||||
// check if the slave acknowledged us
|
||||
return (TW_STATUS == TW_MT_DATA_ACK) ? 0 : 1;
|
||||
}
|
||||
|
||||
// Read one byte from the i2c slave. If ack=1 the slave is acknowledged,
|
||||
// if ack=0 the acknowledge bit is not set.
|
||||
// returns: byte read from i2c device
|
||||
uint8_t i2c_master_read(int ack) {
|
||||
TWCR = (1<<TWINT) | (1<<TWEN) | (ack<<TWEA);
|
||||
|
||||
i2c_delay();
|
||||
return TWDR;
|
||||
}
|
||||
|
||||
void i2c_reset_state(void) {
|
||||
TWCR = 0;
|
||||
}
|
||||
|
||||
void i2c_slave_init(uint8_t address) {
|
||||
TWAR = address << 0; // slave i2c address
|
||||
// TWEN - twi enable
|
||||
// TWEA - enable address acknowledgement
|
||||
// TWINT - twi interrupt flag
|
||||
// TWIE - enable the twi interrupt
|
||||
TWCR = (1<<TWIE) | (1<<TWEA) | (1<<TWINT) | (1<<TWEN);
|
||||
}
|
||||
|
||||
ISR(TWI_vect);
|
||||
|
||||
ISR(TWI_vect) {
|
||||
uint8_t ack = 1;
|
||||
switch(TW_STATUS) {
|
||||
case TW_SR_SLA_ACK:
|
||||
// this device has been addressed as a slave receiver
|
||||
slave_has_register_set = false;
|
||||
break;
|
||||
|
||||
case TW_SR_DATA_ACK:
|
||||
// this device has received data as a slave receiver
|
||||
// The first byte that we receive in this transaction sets the location
|
||||
// of the read/write location of the slaves memory that it exposes over
|
||||
// i2c. After that, bytes will be written at slave_buffer_pos, incrementing
|
||||
// slave_buffer_pos after each write.
|
||||
if(!slave_has_register_set) {
|
||||
slave_buffer_pos = TWDR;
|
||||
// don't acknowledge the master if this memory loctaion is out of bounds
|
||||
if ( slave_buffer_pos >= SLAVE_BUFFER_SIZE ) {
|
||||
ack = 0;
|
||||
slave_buffer_pos = 0;
|
||||
}
|
||||
slave_has_register_set = true;
|
||||
} else {
|
||||
i2c_slave_buffer[slave_buffer_pos] = TWDR;
|
||||
BUFFER_POS_INC();
|
||||
}
|
||||
break;
|
||||
|
||||
case TW_ST_SLA_ACK:
|
||||
case TW_ST_DATA_ACK:
|
||||
// master has addressed this device as a slave transmitter and is
|
||||
// requesting data.
|
||||
TWDR = i2c_slave_buffer[slave_buffer_pos];
|
||||
BUFFER_POS_INC();
|
||||
break;
|
||||
|
||||
case TW_BUS_ERROR: // something went wrong, reset twi state
|
||||
TWCR = 0;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
// Reset everything, so we are ready for the next TWI interrupt
|
||||
TWCR |= (1<<TWIE) | (1<<TWINT) | (ack<<TWEA) | (1<<TWEN);
|
||||
}
|
||||
#endif
|
@@ -1,49 +0,0 @@
|
||||
#ifndef I2C_H
|
||||
#define I2C_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifndef F_CPU
|
||||
#define F_CPU 16000000UL
|
||||
#endif
|
||||
|
||||
#define I2C_READ 1
|
||||
#define I2C_WRITE 0
|
||||
|
||||
#define I2C_ACK 1
|
||||
#define I2C_NACK 0
|
||||
|
||||
#define SLAVE_BUFFER_SIZE 0x10
|
||||
|
||||
// i2c SCL clock frequency
|
||||
#define SCL_CLOCK 100000L
|
||||
|
||||
extern volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE];
|
||||
|
||||
void i2c_master_init(void);
|
||||
uint8_t i2c_master_start(uint8_t address);
|
||||
void i2c_master_stop(void);
|
||||
uint8_t i2c_master_write(uint8_t data);
|
||||
uint8_t i2c_master_read(int);
|
||||
void i2c_reset_state(void);
|
||||
void i2c_slave_init(uint8_t address);
|
||||
|
||||
|
||||
static inline unsigned char i2c_start_read(unsigned char addr) {
|
||||
return i2c_master_start((addr << 1) | I2C_READ);
|
||||
}
|
||||
|
||||
static inline unsigned char i2c_start_write(unsigned char addr) {
|
||||
return i2c_master_start((addr << 1) | I2C_WRITE);
|
||||
}
|
||||
|
||||
// from SSD1306 scrips
|
||||
extern unsigned char i2c_rep_start(unsigned char addr);
|
||||
extern void i2c_start_wait(unsigned char addr);
|
||||
extern unsigned char i2c_readAck(void);
|
||||
extern unsigned char i2c_readNak(void);
|
||||
extern unsigned char i2c_read(unsigned char ack);
|
||||
|
||||
#define i2c_read(ack) (ack) ? i2c_readAck() : i2c_readNak();
|
||||
|
||||
#endif
|
@@ -15,10 +15,7 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_USER_H
|
||||
#define CONFIG_USER_H
|
||||
|
||||
#include "config_common.h"
|
||||
#pragma once
|
||||
|
||||
/* Use I2C or Serial, not both */
|
||||
|
||||
@@ -40,4 +37,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define RGBLIGHT_SAT_STEP 8
|
||||
#define RGBLIGHT_VAL_STEP 8
|
||||
|
||||
#endif
|
||||
|
@@ -1,4 +1,4 @@
|
||||
#include QMK_KEYBOARD_H
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
extern keymap_config_t keymap_config;
|
||||
|
||||
@@ -100,7 +100,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
//|----+----+----+----+----+----+----| |----+----+----+----+----+----+----|
|
||||
, , , , , , , ,COMM, P1 , P2 , P3 ,PLUS, ,
|
||||
//|----+----+----+----+----+----+----. .----+----+----+----+----+----+----|
|
||||
, , , , , , , P0 ,NLCK, , ,
|
||||
, , , , , , , P0 ,NLCK, , ,
|
||||
//`----+----+----+--+-+----/----/ \----\----+----+----+----+----'
|
||||
),
|
||||
|
||||
@@ -112,7 +112,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
//|----+----+----+----+----+----+----| |----+----+----+----+----+----+----|
|
||||
,UDO ,CUT ,CPY ,PST ,XXXX, , ,XXXX,XXXX,COMM,DOT ,SLSH, ,
|
||||
//|----+----+----+----+----+----+----. .----+----+----+----+----+----+----|
|
||||
, , , , , , , , , , ,
|
||||
, , , , , , , , , , ,
|
||||
//`----+----+----+--+-+----/----/ \----\----+----+----+----+----'
|
||||
),
|
||||
|
||||
@@ -124,7 +124,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
//|----+----+----+----+----+----+----| |----+----+----+----+----+----+----|
|
||||
, GRV,TILD,XXXX,EQL ,PLUS, , ,UNDS,MINS,COMM,DOT ,SLSH,ENT ,
|
||||
//|----+----+----+----+----+----+----. .----+----+----+----+----+----+----|
|
||||
, , , , , , , , , , ,
|
||||
, , , , , , , , , , ,
|
||||
//`----+----+----+--+-+----/----/ \----\----+----+----+----+----'
|
||||
),
|
||||
|
||||
@@ -139,7 +139,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
//|----+----+----+----+----+----+----. .----+----+----+----+----+----+----|
|
||||
, , , , , , , , ,VOLD,VOLU,MUTE
|
||||
//`----+----+----+--+-+----/----/ \----\----+----+----+----+----'
|
||||
)
|
||||
)
|
||||
|
||||
};
|
||||
|
||||
@@ -148,9 +148,9 @@ const uint16_t PROGMEM fn_actions[] = {
|
||||
,[F_ALT] = ACTION_MODS_ONESHOT (MOD_LALT)
|
||||
,[F_CTRL] = ACTION_MODS_ONESHOT (MOD_LCTL)
|
||||
,[F_NUMPAD] = ACTION_LAYER_TAP_TOGGLE(_NUMPAD)
|
||||
// ,[F_LOWER] = ACTION_LAYER_TAP_TOGGLE(LOWER) // FN1 - Momentary Layer 1 (Lower)
|
||||
// ,[F_LOWER] = ACTION_LAYER_TAP_TOGGLE(LOWER) // FN1 - Momentary Layer 1 (Lower)
|
||||
// ,[F_RAISE] = ACTION_LAYER_TAP_TOGGLE(RAISE) // FN2 - Momentary Layer 2 (Raise)
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
@@ -1,3 +0,0 @@
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../../Makefile
|
||||
endif
|
||||
|
@@ -15,10 +15,7 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_USER_H
|
||||
#define CONFIG_USER_H
|
||||
|
||||
#include "config_common.h"
|
||||
#pragma once
|
||||
|
||||
/* Use I2C or Serial, not both */
|
||||
|
||||
@@ -38,4 +35,4 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define RGBLIGHT_SAT_STEP 8
|
||||
#define RGBLIGHT_VAL_STEP 8
|
||||
|
||||
#endif
|
||||
|
||||
|
@@ -1,3 +0,0 @@
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../../Makefile
|
||||
endif
|
||||
|
@@ -15,10 +15,7 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_USER_H
|
||||
#define CONFIG_USER_H
|
||||
|
||||
#include "config_common.h"
|
||||
#pragma once
|
||||
|
||||
/* Use I2C or Serial, not both */
|
||||
|
||||
@@ -38,4 +35,4 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define RGBLIGHT_SAT_STEP 8
|
||||
#define RGBLIGHT_VAL_STEP 8
|
||||
|
||||
#endif
|
||||
|
||||
|
@@ -1,3 +0,0 @@
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../../Makefile
|
||||
endif
|
||||
|
@@ -15,10 +15,7 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_USER_H
|
||||
#define CONFIG_USER_H
|
||||
|
||||
#include "config_common.h"
|
||||
#pragma once
|
||||
|
||||
/* Use I2C or Serial, not both */
|
||||
|
||||
@@ -38,4 +35,4 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define RGBLIGHT_SAT_STEP 8
|
||||
#define RGBLIGHT_VAL_STEP 8
|
||||
|
||||
#endif
|
||||
|
||||
|
@@ -1,3 +0,0 @@
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../../Makefile
|
||||
endif
|
||||
|
@@ -15,10 +15,7 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_USER_H
|
||||
#define CONFIG_USER_H
|
||||
|
||||
#include "config_common.h"
|
||||
#pragma once
|
||||
|
||||
/* Use I2C or Serial, not both */
|
||||
|
||||
@@ -39,4 +36,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define RGBLIGHT_VAL_STEP 20
|
||||
#define RGBLIGHT_LIMIT_VAL 220
|
||||
|
||||
#endif
|
||||
|
@@ -2,6 +2,3 @@ RGBLIGHT_ENABLE = yes
|
||||
BACKLIGHT_ENABLE = no
|
||||
UNICODE_ENABLE = yes
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../../Makefile
|
||||
endif
|
||||
|
@@ -1,482 +0,0 @@
|
||||
/*
|
||||
Copyright 2018 Pierre Constantineau
|
||||
|
||||
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/>.
|
||||
*/
|
||||
|
||||
/*
|
||||
* scan matrix
|
||||
*/
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <avr/io.h>
|
||||
#include "wait.h"
|
||||
#include "print.h"
|
||||
#include "debug.h"
|
||||
#include "util.h"
|
||||
#include "matrix.h"
|
||||
#include "split_util.h"
|
||||
#include "pro_micro.h"
|
||||
#include "config.h"
|
||||
#include "timer.h"
|
||||
#include "backlight.h"
|
||||
|
||||
#ifdef USE_I2C
|
||||
# include "i2c.h"
|
||||
#else // USE_SERIAL
|
||||
# include "serial.h"
|
||||
#endif
|
||||
|
||||
#ifndef DEBOUNCING_DELAY
|
||||
# define DEBOUNCING_DELAY 5
|
||||
#endif
|
||||
|
||||
#if (DEBOUNCING_DELAY > 0)
|
||||
static uint16_t debouncing_time;
|
||||
static bool debouncing = false;
|
||||
#endif
|
||||
|
||||
#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)
|
||||
#else
|
||||
# error "Currently only supports 8 COLS"
|
||||
#endif
|
||||
static matrix_row_t matrix_debouncing[MATRIX_ROWS];
|
||||
|
||||
#define ERROR_DISCONNECT_COUNT 5
|
||||
|
||||
#define SERIAL_LED_ADDR 0x00
|
||||
|
||||
#define ROWS_PER_HAND (MATRIX_ROWS/2)
|
||||
|
||||
static uint8_t error_count = 0;
|
||||
|
||||
static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS;
|
||||
static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
|
||||
|
||||
/* matrix state(1:on, 0:off) */
|
||||
static matrix_row_t matrix[MATRIX_ROWS];
|
||||
static matrix_row_t matrix_debouncing[MATRIX_ROWS];
|
||||
|
||||
#if (DIODE_DIRECTION == COL2ROW)
|
||||
static void init_cols(void);
|
||||
static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row);
|
||||
static void unselect_rows(void);
|
||||
static void select_row(uint8_t row);
|
||||
static void unselect_row(uint8_t row);
|
||||
#elif (DIODE_DIRECTION == ROW2COL)
|
||||
static void init_rows(void);
|
||||
static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col);
|
||||
static void unselect_cols(void);
|
||||
static void unselect_col(uint8_t col);
|
||||
static void select_col(uint8_t col);
|
||||
#endif
|
||||
|
||||
|
||||
__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)
|
||||
{
|
||||
debug_enable = true;
|
||||
debug_matrix = true;
|
||||
debug_mouse = true;
|
||||
// initialize row and col
|
||||
unselect_rows();
|
||||
init_cols();
|
||||
|
||||
TX_RX_LED_INIT;
|
||||
|
||||
// initialize matrix state: all keys off
|
||||
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
|
||||
matrix[i] = 0;
|
||||
matrix_debouncing[i] = 0;
|
||||
}
|
||||
|
||||
matrix_init_quantum();
|
||||
|
||||
}
|
||||
|
||||
uint8_t _matrix_scan(void)
|
||||
{
|
||||
int offset = isLeftHand ? 0 : (ROWS_PER_HAND);
|
||||
#if (DIODE_DIRECTION == COL2ROW)
|
||||
// Set row, read cols
|
||||
for (uint8_t current_row = 0; current_row < ROWS_PER_HAND; current_row++) {
|
||||
# if (DEBOUNCING_DELAY > 0)
|
||||
bool matrix_changed = read_cols_on_row(matrix_debouncing+offset, current_row);
|
||||
|
||||
if (matrix_changed) {
|
||||
debouncing = true;
|
||||
debouncing_time = timer_read();
|
||||
PORTD ^= (1 << 2);
|
||||
}
|
||||
|
||||
# else
|
||||
read_cols_on_row(matrix+offset, current_row);
|
||||
# endif
|
||||
|
||||
}
|
||||
|
||||
#elif (DIODE_DIRECTION == ROW2COL)
|
||||
// Set col, read rows
|
||||
for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) {
|
||||
# if (DEBOUNCING_DELAY > 0)
|
||||
bool matrix_changed = read_rows_on_col(matrix_debouncing+offset, current_col);
|
||||
if (matrix_changed) {
|
||||
debouncing = true;
|
||||
debouncing_time = timer_read();
|
||||
}
|
||||
# else
|
||||
read_rows_on_col(matrix+offset, current_col);
|
||||
# endif
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
# if (DEBOUNCING_DELAY > 0)
|
||||
if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) {
|
||||
for (uint8_t i = 0; i < ROWS_PER_HAND; i++) {
|
||||
matrix[i+offset] = matrix_debouncing[i+offset];
|
||||
}
|
||||
debouncing = false;
|
||||
}
|
||||
# endif
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
#ifdef USE_I2C
|
||||
|
||||
// Get rows from other half over i2c
|
||||
int i2c_transaction(void) {
|
||||
int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0;
|
||||
|
||||
int err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE);
|
||||
if (err) goto i2c_error;
|
||||
|
||||
// start of matrix stored at 0x00
|
||||
err = i2c_master_write(0x00);
|
||||
if (err) goto i2c_error;
|
||||
|
||||
#ifdef BACKLIGHT_ENABLE
|
||||
// Write backlight level for slave to read
|
||||
err = i2c_master_write(get_backlight_level());
|
||||
#else
|
||||
// Write zero, so our byte index is the same
|
||||
err = i2c_master_write(0x00);
|
||||
#endif
|
||||
if (err) goto i2c_error;
|
||||
|
||||
// Start read
|
||||
err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_READ);
|
||||
if (err) goto i2c_error;
|
||||
|
||||
if (!err) {
|
||||
int i;
|
||||
for (i = 0; i < ROWS_PER_HAND-1; ++i) {
|
||||
matrix[slaveOffset+i] = i2c_master_read(I2C_ACK);
|
||||
}
|
||||
matrix[slaveOffset+i] = i2c_master_read(I2C_NACK);
|
||||
i2c_master_stop();
|
||||
} else {
|
||||
i2c_error: // the cable is disconnceted, or something else went wrong
|
||||
i2c_reset_state();
|
||||
return err;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#else // USE_SERIAL
|
||||
|
||||
int serial_transaction(void) {
|
||||
int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0;
|
||||
|
||||
if (serial_update_buffers()) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
for (int i = 0; i < ROWS_PER_HAND; ++i) {
|
||||
matrix[slaveOffset+i] = serial_slave_buffer[i];
|
||||
}
|
||||
|
||||
#ifdef BACKLIGHT_ENABLE
|
||||
// Write backlight level for slave to read
|
||||
serial_master_buffer[SERIAL_LED_ADDR] = get_backlight_level();
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
uint8_t matrix_scan(void)
|
||||
{
|
||||
uint8_t ret = _matrix_scan();
|
||||
|
||||
#ifdef USE_I2C
|
||||
if( i2c_transaction() ) {
|
||||
#else // USE_SERIAL
|
||||
if( serial_transaction() ) {
|
||||
#endif
|
||||
// turn on the indicator led when halves are disconnected
|
||||
TXLED1;
|
||||
|
||||
error_count++;
|
||||
|
||||
if (error_count > ERROR_DISCONNECT_COUNT) {
|
||||
// reset other half if disconnected
|
||||
int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0;
|
||||
for (int i = 0; i < ROWS_PER_HAND; ++i) {
|
||||
matrix[slaveOffset+i] = 0;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// turn off the indicator led on no error
|
||||
TXLED0;
|
||||
error_count = 0;
|
||||
}
|
||||
matrix_scan_quantum();
|
||||
return ret;
|
||||
}
|
||||
|
||||
void matrix_slave_scan(void) {
|
||||
_matrix_scan();
|
||||
|
||||
int offset = (isLeftHand) ? 0 : ROWS_PER_HAND;
|
||||
|
||||
#ifdef USE_I2C
|
||||
#ifdef BACKLIGHT_ENABLE
|
||||
// Read backlight level sent from master and update level on slave
|
||||
backlight_set(i2c_slave_buffer[0]);
|
||||
#endif
|
||||
for (int i = 0; i < ROWS_PER_HAND; ++i) {
|
||||
i2c_slave_buffer[i+1] = matrix[offset+i];
|
||||
}
|
||||
#else // USE_SERIAL
|
||||
for (int i = 0; i < ROWS_PER_HAND; ++i) {
|
||||
serial_slave_buffer[i] = matrix[offset+i];
|
||||
}
|
||||
|
||||
#ifdef BACKLIGHT_ENABLE
|
||||
// Read backlight level sent from master and update level on slave
|
||||
backlight_set(serial_master_buffer[SERIAL_LED_ADDR]);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
bool matrix_is_modified(void)
|
||||
{
|
||||
if (debouncing) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
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("\nr/c 0123456789ABCDEF\n");
|
||||
for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
|
||||
phex(row); print(": ");
|
||||
pbin_reverse16(matrix_get_row(row));
|
||||
print("\n");
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t matrix_key_count(void)
|
||||
{
|
||||
uint8_t count = 0;
|
||||
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
|
||||
count += bitpop16(matrix[i]);
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
#if (DIODE_DIRECTION == COL2ROW)
|
||||
|
||||
static void init_cols(void)
|
||||
{
|
||||
for(uint8_t x = 0; x < MATRIX_COLS; x++) {
|
||||
uint8_t pin = col_pins[x];
|
||||
_SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
|
||||
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
// Select row and wait for row selecton to stabilize
|
||||
select_row(current_row);
|
||||
wait_us(30);
|
||||
|
||||
// For each col...
|
||||
for(uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) {
|
||||
|
||||
// Select the col pin to read (active low)
|
||||
uint8_t pin = col_pins[col_index];
|
||||
uint8_t pin_state = (_SFR_IO8(pin >> 4) & _BV(pin & 0xF));
|
||||
|
||||
// Populate the matrix row with the state of the col pin
|
||||
current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << col_index);
|
||||
}
|
||||
|
||||
// Unselect row
|
||||
unselect_row(current_row);
|
||||
|
||||
return (last_row_value != current_matrix[current_row]);
|
||||
}
|
||||
|
||||
static void select_row(uint8_t row)
|
||||
{
|
||||
uint8_t pin = row_pins[row];
|
||||
_SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT
|
||||
_SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW
|
||||
}
|
||||
|
||||
static void unselect_row(uint8_t row)
|
||||
{
|
||||
uint8_t pin = row_pins[row];
|
||||
_SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
|
||||
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
|
||||
}
|
||||
|
||||
static void unselect_rows(void)
|
||||
{
|
||||
for(uint8_t x = 0; x < ROWS_PER_HAND; x++) {
|
||||
uint8_t pin = row_pins[x];
|
||||
_SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
|
||||
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
|
||||
}
|
||||
}
|
||||
|
||||
#elif (DIODE_DIRECTION == ROW2COL)
|
||||
|
||||
static void init_rows(void)
|
||||
{
|
||||
for(uint8_t x = 0; x < ROWS_PER_HAND; x++) {
|
||||
uint8_t pin = row_pins[x];
|
||||
_SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
|
||||
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
|
||||
}
|
||||
}
|
||||
|
||||
static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col)
|
||||
{
|
||||
bool matrix_changed = false;
|
||||
|
||||
// Select col and wait for col selecton to stabilize
|
||||
select_col(current_col);
|
||||
wait_us(30);
|
||||
|
||||
// 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];
|
||||
|
||||
// Check row pin state
|
||||
if ((_SFR_IO8(row_pins[row_index] >> 4) & _BV(row_pins[row_index] & 0xF)) == 0)
|
||||
{
|
||||
// Pin LO, set col bit
|
||||
current_matrix[row_index] |= (ROW_SHIFTER << current_col);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Pin HI, clear col bit
|
||||
current_matrix[row_index] &= ~(ROW_SHIFTER << current_col);
|
||||
}
|
||||
|
||||
// Determine if the matrix changed state
|
||||
if ((last_row_value != current_matrix[row_index]) && !(matrix_changed))
|
||||
{
|
||||
matrix_changed = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Unselect col
|
||||
unselect_col(current_col);
|
||||
|
||||
return matrix_changed;
|
||||
}
|
||||
|
||||
static void select_col(uint8_t col)
|
||||
{
|
||||
uint8_t pin = col_pins[col];
|
||||
_SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT
|
||||
_SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW
|
||||
}
|
||||
|
||||
static void unselect_col(uint8_t col)
|
||||
{
|
||||
uint8_t pin = col_pins[col];
|
||||
_SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
|
||||
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
|
||||
}
|
||||
|
||||
static void unselect_cols(void)
|
||||
{
|
||||
for(uint8_t x = 0; x < MATRIX_COLS; x++) {
|
||||
uint8_t pin = col_pins[x];
|
||||
_SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
|
||||
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
@@ -15,10 +15,7 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef REV1_CONFIG_H
|
||||
#define REV1_CONFIG_H
|
||||
|
||||
#include QMK_KEYBOARD_CONFIG_H
|
||||
#pragma once
|
||||
|
||||
/* USB Device descriptor parameter */
|
||||
#define VENDOR_ID 0xCEEB
|
||||
@@ -87,4 +84,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
//#define NO_ACTION_MACRO
|
||||
//#define NO_ACTION_FUNCTION
|
||||
|
||||
#endif
|
||||
|
@@ -1,7 +1,3 @@
|
||||
SRC += matrix.c \
|
||||
i2c.c \
|
||||
split_util.c \
|
||||
serial.c
|
||||
|
||||
# MCU name
|
||||
#MCU = at90usb1287
|
||||
@@ -41,7 +37,7 @@ F_USB = $(F_CPU)
|
||||
|
||||
# Bootloader
|
||||
# This definition is optional, and if your keyboard supports multiple bootloaders of
|
||||
# different sizes, comment this out, and the correct address will be loaded
|
||||
# different sizes, comment this out, and the correct address will be loaded
|
||||
# automatically (+60). See bootloader.mk for all options.
|
||||
BOOTLOADER = caterina
|
||||
|
||||
@@ -64,11 +60,9 @@ AUDIO_ENABLE = no # Audio output on port C6
|
||||
UNICODE_ENABLE = no # Unicode
|
||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
|
||||
SUBPROJECT_rev1 = yes
|
||||
USE_I2C = yes # I2C is used between the sides
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||
|
||||
CUSTOM_MATRIX = yes
|
||||
SPLIT_KEYBOARD = yes
|
||||
|
||||
DEFAULT_FOLDER = ergotravel/rev1
|
||||
|
@@ -1,228 +0,0 @@
|
||||
/*
|
||||
* WARNING: be careful changing this code, it is very timing dependent
|
||||
*/
|
||||
|
||||
#ifndef F_CPU
|
||||
#define F_CPU 16000000
|
||||
#endif
|
||||
|
||||
#include <avr/io.h>
|
||||
#include <avr/interrupt.h>
|
||||
#include <util/delay.h>
|
||||
#include <stdbool.h>
|
||||
#include "serial.h"
|
||||
|
||||
#ifndef USE_I2C
|
||||
|
||||
// Serial pulse period in microseconds. Its probably a bad idea to lower this
|
||||
// value.
|
||||
#define SERIAL_DELAY 24
|
||||
|
||||
uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0};
|
||||
uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0};
|
||||
|
||||
#define SLAVE_DATA_CORRUPT (1<<0)
|
||||
volatile uint8_t status = 0;
|
||||
|
||||
inline static
|
||||
void serial_delay(void) {
|
||||
_delay_us(SERIAL_DELAY);
|
||||
}
|
||||
|
||||
inline static
|
||||
void serial_output(void) {
|
||||
SERIAL_PIN_DDR |= SERIAL_PIN_MASK;
|
||||
}
|
||||
|
||||
// make the serial pin an input with pull-up resistor
|
||||
inline static
|
||||
void serial_input(void) {
|
||||
SERIAL_PIN_DDR &= ~SERIAL_PIN_MASK;
|
||||
SERIAL_PIN_PORT |= SERIAL_PIN_MASK;
|
||||
}
|
||||
|
||||
inline static
|
||||
uint8_t serial_read_pin(void) {
|
||||
return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK);
|
||||
}
|
||||
|
||||
inline static
|
||||
void serial_low(void) {
|
||||
SERIAL_PIN_PORT &= ~SERIAL_PIN_MASK;
|
||||
}
|
||||
|
||||
inline static
|
||||
void serial_high(void) {
|
||||
SERIAL_PIN_PORT |= SERIAL_PIN_MASK;
|
||||
}
|
||||
|
||||
void serial_master_init(void) {
|
||||
serial_output();
|
||||
serial_high();
|
||||
}
|
||||
|
||||
void serial_slave_init(void) {
|
||||
serial_input();
|
||||
|
||||
// Enable INT0
|
||||
EIMSK |= _BV(INT0);
|
||||
// Trigger on falling edge of INT0
|
||||
EICRA &= ~(_BV(ISC00) | _BV(ISC01));
|
||||
}
|
||||
|
||||
// Used by the master to synchronize timing with the slave.
|
||||
static
|
||||
void 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 sync_send(void) {
|
||||
serial_output();
|
||||
|
||||
serial_low();
|
||||
serial_delay();
|
||||
|
||||
serial_high();
|
||||
}
|
||||
|
||||
// Reads a byte from the serial line
|
||||
static
|
||||
uint8_t 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();
|
||||
_delay_us(1);
|
||||
}
|
||||
|
||||
return byte;
|
||||
}
|
||||
|
||||
// Sends a byte with MSB ordering
|
||||
static
|
||||
void 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
|
||||
ISR(SERIAL_PIN_INTERRUPT) {
|
||||
sync_send();
|
||||
|
||||
uint8_t checksum = 0;
|
||||
for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) {
|
||||
serial_write_byte(serial_slave_buffer[i]);
|
||||
sync_send();
|
||||
checksum += serial_slave_buffer[i];
|
||||
}
|
||||
serial_write_byte(checksum);
|
||||
sync_send();
|
||||
|
||||
// wait for the sync to finish sending
|
||||
serial_delay();
|
||||
|
||||
// read the middle of pulses
|
||||
_delay_us(SERIAL_DELAY/2);
|
||||
|
||||
uint8_t checksum_computed = 0;
|
||||
for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) {
|
||||
serial_master_buffer[i] = serial_read_byte();
|
||||
sync_send();
|
||||
checksum_computed += serial_master_buffer[i];
|
||||
}
|
||||
uint8_t checksum_received = serial_read_byte();
|
||||
sync_send();
|
||||
|
||||
serial_input(); // end transaction
|
||||
|
||||
if ( checksum_computed != checksum_received ) {
|
||||
status |= SLAVE_DATA_CORRUPT;
|
||||
} else {
|
||||
status &= ~SLAVE_DATA_CORRUPT;
|
||||
}
|
||||
}
|
||||
|
||||
inline
|
||||
bool serial_slave_DATA_CORRUPT(void) {
|
||||
return status & SLAVE_DATA_CORRUPT;
|
||||
}
|
||||
|
||||
// Copies the serial_slave_buffer to the master and sends the
|
||||
// serial_master_buffer to the slave.
|
||||
//
|
||||
// Returns:
|
||||
// 0 => no error
|
||||
// 1 => slave did not respond
|
||||
int serial_update_buffers(void) {
|
||||
// this code is very time dependent, so we need to disable interrupts
|
||||
cli();
|
||||
|
||||
// signal to the slave that we want to start a transaction
|
||||
serial_output();
|
||||
serial_low();
|
||||
_delay_us(1);
|
||||
|
||||
// wait for the slaves response
|
||||
serial_input();
|
||||
serial_high();
|
||||
_delay_us(SERIAL_DELAY);
|
||||
|
||||
// check if the slave is present
|
||||
if (serial_read_pin()) {
|
||||
// slave failed to pull the line low, assume not present
|
||||
sei();
|
||||
return 1;
|
||||
}
|
||||
|
||||
// if the slave is present syncronize with it
|
||||
sync_recv();
|
||||
|
||||
uint8_t checksum_computed = 0;
|
||||
// receive data from the slave
|
||||
for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) {
|
||||
serial_slave_buffer[i] = serial_read_byte();
|
||||
sync_recv();
|
||||
checksum_computed += serial_slave_buffer[i];
|
||||
}
|
||||
uint8_t checksum_received = serial_read_byte();
|
||||
sync_recv();
|
||||
|
||||
if (checksum_computed != checksum_received) {
|
||||
sei();
|
||||
return 1;
|
||||
}
|
||||
|
||||
uint8_t checksum = 0;
|
||||
// send data to the slave
|
||||
for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) {
|
||||
serial_write_byte(serial_master_buffer[i]);
|
||||
sync_recv();
|
||||
checksum += serial_master_buffer[i];
|
||||
}
|
||||
serial_write_byte(checksum);
|
||||
sync_recv();
|
||||
|
||||
// always, release the line when not in use
|
||||
serial_output();
|
||||
serial_high();
|
||||
|
||||
sei();
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
@@ -1,26 +0,0 @@
|
||||
#ifndef MY_SERIAL_H
|
||||
#define MY_SERIAL_H
|
||||
|
||||
#include "config.h"
|
||||
#include <stdbool.h>
|
||||
|
||||
/* TODO: some defines for interrupt setup */
|
||||
#define SERIAL_PIN_DDR DDRD
|
||||
#define SERIAL_PIN_PORT PORTD
|
||||
#define SERIAL_PIN_INPUT PIND
|
||||
#define SERIAL_PIN_MASK _BV(PD0)
|
||||
#define SERIAL_PIN_INTERRUPT INT0_vect
|
||||
|
||||
#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2
|
||||
#define SERIAL_MASTER_BUFFER_LENGTH 1
|
||||
|
||||
// Buffers for master - slave communication
|
||||
extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH];
|
||||
extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH];
|
||||
|
||||
void serial_master_init(void);
|
||||
void serial_slave_init(void);
|
||||
int serial_update_buffers(void);
|
||||
bool serial_slave_data_corrupt(void);
|
||||
|
||||
#endif
|
@@ -1,86 +0,0 @@
|
||||
#include <avr/io.h>
|
||||
#include <avr/wdt.h>
|
||||
#include <avr/power.h>
|
||||
#include <avr/interrupt.h>
|
||||
#include <util/delay.h>
|
||||
#include <avr/eeprom.h>
|
||||
#include "split_util.h"
|
||||
#include "matrix.h"
|
||||
#include "keyboard.h"
|
||||
#include "config.h"
|
||||
#include "timer.h"
|
||||
|
||||
#ifdef USE_I2C
|
||||
# include "i2c.h"
|
||||
#else
|
||||
# include "serial.h"
|
||||
#endif
|
||||
|
||||
volatile bool isLeftHand = true;
|
||||
|
||||
static void setup_handedness(void) {
|
||||
#ifdef EE_HANDS
|
||||
isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS);
|
||||
#else
|
||||
// I2C_MASTER_RIGHT is deprecated, use MASTER_RIGHT instead, since this works for both serial and i2c
|
||||
#if defined(I2C_MASTER_RIGHT) || defined(MASTER_RIGHT)
|
||||
isLeftHand = !has_usb();
|
||||
#else
|
||||
isLeftHand = has_usb();
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
static void keyboard_master_setup(void) {
|
||||
#ifdef USE_I2C
|
||||
i2c_master_init();
|
||||
#ifdef SSD1306OLED
|
||||
matrix_master_OLED_init ();
|
||||
#endif
|
||||
#else
|
||||
serial_master_init();
|
||||
#endif
|
||||
}
|
||||
|
||||
static void keyboard_slave_setup(void) {
|
||||
timer_init();
|
||||
#ifdef USE_I2C
|
||||
i2c_slave_init(SLAVE_I2C_ADDRESS);
|
||||
#else
|
||||
serial_slave_init();
|
||||
#endif
|
||||
}
|
||||
|
||||
bool has_usb(void) {
|
||||
USBCON |= (1 << OTGPADE); //enables VBUS pad
|
||||
_delay_us(5);
|
||||
return (USBSTA & (1<<VBUS)); //checks state of VBUS
|
||||
}
|
||||
|
||||
void split_keyboard_setup(void) {
|
||||
setup_handedness();
|
||||
|
||||
if (has_usb()) {
|
||||
keyboard_master_setup();
|
||||
} else {
|
||||
keyboard_slave_setup();
|
||||
}
|
||||
sei();
|
||||
}
|
||||
|
||||
void keyboard_slave_loop(void) {
|
||||
matrix_init();
|
||||
|
||||
while (1) {
|
||||
matrix_slave_scan();
|
||||
}
|
||||
}
|
||||
|
||||
// this code runs before the usb and keyboard is initialized
|
||||
void matrix_setup(void) {
|
||||
split_keyboard_setup();
|
||||
|
||||
if (!has_usb()) {
|
||||
keyboard_slave_loop();
|
||||
}
|
||||
}
|
@@ -1,20 +0,0 @@
|
||||
#ifndef SPLIT_KEYBOARD_UTIL_H
|
||||
#define SPLIT_KEYBOARD_UTIL_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#include "eeconfig.h"
|
||||
|
||||
#define SLAVE_I2C_ADDRESS 0x32
|
||||
|
||||
extern volatile bool isLeftHand;
|
||||
|
||||
// slave version of matix scan, defined in matrix.c
|
||||
void matrix_slave_scan(void);
|
||||
|
||||
void split_keyboard_setup(void);
|
||||
bool has_usb(void);
|
||||
void keyboard_slave_loop(void);
|
||||
|
||||
void matrix_master_OLED_init (void);
|
||||
|
||||
#endif
|
15
keyboards/evil80/readme.md
Normal file
15
keyboards/evil80/readme.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# Evil 80
|
||||
|
||||

|
||||
|
||||
Also known as the Odyssey, the Evil 80 is a QMK-powered aluminum TKL keyboard featuring an Aviator connector cable. Sold via a Geekhack group buy in January of 2018.
|
||||
|
||||
Keyboard Maintainer: [The QMK Community](https://github.com/qmk)
|
||||
Hardware Supported: Evil 80-Odyssey QMK version
|
||||
Hardware Availability: [Geekhack](https://geekhack.org/index.php?topic=93434.0)
|
||||
|
||||
Make example for this keyboard (after setting up your build environment):
|
||||
|
||||
make evil80: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).
|
@@ -27,3 +27,17 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define AUDIO_CLICKY
|
||||
#endif
|
||||
|
||||
// If you need more program area, try select and reduce rgblight modes to use.
|
||||
|
||||
// Selection of RGBLIGHT MODE to use.
|
||||
#if defined(LED_ANIMATIONS)
|
||||
#define RGBLIGHT_EFFECT_BREATHING
|
||||
#define RGBLIGHT_EFFECT_RAINBOW_MOOD
|
||||
#define RGBLIGHT_EFFECT_RAINBOW_SWIRL
|
||||
#define RGBLIGHT_EFFECT_SNAKE
|
||||
#define RGBLIGHT_EFFECT_KNIGHT
|
||||
#define RGBLIGHT_EFFECT_CHRISTMAS
|
||||
#define RGBLIGHT_EFFECT_STATIC_GRADIENT
|
||||
//#define RGBLIGHT_EFFECT_RGB_TEST
|
||||
//#define RGBLIGHT_EFFECT_ALTERNATING
|
||||
#endif
|
||||
|
@@ -92,7 +92,7 @@ ifeq ($(strip $(IOS_DEVICE_ENABLE)), yes)
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(LED_ANIMATIONS)), yes)
|
||||
OPT_DEFS += -DRGBLIGHT_ANIMATIONS
|
||||
OPT_DEFS += -DLED_ANIMATIONS
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(OLED_ENABLE)), yes)
|
||||
|
@@ -28,4 +28,19 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define AUDIO_CLICKY
|
||||
#endif
|
||||
|
||||
// If you need more program area, try select and reduce rgblight modes to use.
|
||||
|
||||
// Selection of RGBLIGHT MODE to use.
|
||||
#if defined(LED_ANIMATIONS)
|
||||
#define RGBLIGHT_EFFECT_BREATHING
|
||||
#define RGBLIGHT_EFFECT_RAINBOW_MOOD
|
||||
#define RGBLIGHT_EFFECT_RAINBOW_SWIRL
|
||||
#define RGBLIGHT_EFFECT_SNAKE
|
||||
#define RGBLIGHT_EFFECT_KNIGHT
|
||||
#define RGBLIGHT_EFFECT_CHRISTMAS
|
||||
#define RGBLIGHT_EFFECT_STATIC_GRADIENT
|
||||
//#define RGBLIGHT_EFFECT_RGB_TEST
|
||||
//#define RGBLIGHT_EFFECT_ALTERNATING
|
||||
#endif
|
||||
|
||||
#endif /* CONFIG_USER_H */
|
||||
|
@@ -238,7 +238,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
} else {
|
||||
TOG_STATUS = !TOG_STATUS;
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
//rgblight_mode(16);
|
||||
//rgblight_mode(RGBLIGHT_MODE_SNAKE + 1);
|
||||
#endif
|
||||
}
|
||||
layer_on(_LOWER);
|
||||
@@ -261,7 +261,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
} else {
|
||||
TOG_STATUS = !TOG_STATUS;
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
//rgblight_mode(15);
|
||||
//rgblight_mode(RGBLIGHT_MODE_SNAKE);
|
||||
#endif
|
||||
}
|
||||
layer_on(_RAISE);
|
||||
|
@@ -92,7 +92,7 @@ ifeq ($(strip $(IOS_DEVICE_ENABLE)), yes)
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(LED_ANIMATIONS)), yes)
|
||||
OPT_DEFS += -DRGBLIGHT_ANIMATIONS
|
||||
OPT_DEFS += -DLED_ANIMATIONS
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(OLED_ENABLE)), yes)
|
||||
|
@@ -368,7 +368,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
if (TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false
|
||||
} else {
|
||||
TOG_STATUS = !TOG_STATUS;
|
||||
rgblight_mode(16);
|
||||
rgblight_mode(RGBLIGHT_MODE_SNAKE + 1);
|
||||
}
|
||||
layer_on(_LOWER);
|
||||
update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST);
|
||||
@@ -387,7 +387,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
if (TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false
|
||||
} else {
|
||||
TOG_STATUS = !TOG_STATUS;
|
||||
rgblight_mode(15);
|
||||
rgblight_mode(RGBLIGHT_MODE_SNAKE);
|
||||
}
|
||||
layer_on(_RAISE);
|
||||
update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST);
|
||||
|
@@ -21,9 +21,21 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#ifndef CONFIG_USER_H
|
||||
#define CONFIG_USER_H
|
||||
|
||||
// if you need more program area, try uncomment follow line
|
||||
//#include "serial_config_simpleapi.h"
|
||||
|
||||
// place overrides here
|
||||
|
||||
// If you need more program area, try select and reduce rgblight modes to use.
|
||||
|
||||
// Selection of RGBLIGHT MODE to use.
|
||||
#if defined(LED_ANIMATIONS)
|
||||
#define RGBLIGHT_EFFECT_BREATHING
|
||||
#define RGBLIGHT_EFFECT_RAINBOW_MOOD
|
||||
#define RGBLIGHT_EFFECT_RAINBOW_SWIRL
|
||||
#define RGBLIGHT_EFFECT_SNAKE
|
||||
#define RGBLIGHT_EFFECT_KNIGHT
|
||||
#define RGBLIGHT_EFFECT_CHRISTMAS
|
||||
#define RGBLIGHT_EFFECT_STATIC_GRADIENT
|
||||
//#define RGBLIGHT_EFFECT_RGB_TEST
|
||||
//#define RGBLIGHT_EFFECT_ALTERNATING
|
||||
#endif
|
||||
|
||||
#endif /* CONFIG_USER_H */
|
||||
|
@@ -373,7 +373,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
} else {
|
||||
TOG_STATUS = !TOG_STATUS;
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
//rgblight_mode(16);
|
||||
//rgblight_mode(RGBLIGHT_MODE_SNAKE + 1);
|
||||
#endif
|
||||
}
|
||||
layer_on(_LOWER);
|
||||
@@ -396,7 +396,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
} else {
|
||||
TOG_STATUS = !TOG_STATUS;
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
//rgblight_mode(15);
|
||||
//rgblight_mode(RGBLIGHT_MODE_SNAKE);
|
||||
#endif
|
||||
}
|
||||
layer_on(_RAISE);
|
||||
|
@@ -100,7 +100,7 @@ ifeq ($(strip $(IOS_DEVICE_ENABLE)), yes)
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(LED_ANIMATIONS)), yes)
|
||||
OPT_DEFS += -DRGBLIGHT_ANIMATIONS
|
||||
OPT_DEFS += -DLED_ANIMATIONS
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(OLED_ENABLE)), yes)
|
||||
|
@@ -1,11 +1,23 @@
|
||||
#ifndef CONFIG_USER_H
|
||||
#define CONFIG_USER_H
|
||||
|
||||
// if you need more program area, try uncomment follow line
|
||||
//#include "serial_config_simpleapi.h"
|
||||
|
||||
#undef TAPPING_FORCE_HOLD
|
||||
#undef TAPPING_TERM
|
||||
#define TAPPING_TERM 120
|
||||
|
||||
// If you need more program area, try select and reduce rgblight modes to use.
|
||||
|
||||
// Selection of RGBLIGHT MODE to use.
|
||||
#if defined(LED_ANIMATIONS)
|
||||
#define RGBLIGHT_EFFECT_BREATHING
|
||||
#define RGBLIGHT_EFFECT_RAINBOW_MOOD
|
||||
#define RGBLIGHT_EFFECT_RAINBOW_SWIRL
|
||||
#define RGBLIGHT_EFFECT_SNAKE
|
||||
#define RGBLIGHT_EFFECT_KNIGHT
|
||||
#define RGBLIGHT_EFFECT_CHRISTMAS
|
||||
#define RGBLIGHT_EFFECT_STATIC_GRADIENT
|
||||
//#define RGBLIGHT_EFFECT_RGB_TEST
|
||||
//#define RGBLIGHT_EFFECT_ALTERNATING
|
||||
#endif
|
||||
|
||||
#endif /* CONFIG_USER_H */
|
||||
|
@@ -35,7 +35,7 @@ void matrix_scan_user(void) {
|
||||
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
uint32_t layer_state_set_keymap(uint32_t state) {
|
||||
rgblight_mode_noeeprom(1);
|
||||
rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT);
|
||||
switch (biton32(state)) {
|
||||
case _EDVORAKJ1:
|
||||
case _EDVORAKJ2:
|
||||
@@ -52,7 +52,7 @@ uint32_t layer_state_set_keymap(uint32_t state) {
|
||||
rgblight_sethsv_noeeprom_green();
|
||||
break;
|
||||
default: // for any other layers, or the default layer
|
||||
rgblight_mode_noeeprom(28);
|
||||
rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_GRADIENT + 3);
|
||||
rgblight_sethsv_noeeprom_red();
|
||||
break;
|
||||
}
|
||||
|
@@ -102,7 +102,7 @@ ifeq ($(strip $(IOS_DEVICE_ENABLE)), yes)
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(LED_ANIMATIONS)), yes)
|
||||
OPT_DEFS += -DRGBLIGHT_ANIMATIONS
|
||||
OPT_DEFS += -DLED_ANIMATIONS
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(OLED_ENABLE)), yes)
|
||||
|
@@ -23,9 +23,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
// place overrides here
|
||||
|
||||
// if you need more program area, try uncomment follow line
|
||||
//#include "serial_config_simpleapi.h"
|
||||
|
||||
#ifdef MOUSEKEY_ENABLE
|
||||
#undef MOUSEKEY_INTERVAL
|
||||
#define MOUSEKEY_INTERVAL 0
|
||||
@@ -43,4 +40,19 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define MOUSEKEY_DELAY 0
|
||||
#endif
|
||||
|
||||
// If you need more program area, try select and reduce rgblight modes to use.
|
||||
|
||||
// Selection of RGBLIGHT MODE to use.
|
||||
#if defined(LED_ANIMATIONS)
|
||||
#define RGBLIGHT_EFFECT_BREATHING
|
||||
#define RGBLIGHT_EFFECT_RAINBOW_MOOD
|
||||
#define RGBLIGHT_EFFECT_RAINBOW_SWIRL
|
||||
#define RGBLIGHT_EFFECT_SNAKE
|
||||
#define RGBLIGHT_EFFECT_KNIGHT
|
||||
#define RGBLIGHT_EFFECT_CHRISTMAS
|
||||
#define RGBLIGHT_EFFECT_STATIC_GRADIENT
|
||||
//#define RGBLIGHT_EFFECT_RGB_TEST
|
||||
//#define RGBLIGHT_EFFECT_ALTERNATING
|
||||
#endif
|
||||
|
||||
#endif /* CONFIG_USER_H */
|
||||
|
@@ -100,7 +100,7 @@ ifeq ($(strip $(IOS_DEVICE_ENABLE)), yes)
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(LED_ANIMATIONS)), yes)
|
||||
OPT_DEFS += -DRGBLIGHT_ANIMATIONS
|
||||
OPT_DEFS += -DLED_ANIMATIONS
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(OLED_ENABLE)), yes)
|
||||
|
@@ -21,12 +21,24 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#ifndef CONFIG_USER_H
|
||||
#define CONFIG_USER_H
|
||||
|
||||
// if you need more program area, try uncomment follow line
|
||||
//#include "serial_config_simpleapi.h"
|
||||
|
||||
#undef TAPPING_TERM
|
||||
#define TAPPING_TERM 200
|
||||
#define ONESHOT_TAP_TOGGLE 5 /* Tapping this number of times holds the key until tapped this number of times again. */
|
||||
#define ONESHOT_TIMEOUT 5000 /* Time (in ms) before the one shot key is released */
|
||||
|
||||
// If you need more program area, try select and reduce rgblight modes to use.
|
||||
|
||||
// Selection of RGBLIGHT MODE to use.
|
||||
#if defined(LED_ANIMATIONS)
|
||||
#define RGBLIGHT_EFFECT_BREATHING
|
||||
#define RGBLIGHT_EFFECT_RAINBOW_MOOD
|
||||
#define RGBLIGHT_EFFECT_RAINBOW_SWIRL
|
||||
#define RGBLIGHT_EFFECT_SNAKE
|
||||
#define RGBLIGHT_EFFECT_KNIGHT
|
||||
#define RGBLIGHT_EFFECT_CHRISTMAS
|
||||
#define RGBLIGHT_EFFECT_STATIC_GRADIENT
|
||||
//#define RGBLIGHT_EFFECT_RGB_TEST
|
||||
//#define RGBLIGHT_EFFECT_ALTERNATING
|
||||
#endif
|
||||
|
||||
#endif /* CONFIG_USER_H */
|
||||
|
@@ -399,7 +399,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
if (record->event.pressed) {
|
||||
RGBAnimation = true;
|
||||
rgblight_mode(6);
|
||||
rgblight_mode(RGBLIGHT_MODE_RAINBOW_MOOD);
|
||||
RGB_current_mode = rgblight_config.mode;
|
||||
}
|
||||
#endif
|
||||
@@ -408,7 +408,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
if (record->event.pressed) {
|
||||
RGBAnimation = true;
|
||||
rgblight_mode(10);
|
||||
rgblight_mode(RGBLIGHT_MODE_RAINBOW_SWIRL + 1);
|
||||
RGB_current_mode = rgblight_config.mode;
|
||||
}
|
||||
#endif
|
||||
@@ -417,7 +417,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
if (record->event.pressed) {
|
||||
RGBAnimation = true;
|
||||
rgblight_mode(21);
|
||||
rgblight_mode(RGBLIGHT_MODE_KNIGHT);
|
||||
RGB_current_mode = rgblight_config.mode;
|
||||
}
|
||||
#endif
|
||||
@@ -508,7 +508,7 @@ void led_ripple_effect(char r, char g, char b) {
|
||||
|
||||
if (scan_count == -1) {
|
||||
rgblight_enable_noeeprom();
|
||||
rgblight_mode(0);
|
||||
rgblight_mode(RGBLIGHT_MODE_STATIC_LIGHT);
|
||||
} else if (scan_count >= 0 && scan_count < 5) {
|
||||
for (unsigned char c=keybuf_begin; c!=keybuf_end; c++) {
|
||||
int i = c;
|
||||
|
@@ -100,7 +100,7 @@ ifeq ($(strip $(IOS_DEVICE_ENABLE)), yes)
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(LED_ANIMATIONS)), yes)
|
||||
OPT_DEFS += -DRGBLIGHT_ANIMATIONS
|
||||
OPT_DEFS += -DLED_ANIMATIONS
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(OLED_ENABLE)), yes)
|
||||
|
@@ -21,3 +21,18 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/* auto shift config */
|
||||
#define AUTO_SHIFT_TIMEOUT 150
|
||||
|
||||
// If you need more program area, try select and reduce rgblight modes to use.
|
||||
|
||||
// Selection of RGBLIGHT MODE to use.
|
||||
#if defined(LED_ANIMATIONS)
|
||||
#define RGBLIGHT_EFFECT_BREATHING
|
||||
#define RGBLIGHT_EFFECT_RAINBOW_MOOD
|
||||
#define RGBLIGHT_EFFECT_RAINBOW_SWIRL
|
||||
#define RGBLIGHT_EFFECT_SNAKE
|
||||
#define RGBLIGHT_EFFECT_KNIGHT
|
||||
#define RGBLIGHT_EFFECT_CHRISTMAS
|
||||
#define RGBLIGHT_EFFECT_STATIC_GRADIENT
|
||||
//#define RGBLIGHT_EFFECT_RGB_TEST
|
||||
//#define RGBLIGHT_EFFECT_ALTERNATING
|
||||
#endif
|
||||
|
@@ -312,7 +312,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
} else {
|
||||
TOG_STATUS = !TOG_STATUS;
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
//rgblight_mode(16);
|
||||
//rgblight_mode(RGBLIGHT_MODE_SNAKE + 1);
|
||||
#endif
|
||||
}
|
||||
layer_on(_LOWER);
|
||||
@@ -335,7 +335,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
} else {
|
||||
TOG_STATUS = !TOG_STATUS;
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
//rgblight_mode(15);
|
||||
//rgblight_mode(RGBLIGHT_MODE_SNAKE);
|
||||
#endif
|
||||
}
|
||||
layer_on(_RAISE);
|
||||
@@ -450,7 +450,7 @@ void music_scale_user(void)
|
||||
|
||||
// hook point for 'led_test' keymap
|
||||
// 'default' keymap's led_test_init() is empty function, do nothing
|
||||
// 'led_test' keymap's led_test_init() force rgblight_mode_noeeprom(35);
|
||||
// 'led_test' keymap's led_test_init() force rgblight_mode_noeeprom(RGBLIGHT_MODE_RGB_TEST);
|
||||
__attribute__ ((weak))
|
||||
void led_test_init(void) {}
|
||||
|
||||
|
@@ -99,7 +99,7 @@ ifeq ($(strip $(IOS_DEVICE_ENABLE)), yes)
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(LED_ANIMATIONS)), yes)
|
||||
OPT_DEFS += -DRGBLIGHT_ANIMATIONS
|
||||
OPT_DEFS += -DLED_ANIMATIONS
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(OLED_ENABLE)), yes)
|
||||
|
@@ -4,8 +4,10 @@
|
||||
#include "rev1.h"
|
||||
#elif KEYBOARD_iris_rev1_led
|
||||
#include "rev1_led.h"
|
||||
#else
|
||||
#elif KEYBOARD_iris_rev2
|
||||
#include "rev2.h"
|
||||
#else
|
||||
#include "rev3.h"
|
||||
#endif
|
||||
|
||||
#include "quantum.h"
|
||||
|
@@ -31,7 +31,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
#undef RGBLED_NUM
|
||||
#define RGBLED_NUM 18 // Number of LEDs
|
||||
#define RGBLIGHT_ANIMATIONS
|
||||
|
||||
#define RGBLIGHT_HUE_STEP 12
|
||||
#define RGBLIGHT_SAT_STEP 12
|
||||
#define RGBLIGHT_VAL_STEP 12
|
||||
|
@@ -2,42 +2,53 @@
|
||||
#include QMK_KEYBOARD_H
|
||||
#include "drashna.h"
|
||||
|
||||
|
||||
#define LAYOUT_iris_base( \
|
||||
K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \
|
||||
K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \
|
||||
K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A \
|
||||
) \
|
||||
LAYOUT_wrapper( \
|
||||
KC_ESC, ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, KC_MINS, \
|
||||
KC_TAB , K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_BSLS, \
|
||||
KC_C1R3, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_QUOT, \
|
||||
KC_MLSF, CTL_T(K21), K22, K23, K24, K25, ALT_APP, OS_RGUI, K26, K27, K28, K29, CTL_T(K2A), KC_MRSF, \
|
||||
LT(_LOWER,KC_GRV), KC_SPC, KC_BSPC, KC_DEL, KC_ENT, RAISE \
|
||||
)
|
||||
#define LAYOUT_iris_base_wrapper(...) LAYOUT_iris_base(__VA_ARGS__)
|
||||
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
[_QWERTY] = LAYOUT_wrapper(
|
||||
KC_ESC, ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, KC_MINS,
|
||||
KC_TAB , _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, KC_BSLS,
|
||||
KC_C1R3, _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, KC_QUOT,
|
||||
KC_MLSF, _________________QWERTY_L3_________________, ALT_APP, OS_RGUI, _________________QWERTY_R3_________________, KC_MRSF,
|
||||
LT(_LOWER,KC_GRV), KC_SPC, KC_BSPC, KC_DEL, KC_ENT, RAISE
|
||||
[_QWERTY] = LAYOUT_iris_base_wrapper(
|
||||
_________________QWERTY_L1_________________, _________________QWERTY_R1_________________,
|
||||
_________________QWERTY_L2_________________, _________________QWERTY_R2_________________,
|
||||
_________________QWERTY_L3_________________, _________________QWERTY_R3_________________
|
||||
),
|
||||
[_COLEMAK] = LAYOUT_wrapper(
|
||||
KC_ESC , ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, KC_MINS,
|
||||
KC_TAB , _________________COLEMAK_L1________________, _________________COLEMAK_R1________________, KC_BSLS,
|
||||
KC_C1R3, _________________COLEMAK_L2________________, _________________COLEMAK_R2________________, KC_QUOT,
|
||||
KC_MLSF, _________________COLEMAK_L3________________, ALT_APP, OS_RGUI, _________________COLEMAK_R3________________, KC_MRSF,
|
||||
LT(_LOWER,KC_GRV), KC_SPC, KC_BSPC, KC_DEL, KC_ENT, RAISE
|
||||
|
||||
[_COLEMAK] = LAYOUT_iris_base_wrapper(
|
||||
_________________COLEMAK_L1________________, _________________COLEMAK_R1________________,
|
||||
_________________COLEMAK_L2________________, _________________COLEMAK_R2________________,
|
||||
_________________COLEMAK_L3________________, _________________COLEMAK_R3________________
|
||||
),
|
||||
[_DVORAK] = LAYOUT_wrapper(
|
||||
KC_ESC, ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, KC_MINS,
|
||||
KC_TAB , _________________DVORAK_L1_________________, _________________DVORAK_R1_________________, KC_BSLS,
|
||||
KC_C1R3, _________________DVORAK_L2_________________, _________________DVORAK_R2_________________, KC_QUOT,
|
||||
KC_MLSF, _________________DVORAK_L3_________________, ALT_APP, OS_RGUI, _________________DVORAK_R3_________________, KC_MRSF,
|
||||
LT(_LOWER,KC_GRV), KC_SPC, KC_BSPC, KC_DEL, KC_ENT, RAISE
|
||||
|
||||
[_DVORAK] = LAYOUT_iris_base_wrapper(
|
||||
_________________DVORAK_L1_________________, _________________DVORAK_R1_________________,
|
||||
_________________DVORAK_L2_________________, _________________DVORAK_R2_________________,
|
||||
_________________DVORAK_L3_________________, _________________DVORAK_R3_________________
|
||||
),
|
||||
[_WORKMAN] = LAYOUT_wrapper(
|
||||
KC_ESC, ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, KC_MINS,
|
||||
KC_TAB , _________________WORKMAN_L1________________, _________________WORKMAN_R1________________, KC_BSLS,
|
||||
KC_C1R3, _________________WORKMAN_L2________________, _________________WORKMAN_R2________________, KC_QUOT,
|
||||
KC_MLSF, _________________WORKMAN_L3________________, ALT_APP, OS_RGUI, _________________WORKMAN_R3________________, KC_MRSF,
|
||||
LT(_LOWER,KC_GRV), KC_SPC, KC_BSPC, KC_DEL, KC_ENT, RAISE
|
||||
|
||||
[_WORKMAN] = LAYOUT_iris_base_wrapper(
|
||||
_________________WORKMAN_L1________________, _________________WORKMAN_R1________________,
|
||||
_________________WORKMAN_L2________________, _________________WORKMAN_R2________________,
|
||||
_________________WORKMAN_L3________________, _________________WORKMAN_R3________________
|
||||
),
|
||||
|
||||
[_MODS] = LAYOUT_wrapper(
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
KC_LSFT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_RSFT,
|
||||
_______, ___________________BLANK___________________, ___________________BLANK___________________, _______,
|
||||
_______, ___________________BLANK___________________, ___________________BLANK___________________, _______,
|
||||
_______, ___________________BLANK___________________, ___________________BLANK___________________, _______,
|
||||
KC_LSFT, ___________________BLANK___________________, _______, _______, ___________________BLANK___________________, KC_RSFT,
|
||||
_______, _______, _______, _______, _______, _______
|
||||
),
|
||||
|
||||
|
@@ -8,10 +8,10 @@ RGBLIGHT_ENABLE = yes
|
||||
AUDIO_ENABLE = yes
|
||||
NKRO_ENABLE = yes
|
||||
BACKLIGHT_ENABLE = no
|
||||
SWAP_HANDS_ENABLE = no
|
||||
SWAP_HANDS_ENABLE = yes
|
||||
|
||||
INDICATOR_LIGHTS = yes
|
||||
MACROS_ENABLED = no
|
||||
RGBLIGHT_TWINKLE = no
|
||||
RGBLIGHT_TWINKLE = yes
|
||||
|
||||
BOOTLOADER = qmk-dfu
|
||||
|
34
keyboards/iris/keymaps/vyolle_steno/config.h
Normal file
34
keyboards/iris/keymaps/vyolle_steno/config.h
Normal file
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
Copyright 2017 Danny Nguyen <danny@hexwire.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
|
||||
|
||||
/* Use I2C or Serial, not both */
|
||||
|
||||
#define USE_I2C
|
||||
// #define USE_SERIAL
|
||||
|
||||
|
||||
#define FORCE_NKRO //For Steno.
|
||||
|
||||
/* Select hand configuration */
|
||||
|
||||
#define MASTER_LEFT
|
||||
// #define MASTER_RIGHT
|
||||
// #define EE_HANDS
|
||||
|
||||
|
149
keyboards/iris/keymaps/vyolle_steno/keymap.c
Normal file
149
keyboards/iris/keymaps/vyolle_steno/keymap.c
Normal file
@@ -0,0 +1,149 @@
|
||||
#include QMK_KEYBOARD_H
|
||||
#include "keymap_steno.h"
|
||||
|
||||
extern keymap_config_t keymap_config;
|
||||
|
||||
#define _QWERTY 0
|
||||
#define _LOWER 1
|
||||
#define _RAISE 2
|
||||
#define _PLOVER 3
|
||||
#define _ADJUST 4
|
||||
|
||||
enum custom_keycodes {
|
||||
QWERTY = SAFE_RANGE,
|
||||
LOWER,
|
||||
RAISE,
|
||||
ADJUST,
|
||||
PLOVER,
|
||||
EXT_PLV,
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
[_QWERTY] = LAYOUT(
|
||||
//┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐
|
||||
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, PLOVER,
|
||||
//├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,
|
||||
//├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤
|
||||
RAISE, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_QUOT, KC_RBRC,
|
||||
//├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_BSPC, KC_RSFT, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LGUI,
|
||||
//└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘
|
||||
KC_LCTL, LOWER, KC_SPC, KC_BSPC, KC_ENT, KC_LALT
|
||||
// └────────┴────────┴────────┘ └────────┴────────┴────────┘
|
||||
),
|
||||
|
||||
[_LOWER] = LAYOUT(
|
||||
//┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐
|
||||
KC_DEL, KC_0, KC_9, KC_8, KC_7, KC_6, _______, _______, _______, _______, _______, _______,
|
||||
//├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤
|
||||
KC_SCLN, KC_P, KC_O, KC_I, KC_U, KC_Y, _______, _______, _______, _______, _______, _______,
|
||||
//├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤
|
||||
_______, KC_QUOT, KC_L, KC_K, KC_J, KC_H, _______, KC_LEFT, KC_UP, KC_RGHT, KC_SCLN, _______,
|
||||
//├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤
|
||||
KC_ENT, KC_SLSH, KC_DOT, KC_COMM, KC_M, KC_N, KC_LALT, _______, _______, _______, KC_DOWN, _______, _______, _______,
|
||||
//└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘
|
||||
_______, _______, KC_LGUI, _______, _______, _______
|
||||
// └────────┴────────┴────────┘ └────────┴────────┴────────┘
|
||||
),
|
||||
|
||||
[_RAISE] = LAYOUT(
|
||||
//┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐
|
||||
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_VOLU, KC_LEFT, KC_UP, KC_RGHT, KC_INS, _______, _______, _______, _______, _______, _______,
|
||||
//├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤
|
||||
KC_MUTE, KC_VOLD, KC_PGUP, KC_DOWN, KC_PGDN, KC_DEL, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
//└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘
|
||||
_______, _______, KC_LALT, _______, _______, _______
|
||||
// └────────┴────────┴────────┘ └────────┴────────┴────────┘
|
||||
),
|
||||
|
||||
[_ADJUST] = LAYOUT(
|
||||
//┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐
|
||||
KC_GRV, KC_HOME, KC_LBRC, KC_RBRC, KC_PIPE, KC_APP, KC_SLCK, _______, _______, _______, _______, _______,
|
||||
//├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤
|
||||
KC_PSCR, KC_END, KC_LCBR, KC_RCBR, KC_PLUS, KC_EQL, KC_PAUS, _______, _______, _______, _______, _______,
|
||||
//├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤
|
||||
_______, _______, _______, KC_BSLS, KC_MINS, KC_UNDS, _______, _______, _______, _______, _______, _______,
|
||||
//├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
//└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘
|
||||
_______, _______, _______, _______, _______, _______
|
||||
// └────────┴────────┴────────┘ └────────┴────────┴────────┘
|
||||
),
|
||||
|
||||
[_PLOVER] = LAYOUT(
|
||||
//┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐
|
||||
STN_PWR, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, EXT_PLV,
|
||||
//├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤
|
||||
STN_N1, STN_N2, STN_N3, STN_N4, STN_N5, STN_N6, STN_N7, STN_N8, STN_N9, STN_NA, STN_NB, STN_NC,
|
||||
//├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤
|
||||
STN_FN, STN_S1, STN_TL, STN_PL, STN_HL, STN_ST1, STN_ST3, STN_FR, STN_PR, STN_LR, STN_TR, STN_DR,
|
||||
//├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤
|
||||
XXXXXXX, STN_S2, STN_KL, STN_WL, STN_RL, STN_ST2, STN_RE1, STN_RE2, STN_ST4, STN_RR, STN_BR, STN_GR, STN_SR, STN_ZR,
|
||||
//└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘
|
||||
XXXXXXX, STN_A, STN_O, STN_E, STN_U, XXXXXXX
|
||||
// └────────┴────────┴────────┘ └────────┴────────┴────────┘
|
||||
)
|
||||
};
|
||||
|
||||
|
||||
void matrix_init_user() {
|
||||
steno_set_mode(STENO_MODE_GEMINI); // or STENO_MODE_BOLT
|
||||
}
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
switch (keycode) {
|
||||
case QWERTY:
|
||||
if (record->event.pressed) {
|
||||
set_single_persistent_default_layer(_QWERTY);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case LOWER:
|
||||
if (record->event.pressed) {
|
||||
layer_on(_LOWER);
|
||||
update_tri_layer(_LOWER, _RAISE, _ADJUST);
|
||||
} else {
|
||||
layer_off(_LOWER);
|
||||
update_tri_layer(_LOWER, _RAISE, _ADJUST);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case RAISE:
|
||||
if (record->event.pressed) {
|
||||
layer_on(_RAISE);
|
||||
update_tri_layer(_LOWER, _RAISE, _ADJUST);
|
||||
} else {
|
||||
layer_off(_RAISE);
|
||||
update_tri_layer(_LOWER, _RAISE, _ADJUST);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case ADJUST:
|
||||
if (record->event.pressed) {
|
||||
layer_on(_ADJUST);
|
||||
} else {
|
||||
layer_off(_ADJUST);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case PLOVER:
|
||||
if (!record->event.pressed) {
|
||||
layer_on(_PLOVER);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case EXT_PLV:
|
||||
if (record->event.pressed) {
|
||||
layer_off(_PLOVER);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
7
keyboards/iris/keymaps/vyolle_steno/rules.mk
Normal file
7
keyboards/iris/keymaps/vyolle_steno/rules.mk
Normal file
@@ -0,0 +1,7 @@
|
||||
EXTRAKEY_ENABLE = no
|
||||
MOUSEKEY_ENABLE = no # Mouse keys(+4700)
|
||||
STENO_ENABLE = yes # Additional protocols for Stenography(+1700), requires VIRTSER
|
||||
AUDIO_ENABLE = no # Audio output on port C6
|
||||
MIDI_ENABLE = no # MIDI controls
|
||||
NKRO_ENABLE = yes
|
||||
BOOTMAGIC_ENABLE = yes
|
@@ -65,8 +65,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define RGB_DI_PIN D3
|
||||
#define RGBLIGHT_TIMER
|
||||
#define RGBLED_NUM 12 // Number of LEDs
|
||||
#define ws2812_PORTREG PORTD
|
||||
#define ws2812_DDRREG DDRD
|
||||
|
||||
/*
|
||||
* Feature disable options
|
||||
|
@@ -65,8 +65,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define RGB_DI_PIN D3
|
||||
#define RGBLIGHT_TIMER
|
||||
#define RGBLED_NUM 12 // Number of LEDs
|
||||
#define ws2812_PORTREG PORTD
|
||||
#define ws2812_DDRREG DDRD
|
||||
|
||||
/*
|
||||
* Feature disable options
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user