Compare commits

...
14 Commits
Author SHA1 Message Date
Jon Arintok 346cbd8816 Add 3 speed mousekey movement option (#2246)
This allows for constant, non-accelerated mouse movement, while retaining the original functionality. Configurable by a define.
2019-03-26 19:34:33 -07:00
Fabien Culpo 509668ca7c [Keymap] add redox/rev1:fculpo keymap (#5491) 2019-03-26 18:41:37 -07:00
Danny d8371b3380 [Keymap] Update iris default (#5489)
* Update Iris default to include KC_GRV on base layer and match Configurator default

* Update default config
2019-03-26 18:40:01 -07:00
zvecr 9ef21d2e1c Refactor staryu to current standards and enable support for backlight keycodes (#5487) 2019-03-26 18:39:09 -07:00
Ryan Caltabiano a0270b55e1 Fixing Ergodox_EZ rgb_led initialization 2019-03-26 16:34:02 -07:00
DDRnJn b90df560f8 Added songs from Nier and Nier Automata
Added song of the ancients and kaine salvation fron Nier
Added Amusement park, Copied city, Vague Hope cold rain and weight of the world from Nier Automata
2019-03-24 17:13:07 -07:00
fauxpark 3510d8dc8d Document an annoyance with Grave Escape and macOS Terminal (#5483) 2019-03-24 17:11:26 -07:00
Max f1d921bee6 Bugfix for recently integrated cypher keyboard (#5481)
* fixed issue with LED indicators
corrected error in info.json

* fixed issue with led indictors
2019-03-24 14:00:48 -07:00
Takeshi ISHII bfc16765f4 add keyboards/mxss/rgblight.h from e661f1559:quantum/rgblight.h (#5461)
This PR is cherry-pick from 90b9a1aa7d8a in PR #5020.

@MxBlu copied quantum/rgblight.c to keyboards/mxss/rgblight.c on July 8, 2018. At that time, I think it would be better to copy quantum/rgblight.h at the same time.
Because if someone makes a change to `quantum/rgblight.[ch]` that is incompatible with the past, it may cause problems with the compilation of keyboards/mxss.
(Like when I changed the prototype of the `rgblight_effect_XXX()` functions of rgblight.c in PR #5020.)
2019-03-23 22:23:50 -07:00
Rob Hilgefort 74e05f3451 [Keymap] Planck Keymap :: rjhiglefort (#5059)
* copy default over as starting point

* Getting rid of dvorak and colemak for now, added a couple changes to the
keymap

* removed refs to bad layers, formatting comments

* First version of my ergodox ported layout!

* Symbols layer, media layer, updated comments

* Hyper as a single key

* Fix stuck hyper key when switching layers

* Tweak some annoying things about the layout.

- move raise left and promote alt
- remove swap keys on the last layer
- reorganize media keys so they're easier to reach and more intuitive
- fix some comment template things

* Add readme for rjhilgefort planck layout

* readme tweak

* PR feedback changes
2019-03-23 17:22:40 -07:00
Danny f077204fae Add support for RGB LEDs wired directly to each half's controller (#5392)
* Add support for wiring RGB LEDs for both halves directly to their respective controllers

RGB LEDs for each half don't need to be chained together across the TRRS cable with this

* Add split RGB LED support for serial

* Update config/rules for bakingpy layout

* Un-nest ifdefs for hand detection

* Read RGB config state from memory instead of EEPROM for serial updates

* Reuse existing LED pointer instead of creating new one
2019-03-23 17:20:14 -07:00
Max 23086808a7 [Keyboard] added cypher keyboard support (#5466)
* added the cypher qmk configuration

* Update keyboards/westfoxtrot/cypher/cypher.h

Co-Authored-By: westfoxtrot <[email protected]>

* Update keyboards/westfoxtrot/cypher/cypher.h

Co-Authored-By: westfoxtrot <[email protected]>

* Update keyboards/westfoxtrot/cypher/cypher.h

Co-Authored-By: westfoxtrot <[email protected]>

* Update keyboards/westfoxtrot/cypher/cypher.h

Co-Authored-By: westfoxtrot <[email protected]>

* Update keyboards/westfoxtrot/cypher/keymaps/default/keymap.c

Co-Authored-By: westfoxtrot <[email protected]>

* Update keyboards/westfoxtrot/cypher/keymaps/default/keymap.c

Co-Authored-By: westfoxtrot <[email protected]>

* Update keyboards/westfoxtrot/cypher/keymaps/default/keymap.c

Co-Authored-By: westfoxtrot <[email protected]>

* Update keyboards/westfoxtrot/cypher/info.json

Co-Authored-By: westfoxtrot <[email protected]>

* Update keyboards/westfoxtrot/cypher/info.json

Co-Authored-By: westfoxtrot <[email protected]>

* Update keyboards/westfoxtrot/cypher/keymaps/default-iso/keymap.c

Co-Authored-By: westfoxtrot <[email protected]>

* Update keyboards/westfoxtrot/cypher/keymaps/default-iso/keymap.c

Co-Authored-By: westfoxtrot <[email protected]>

* Update keyboards/westfoxtrot/cypher/keymaps/default-iso/keymap.c

Co-Authored-By: westfoxtrot <[email protected]>

* Update keyboards/westfoxtrot/cypher/readme.md

Co-Authored-By: westfoxtrot <[email protected]>

* Update keyboards/westfoxtrot/cypher/readme.md

Co-Authored-By: westfoxtrot <[email protected]>

* made modifications as per requests

* removed endif from cypher.h
2019-03-23 11:13:59 -07:00
tomholford 3529384c12 [Keymap] Add custom Planck Light keymap (#5464)
* Create custom Planck Light keycap

See README for details

* Link to WhatPulse in README

* More remapping, and add RGB LED effects

* Remove dead code, address PR feedback from drashna
2019-03-22 21:26:32 -07:00
stanrc85 3a7816843c [Keymap] New tap dance code added to userspace and keymaps (#5468)
* Adding new tap dance key

* Adding new tap dance code

* add code for copy/paste to tap dance

* testing tap dance enums

* New tap dance keycodes

* Fix enums
2019-03-22 20:50:56 -07:00
57 changed files with 2611 additions and 547 deletions

No files matched your search

+9 -2
View File
@@ -171,11 +171,15 @@ If you define these options you will enable the associated feature, which may in
## RGB Light Configuration ## RGB Light Configuration
* `#define RGB_DI_PIN D7` * `#define RGB_DI_PIN D7`
* pin the DI on the ws2812 is hooked-up to * pin the DI on the WS2812 is hooked-up to
* `#define RGBLIGHT_ANIMATIONS` * `#define RGBLIGHT_ANIMATIONS`
* run RGB animations * run RGB animations
* `#define RGBLED_NUM 15` * `#define RGBLED_NUM 12`
* number of LEDs * number of LEDs
* `#define RGBLED_SPLIT { 6, 6 }`
* number of LEDs connected that are directly wired to `RGB_DI_PIN` on each half of a split keyboard
* First value indicates number of LEDs for left half, second value is for the right half
* Needed if both halves of the board have RGB LEDs wired directly to the RGB output pin on the controllers instead of passing the output of the left half to the input of the right half
* `#define RGBLIGHT_HUE_STEP 12` * `#define RGBLIGHT_HUE_STEP 12`
* units to step when in/decreasing hue * units to step when in/decreasing hue
* `#define RGBLIGHT_SAT_STEP 25` * `#define RGBLIGHT_SAT_STEP 25`
@@ -236,6 +240,9 @@ There are a few different ways to set handedness for split keyboards (listed in
* `#define MATRIX_COL_PINS_RIGHT { <col pins> }` * `#define MATRIX_COL_PINS_RIGHT { <col pins> }`
* If you want to specify a different pinout for the right half than the left half, you can define `MATRIX_ROW_PINS_RIGHT`/`MATRIX_COL_PINS_RIGHT`. Currently, the size of `MATRIX_ROW_PINS` must be the same as `MATRIX_ROW_PINS_RIGHT` and likewise for the definition of columns. * If you want to specify a different pinout for the right half than the left half, you can define `MATRIX_ROW_PINS_RIGHT`/`MATRIX_COL_PINS_RIGHT`. Currently, the size of `MATRIX_ROW_PINS` must be the same as `MATRIX_ROW_PINS_RIGHT` and likewise for the definition of columns.
* `#define RGBLED_SPLIT { 6, 6 }`
* See [RGB Light Configuration](#rgb-light-configuration)
* `#define SELECT_SOFT_SERIAL_SPEED <speed>` (default speed is 1) * `#define SELECT_SOFT_SERIAL_SPEED <speed>` (default speed is 1)
* Sets the protocol speed when using serial communication * Sets the protocol speed when using serial communication
* Speeds: * Speeds:
+1 -1
View File
@@ -18,7 +18,7 @@ If Mary presses GESC on her keyboard, the OS will see an KC_ESC character. Now i
### Caveats ### Caveats
* On macOS CMD/GUI + KC_GRV is actually mapped to a hot key so it will not output a backtick. On macOS, Command+<code>&#96;</code> is by default mapped to "Move focus to next window" so it will not output a backtick. Additionally, Terminal always recognises this shortcut to cycle between windows, even if the shortcut is changed in the Keyboard preferences.
## Configuration ## Configuration
+68 -35
View File
@@ -1,48 +1,48 @@
# Mousekeys # Mousekeys
Mousekeys is a feature that allows you to emulate a mouse using your keyboard. You can move the pointer around, click up to 5 buttons, and even scroll in all 4 directions. QMK uses the same algorithm as the X Window System MouseKeysAccel feature. You can read more about it [on Wikipedia](https://en.wikipedia.org/wiki/Mouse_keys). Mousekeys is a feature that allows you to emulate a mouse using your keyboard. You can move the pointer around, click up to 5 buttons, and even scroll in all 4 directions.
## Adding Mousekeys to a Keymap There are 2 ways to define how the mousekeys behave, using "[auto-accelerating](#configuring-the-behavior-of-mousekeys-with-auto-accelerated-movement)" or "[3-speed constant](#configuring-the-behavior-of-mousekeys-with-3-speed-constant-movement)" behavior.
There are two steps to adding Mousekeys support to your keyboard. You must enable support in the `rules.mk` file and you must map mouse actions to keys on your keyboard. In either case, you will need to enable mousekeys in your makefile,
and add the relevant [keycodes](#mapping-mouse-actions-to-keyboard-keys) to your keymap.
### Adding Mousekeys Support in the `rules.mk` #### Enable Mousekeys
To add support for Mousekeys you simply need to add a single line to your keymap's `rules.mk`: To enable the mousekey functionality, add the following line to your keymap's `rules.mk`:
``` ```
MOUSEKEY_ENABLE = yes MOUSEKEY_ENABLE = yes
``` ```
You can see an example here: https://github.com/qmk/qmk_firmware/blob/master/keyboards/clueboard/66/keymaps/mouse_keys/rules.mk #### Mapping Mouse Actions to Keyboard Keys
### Mapping Mouse Actions to Keyboard Keys
You can use these keycodes within your keymap to map button presses to mouse actions: You can use these keycodes within your keymap to map button presses to mouse actions:
|Key |Aliases |Description | |Key |Aliases |Description |
|----------------|---------|---------------------------| |----------------|---------|-----------------------------------|
|`KC_MS_UP` |`KC_MS_U`|Mouse Cursor Up | |`KC_MS_UP` |`KC_MS_U`|Mouse Cursor Up |
|`KC_MS_DOWN` |`KC_MS_D`|Mouse Cursor Down | |`KC_MS_DOWN` |`KC_MS_D`|Mouse Cursor Down |
|`KC_MS_LEFT` |`KC_MS_L`|Mouse Cursor Left | |`KC_MS_LEFT` |`KC_MS_L`|Mouse Cursor Left |
|`KC_MS_RIGHT` |`KC_MS_R`|Mouse Cursor Right | |`KC_MS_RIGHT` |`KC_MS_R`|Mouse Cursor Right |
|`KC_MS_BTN1` |`KC_BTN1`|Mouse Button 1 | |`KC_MS_BTN1` |`KC_BTN1`|Mouse Button 1 |
|`KC_MS_BTN2` |`KC_BTN2`|Mouse Button 2 | |`KC_MS_BTN2` |`KC_BTN2`|Mouse Button 2 |
|`KC_MS_BTN3` |`KC_BTN3`|Mouse Button 3 | |`KC_MS_BTN3` |`KC_BTN3`|Mouse Button 3 |
|`KC_MS_BTN4` |`KC_BTN4`|Mouse Button 4 | |`KC_MS_BTN4` |`KC_BTN4`|Mouse Button 4 |
|`KC_MS_BTN5` |`KC_BTN5`|Mouse Button 5 | |`KC_MS_BTN5` |`KC_BTN5`|Mouse Button 5 |
|`KC_MS_WH_UP` |`KC_WH_U`|Mouse Wheel Up | |`KC_MS_WH_UP` |`KC_WH_U`|Mouse Wheel Up |
|`KC_MS_WH_DOWN` |`KC_WH_D`|Mouse Wheel Down | |`KC_MS_WH_DOWN` |`KC_WH_D`|Mouse Wheel Down |
|`KC_MS_WH_LEFT` |`KC_WH_L`|Mouse Wheel Left | |`KC_MS_WH_LEFT` |`KC_WH_L`|Mouse Wheel Left |
|`KC_MS_WH_RIGHT`|`KC_WH_R`|Mouse Wheel Right | |`KC_MS_WH_RIGHT`|`KC_WH_R`|Mouse Wheel Right |
|`KC_MS_ACCEL0` |`KC_ACL0`|Set mouse acceleration to 0| |`KC_MS_ACCEL0` |`KC_ACL0`|Set mouse acceleration to 0(slow) |
|`KC_MS_ACCEL1` |`KC_ACL1`|Set mouse acceleration to 1| |`KC_MS_ACCEL1` |`KC_ACL1`|Set mouse acceleration to 1(medium)|
|`KC_MS_ACCEL2` |`KC_ACL2`|Set mouse acceleration to 2| |`KC_MS_ACCEL2` |`KC_ACL2`|Set mouse acceleration to 2(fast) |
You can see an example in the `_ML` here: https://github.com/qmk/qmk_firmware/blob/master/keyboards/clueboard/66/keymaps/mouse_keys/keymap.c#L46
## Configuring the Behavior of Mousekeys ## Configuring the Behavior of Mousekeys with auto-accelerated movement
This behavior is intended to emulate the X Window System MouseKeysAccel feature. You can read more about it [on Wikipedia](https://en.wikipedia.org/wiki/Mouse_keys).
The default speed for controlling the mouse with the keyboard is intentionally slow. You can adjust these parameters by adding these settings to your keymap's `config.h` file. All times are specified in milliseconds (ms). The default speed for controlling the mouse with the keyboard is intentionally slow. You can adjust these parameters by adding these settings to your keymap's `config.h` file. All times are specified in milliseconds (ms).
@@ -55,27 +55,60 @@ The default speed for controlling the mouse with the keyboard is intentionally s
#define MOUSEKEY_WHEEL_TIME_TO_MAX 40 #define MOUSEKEY_WHEEL_TIME_TO_MAX 40
``` ```
#### `MOUSEKEY_DELAY`
### `MOUSEKEY_DELAY`
When one of the mouse movement buttons is pressed this setting is used to define the delay between that button press and the mouse cursor moving. Some people find that small movements are impossible if this setting is too low, while settings that are too high feel sluggish. When one of the mouse movement buttons is pressed this setting is used to define the delay between that button press and the mouse cursor moving. Some people find that small movements are impossible if this setting is too low, while settings that are too high feel sluggish.
### `MOUSEKEY_INTERVAL` #### `MOUSEKEY_INTERVAL`
When a movement key is held down this specifies how long to wait between each movement report. Lower settings will translate into an effectively higher mouse speed. When a movement key is held down this specifies how long to wait between each movement report. Lower settings will translate into an effectively higher mouse speed.
### `MOUSEKEY_MAX_SPEED` #### `MOUSEKEY_MAX_SPEED`
As a movement key is held down the speed of the mouse cursor will increase until it reaches `MOUSEKEY_MAX_SPEED`. As a movement key is held down the speed of the mouse cursor will increase until it reaches `MOUSEKEY_MAX_SPEED`.
### `MOUSEKEY_TIME_TO_MAX` #### `MOUSEKEY_TIME_TO_MAX`
How long you want to hold down a movement key for until `MOUSEKEY_MAX_SPEED` is reached. This controls how quickly your cursor will accelerate. How long you want to hold down a movement key for until `MOUSEKEY_MAX_SPEED` is reached. This controls how quickly your cursor will accelerate.
### `MOUSEKEY_WHEEL_MAX_SPEED` #### `MOUSEKEY_WHEEL_MAX_SPEED`
The top speed for scrolling movements. The top speed for scrolling movements.
### `MOUSEKEY_WHEEL_TIME_TO_MAX` #### `MOUSEKEY_WHEEL_TIME_TO_MAX`
How long you want to hold down a scroll key for until `MOUSEKEY_WHEEL_MAX_SPEED` is reached. This controls how quickly your scrolling will accelerate. How long you want to hold down a scroll key for until `MOUSEKEY_WHEEL_MAX_SPEED` is reached. This controls how quickly your scrolling will accelerate.
## Configuring the Behavior of Mousekeys with 3-speed constant movement
In your keymap's `config.h`, you must add the line:
```
#define MK_3_SPEED
```
Then you can precisely define 3 different speeds for both the cursor and the mouse wheel, and also whether speed selection is momentary or tap-to-select.
For each speed, you can specify how many milliseconds you want between reports(interval), and how far you want to it to move per report(offset).
For example:
```
#define MK_3_SPEED
#define MK_MOMENTARY_ACCEL // comment this out for tap-to-select acceleration
// cursor speeds:
#define MK_C_OFFSET_SLOW 1 // pixels
#define MK_C_INTERVAL_SLOW 100 // milliseconds
#define MK_C_OFFSET_MED 4
#define MK_C_INTERVAL_MED 16
#define MK_C_OFFSET_FAST 12
#define MK_C_INTERVAL_FAST 16
// scroll wheel speeds:
#define MK_W_OFFSET_SLOW 1 // wheel clicks
#define MK_W_INTERVAL_SLOW 400 // milliseconds
#define MK_W_OFFSET_MED 1
#define MK_W_INTERVAL_MED 200
#define MK_W_OFFSET_FAST 1
#define MK_W_INTERVAL_FAST 100
```
Medium values will be used as the default or unmodified speed.
The speed at which both the cursor and scrolling move can be selected with KC_ACL0, KC_ACL1, KC_ACL2 for slow, medium, and fast. However, if you leave MK_MOMENTARY_ACCEL defined then there is no need to ever send KC_ACL1, since that will be the unmodified speed.
+5 -4
View File
@@ -23,10 +23,11 @@ RGBLIGHT_ENABLE = yes
At minimum you must define the data pin your LED strip is connected to, and the number of LEDs in the strip, in your `config.h`. If your keyboard has onboard RGB LEDs, and you are simply creating a keymap, you usually won't need to modify these. At minimum you must define the data pin your LED strip is connected to, and the number of LEDs in the strip, in your `config.h`. If your keyboard has onboard RGB LEDs, and you are simply creating a keymap, you usually won't need to modify these.
|Define |Description | |Define |Description |
|------------|---------------------------------------------| |---------------|---------------------------------------------------------------------------------------------------------|
|`RGB_DI_PIN`|The pin connected to the data pin of the LEDs| |`RGB_DI_PIN` |The pin connected to the data pin of the LEDs |
|`RGBLED_NUM`|The number of LEDs connected | |`RGBLED_NUM` |The number of LEDs connected |
|`RGBLED_SPLIT` |(Optional) For split keyboards, the number of LEDs connected on each half directly wired to `RGB_DI_PIN` |
Then you should be able to use the keycodes below to change the RGB lighting to your liking. Then you should be able to use the keycodes below to change the RGB lighting to your liking.
+48 -49
View File
@@ -269,69 +269,68 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
}; };
__attribute__ ((weak))
const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
/*{row | col << 4} /*{row | col << 4}
| {x=0..224, y=0..64} | {x=0..224, y=0..64}
| | modifier | | modifier
| | | */ | | | */
{{0|(0<<4)}, {24.9*5, 16*0}, 0}, // LED 1 on right {{ 8|(0<<4)}, {17.2* 8, 12.8*0}, 0}, // LED 1 on right > Key 6
{{0|(1<<4)}, {24.9*6, 16*0}, 0}, // LED 2 {{ 9|(0<<4)}, {17.2* 9, 12.8*0}, 0}, // LED 2 > Key 7
{{0|(2<<4)}, {24.9*7, 16*0}, 0}, // LED 3 {{10|(0<<4)}, {17.2*10, 12.8*0}, 0}, // LED 3 > Key 8
{{0|(3<<4)}, {24.9*8, 16*0}, 0}, // LED 4 {{11|(0<<4)}, {17.2*11, 12.8*0}, 0}, // LED 4 > Key 9
{{0|(4<<4)}, {24.9*9, 16*0}, 0}, // LED 5 {{12|(0<<4)}, {17.2*12, 12.8*0}, 0}, // LED 5 > Key 0
{{1|(5<<4)}, {24.9*5, 16*1}, 0}, // LED 6 {{ 8|(1<<4)}, {17.2* 8, 12.8*1}, 0}, // LED 6
{{1|(6<<4)}, {24.9*6, 16*1}, 0}, // LED 7 {{ 9|(1<<4)}, {17.2* 9, 12.8*1}, 0}, // LED 7
{{1|(7<<4)}, {24.9*7, 16*1}, 0}, // LED 8 {{10|(1<<4)}, {17.2*10, 12.8*1}, 0}, // LED 8
{{1|(8<<4)}, {24.9*8, 16*1}, 0}, // LED 9 {{11|(1<<4)}, {17.2*11, 12.8*1}, 0}, // LED 9
{{1|(9<<4)}, {24.9*9, 16*1}, 0}, // LED 10 {{12|(1<<4)}, {17.2*12, 12.8*1}, 0}, // LED 10
{{2|(5<<4)}, {24.9*5, 16*2}, 0}, // LED 11 {{ 8|(2<<4)}, {17.2* 8, 12.8*2}, 0}, // LED 11
{{2|(6<<4)}, {24.9*6, 16*2}, 0}, // LED 12 {{ 9|(2<<4)}, {17.2* 9, 12.8*2}, 0}, // LED 12
{{2|(7<<4)}, {24.9*7, 16*2}, 0}, // LED 13 {{10|(2<<4)}, {17.2*10, 12.8*2}, 0}, // LED 13
{{2|(8<<4)}, {24.9*8, 16*2}, 0}, // LED 14 {{11|(2<<4)}, {17.2*11, 12.8*2}, 0}, // LED 14
{{2|(9<<4)}, {24.9*9, 16*2}, 0}, // LED 15 {{12|(2<<4)}, {17.2*12, 12.8*2}, 0}, // LED 15
{{3|(5<<4)}, {24.9*5, 16*2}, 0}, // LED 16 {{ 8|(3<<4)}, {17.2* 8, 12.8*3}, 0}, // LED 16
{{3|(6<<4)}, {24.9*6, 16*2}, 0}, // LED 17 {{ 9|(3<<4)}, {17.2* 9, 12.8*3}, 0}, // LED 17
{{3|(7<<4)}, {24.9*7, 16*2}, 0}, // LED 18 {{10|(3<<4)}, {17.2*10, 12.8*3}, 0}, // LED 18
{{3|(8<<4)}, {24.9*8, 16*2}, 0}, // LED 19 {{11|(3<<4)}, {17.2*11, 12.8*3}, 0}, // LED 19
{{3|(9<<4)}, {24.9*9, 16*2}, 0}, // LED 20 {{12|(3<<4)}, {17.2*12, 12.8*3}, 0}, // LED 20
{{4|(6<<4)}, {24.9*6, 16*2}, 0}, // LED 21 {{ 9|(4<<4)}, {17.2* 9, 12.8*4}, 1}, // LED 21
{{4|(7<<4)}, {24.9*7, 16*2}, 0}, // LED 22 {{10|(4<<4)}, {17.2*10, 12.8*4}, 1}, // LED 22
{{4|(8<<4)}, {24.9*8, 16*2}, 0}, // LED 23 {{11|(4<<4)}, {17.2*11, 12.8*4}, 1}, // LED 23
{{4|(9<<4)}, {24.9*9, 16*2}, 0}, // LED 24 {{12|(4<<4)}, {17.2*12, 12.8*4}, 1}, // LED 24
{{0|(0<<4)}, {24.9*4, 16*0}, 0}, // LED 1 on left {{ 5|(0<<4)}, {17.2* 5, 12.8*0}, 0}, // LED 1 on left > Key 5
{{0|(1<<4)}, {24.9*3, 16*0}, 0}, // LED 2 {{ 4|(0<<4)}, {17.2* 4, 12.8*0}, 0}, // LED 2 > Key 4
{{0|(2<<4)}, {24.9*2, 16*0}, 0}, // LED 3 {{ 3|(0<<4)}, {17.2* 3, 12.8*0}, 0}, // LED 3 > Key 3
{{0|(3<<4)}, {24.9*1, 16*0}, 0}, // LED 4 {{ 2|(0<<4)}, {17.2* 2, 12.8*0}, 0}, // LED 4 > Key 2
{{0|(4<<4)}, {24.9*0, 16*0}, 0}, // LED 5 {{ 1|(0<<4)}, {17.2* 1, 12.8*0}, 0}, // LED 5 > Key 1
{{1|(5<<4)}, {24.9*4, 16*1}, 0}, // LED 6 {{ 5|(1<<4)}, {17.2* 5, 12.8*1}, 0}, // LED 6
{{1|(6<<4)}, {24.9*3, 16*1}, 0}, // LED 7 {{ 4|(1<<4)}, {17.2* 4, 12.8*1}, 0}, // LED 7
{{1|(7<<4)}, {24.9*2, 16*1}, 0}, // LED 8 {{ 3|(1<<4)}, {17.2* 3, 12.8*1}, 0}, // LED 8
{{1|(8<<4)}, {24.9*1, 16*1}, 0}, // LED 9 {{ 2|(1<<4)}, {17.2* 2, 12.8*1}, 0}, // LED 9
{{1|(9<<4)}, {24.9*0, 16*1}, 0}, // LED 10 {{ 1|(1<<4)}, {17.2* 1, 12.8*1}, 0}, // LED 10
{{2|(5<<4)}, {24.9*4, 16*2}, 0}, // LED 11 {{ 5|(2<<4)}, {17.2* 5, 12.8*2}, 0}, // LED 11
{{2|(6<<4)}, {24.9*3, 16*2}, 0}, // LED 12 {{ 4|(2<<4)}, {17.2* 4, 12.8*2}, 0}, // LED 12
{{2|(7<<4)}, {24.9*2, 16*2}, 0}, // LED 13 {{ 3|(2<<4)}, {17.2* 3, 12.8*2}, 0}, // LED 13
{{2|(8<<4)}, {24.9*1, 16*2}, 0}, // LED 14 {{ 2|(2<<4)}, {17.2* 2, 12.8*2}, 0}, // LED 14
{{2|(9<<4)}, {24.9*0, 16*2}, 0}, // LED 15 {{ 1|(2<<4)}, {17.2* 1, 12.8*2}, 0}, // LED 15
{{3|(5<<4)}, {24.9*4, 16*2}, 0}, // LED 16 {{ 5|(3<<4)}, {17.2* 5, 12.8*3}, 0}, // LED 16
{{3|(6<<4)}, {24.9*3, 16*2}, 0}, // LED 17 {{ 4|(3<<4)}, {17.2* 4, 12.8*3}, 0}, // LED 17
{{3|(7<<4)}, {24.9*2, 16*2}, 0}, // LED 18 {{ 3|(3<<4)}, {17.2* 3, 12.8*3}, 0}, // LED 18
{{3|(8<<4)}, {24.9*1, 16*2}, 0}, // LED 19 {{ 2|(3<<4)}, {17.2* 2, 12.8*3}, 0}, // LED 19
{{3|(9<<4)}, {24.9*0, 16*2}, 0}, // LED 20 {{ 1|(3<<4)}, {17.2* 1, 12.8*3}, 0}, // LED 20
{{4|(6<<4)}, {24.9*3, 16*2}, 0}, // LED 21 {{ 4|(4<<4)}, {17.2* 4, 12.8*4}, 1}, // LED 21
{{4|(7<<4)}, {24.9*2, 16*2}, 0}, // LED 22 {{ 3|(4<<4)}, {17.2* 3, 12.8*4}, 1}, // LED 22
{{4|(8<<4)}, {24.9*1, 16*2}, 0}, // LED 23 {{ 2|(4<<4)}, {17.2* 2, 12.8*4}, 1}, // LED 23
{{4|(9<<4)}, {24.9*0, 16*2}, 0}, // LED 24 {{ 1|(4<<4)}, {17.2* 1, 12.8*4}, 1}, // LED 24 > Key Hack
}; };
#endif #endif
+1 -1
View File
@@ -22,7 +22,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
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_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_CTLE, 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_CTLE, 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_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, LT_SPCF, KC_RALT, TD_TWIN, MO(3), KC_RCTL), KC_LCTL, KC_LGUI, KC_LALT, LT_SPCF, KC_RALT, TD_TWIN, MO(3), TD_TCTL),
[1] = LAYOUT_60_ansi( [1] = 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_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,
@@ -17,16 +17,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#pragma once #pragma once
/* Use I2C or Serial, not both */
#define USE_SERIAL
// #define USE_I2C // #define USE_I2C
#define EE_HANDS
/* Select hand configuration */
#define MASTER_LEFT
// #define MASTER_RIGHT
// #define EE_HANDS
#undef RGBLED_NUM #undef RGBLED_NUM
#define RGBLIGHT_ANIMATIONS #define RGBLIGHT_ANIMATIONS
@@ -5,7 +5,7 @@ extern keymap_config_t keymap_config;
#define _QWERTY 0 #define _QWERTY 0
#define _LOWER 1 #define _LOWER 1
#define _RAISE 2 #define _RAISE 2
#define _ADJUST 16 #define _ADJUST 3
enum custom_keycodes { enum custom_keycodes {
QWERTY = SAFE_RANGE, QWERTY = SAFE_RANGE,
@@ -20,25 +20,25 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
//┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC,
//├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS,
//├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤
KC_LSFT, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_LSFT, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
//├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤
KC_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_HOME, KC_END, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_GRV, KC_DEL, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
//└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘
KC_LGUI, LOWER, KC_ENT, KC_SPC, RAISE, KC_LALT KC_LGUI, LOWER, KC_ENT, KC_SPC, RAISE, KC_RALT
// └────────┴────────┴────────┘ └────────┴────────┴────────┘ // └────────┴────────┴────────┘ └────────┴────────┴────────┘
), ),
[_LOWER] = LAYOUT( [_LOWER] = LAYOUT(
//┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐
KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PGUP,
//├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤
RESET, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, RESET, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_PGDN,
//├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤
KC_DEL, _______, KC_LEFT, KC_RGHT, KC_UP, KC_LBRC, KC_RBRC, KC_P4, KC_P5, KC_P6, KC_PLUS, KC_PIPE, KC_DEL, _______, KC_LEFT, KC_RGHT, KC_UP, KC_LBRC, KC_RBRC, KC_P4, KC_P5, KC_P6, KC_PLUS, KC_HOME,
//├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤
BL_STEP, _______, _______, _______, KC_DOWN, KC_LCBR, KC_LPRN, KC_RPRN, KC_RCBR, KC_P1, KC_P2, KC_P3, KC_MINS, _______, BL_STEP, _______, _______, _______, KC_DOWN, KC_LCBR, KC_LPRN, KC_RPRN, KC_RCBR, KC_P1, KC_P2, KC_P3, KC_MINS, KC_END,
//└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘
_______, _______, KC_DEL, KC_DEL, _______, KC_P0 _______, _______, KC_DEL, KC_DEL, _______, KC_P0
// └────────┴────────┴────────┘ └────────┴────────┴────────┘ // └────────┴────────┴────────┘ └────────┴────────┴────────┘
@@ -50,7 +50,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
//├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤
RGB_TOG, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, RGB_TOG, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______,
//├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤
RGB_MOD, KC_MPRV, KC_MNXT, KC_VOLU, KC_PGUP, KC_UNDS, KC_EQL, KC_HOME, RGB_HUI, RGB_SAI, RGB_VAI, KC_BSLS, RGB_MOD, KC_MPRV, KC_MNXT, KC_VOLU, KC_PGUP, KC_UNDS, KC_EQL, KC_HOME, RGB_HUI, RGB_SAI, RGB_VAI, _______,
//├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤
KC_MUTE, KC_MSTP, KC_MPLY, KC_VOLD, KC_PGDN, KC_MINS, KC_LPRN, _______, KC_PLUS, KC_END, RGB_HUD, RGB_SAD, RGB_VAD, _______, KC_MUTE, KC_MSTP, KC_MPLY, KC_VOLD, KC_PGDN, KC_MINS, KC_LPRN, _______, KC_PLUS, KC_END, RGB_HUD, RGB_SAD, RGB_VAD, _______,
//└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘
+1
View File
@@ -71,6 +71,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* ws2812 RGB LED */ /* ws2812 RGB LED */
#define RGB_DI_PIN F7 #define RGB_DI_PIN F7
#define RGBLED_NUM 12 // Number of LEDs #define RGBLED_NUM 12 // Number of LEDs
#define RGBLED_SPLIT { 6, 6 }
#define DYNAMIC_KEYMAP_LAYER_COUNT 4 #define DYNAMIC_KEYMAP_LAYER_COUNT 4
+1
View File
@@ -56,6 +56,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define RGB_DI_PIN B4 #define RGB_DI_PIN B4
#define RGBLIGHT_ANIMATIONS #define RGBLIGHT_ANIMATIONS
#define RGBLED_NUM 12 #define RGBLED_NUM 12
#define RGBLED_SPLIT { 6, 6 }
/* Backlight LEDs */ /* Backlight LEDs */
#define BACKLIGHT_PIN B5 #define BACKLIGHT_PIN B5
+166
View File
@@ -0,0 +1,166 @@
/* Copyright 2017 Yang Liu
*
* 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 RGBLIGHT_H
#define RGBLIGHT_H
#ifdef RGBLIGHT_ANIMATIONS
#define RGBLIGHT_MODES 35
#else
#define RGBLIGHT_MODES 1
#endif
#ifndef RGBLIGHT_EFFECT_BREATHE_CENTER
#define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1-2.7
#endif
#ifndef RGBLIGHT_EFFECT_BREATHE_MAX
#define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0-255
#endif
#ifndef RGBLIGHT_EFFECT_SNAKE_LENGTH
#define RGBLIGHT_EFFECT_SNAKE_LENGTH 4
#endif
#ifndef RGBLIGHT_EFFECT_KNIGHT_LENGTH
#define RGBLIGHT_EFFECT_KNIGHT_LENGTH 3
#endif
#ifndef RGBLIGHT_EFFECT_KNIGHT_OFFSET
#define RGBLIGHT_EFFECT_KNIGHT_OFFSET 0
#endif
#ifndef RGBLIGHT_EFFECT_KNIGHT_LED_NUM
#define RGBLIGHT_EFFECT_KNIGHT_LED_NUM RGBLED_NUM
#endif
#ifndef RGBLIGHT_EFFECT_CHRISTMAS_INTERVAL
#define RGBLIGHT_EFFECT_CHRISTMAS_INTERVAL 1000
#endif
#ifndef RGBLIGHT_EFFECT_CHRISTMAS_STEP
#define RGBLIGHT_EFFECT_CHRISTMAS_STEP 2
#endif
#ifndef RGBLIGHT_HUE_STEP
#define RGBLIGHT_HUE_STEP 10
#endif
#ifndef RGBLIGHT_SAT_STEP
#define RGBLIGHT_SAT_STEP 17
#endif
#ifndef RGBLIGHT_VAL_STEP
#define RGBLIGHT_VAL_STEP 17
#endif
#define RGBLED_TIMER_TOP F_CPU/(256*64)
// #define RGBLED_TIMER_TOP 0xFF10
#include <stdint.h>
#include <stdbool.h>
#include "eeconfig.h"
#ifndef RGBLIGHT_CUSTOM_DRIVER
#include "ws2812.h"
#endif
#include "rgblight_types.h"
#include "rgblight_list.h"
extern LED_TYPE led[RGBLED_NUM];
extern const uint8_t RGBLED_BREATHING_INTERVALS[4] PROGMEM;
extern const uint8_t RGBLED_RAINBOW_MOOD_INTERVALS[3] PROGMEM;
extern const uint8_t RGBLED_RAINBOW_SWIRL_INTERVALS[3] PROGMEM;
extern const uint8_t RGBLED_SNAKE_INTERVALS[3] PROGMEM;
extern const uint8_t RGBLED_KNIGHT_INTERVALS[3] PROGMEM;
extern const uint16_t RGBLED_RGBTEST_INTERVALS[1] PROGMEM;
typedef union {
uint32_t raw;
struct {
bool enable :1;
uint8_t mode :6;
uint16_t hue :9;
uint8_t sat :8;
uint8_t val :8;
uint8_t speed :8;//EECONFIG needs to be increased to support this
};
} rgblight_config_t;
void rgblight_init(void);
void rgblight_increase(void);
void rgblight_decrease(void);
void rgblight_toggle(void);
void rgblight_enable(void);
void rgblight_disable(void);
void rgblight_step(void);
void rgblight_step_reverse(void);
uint8_t rgblight_get_mode(void);
void rgblight_mode(uint8_t mode);
void rgblight_set(void);
void rgblight_update_dword(uint32_t dword);
void rgblight_increase_hue(void);
void rgblight_decrease_hue(void);
void rgblight_increase_sat(void);
void rgblight_decrease_sat(void);
void rgblight_increase_val(void);
void rgblight_decrease_val(void);
void rgblight_increase_speed(void);
void rgblight_decrease_speed(void);
void rgblight_sethsv(uint16_t hue, uint8_t sat, uint8_t val);
uint16_t rgblight_get_hue(void);
uint8_t rgblight_get_sat(void);
uint8_t rgblight_get_val(void);
void rgblight_setrgb(uint8_t r, uint8_t g, uint8_t b);
void rgblight_setrgb_at(uint8_t r, uint8_t g, uint8_t b, uint8_t index);
void rgblight_sethsv_at(uint16_t hue, uint8_t sat, uint8_t val, uint8_t index);
uint32_t eeconfig_read_rgblight(void);
void eeconfig_update_rgblight(uint32_t val);
void eeconfig_update_rgblight_default(void);
void eeconfig_debug_rgblight(void);
void rgb_matrix_increase(void);
void rgb_matrix_decrease(void);
void sethsv(uint16_t hue, uint8_t sat, uint8_t val, LED_TYPE *led1);
void setrgb(uint8_t r, uint8_t g, uint8_t b, LED_TYPE *led1);
void rgblight_sethsv_noeeprom(uint16_t hue, uint8_t sat, uint8_t val);
void rgblight_mode_noeeprom(uint8_t mode);
void rgblight_toggle_noeeprom(void);
void rgblight_enable_noeeprom(void);
void rgblight_disable_noeeprom(void);
void rgblight_sethsv_eeprom_helper(uint16_t hue, uint8_t sat, uint8_t val, bool write_to_eeprom);
void rgblight_mode_eeprom_helper(uint8_t mode, bool write_to_eeprom);
#define EZ_RGB(val) rgblight_show_solid_color((val >> 16) & 0xFF, (val >> 8) & 0xFF, val & 0xFF)
void rgblight_show_solid_color(uint8_t r, uint8_t g, uint8_t b);
void rgblight_task(void);
void rgblight_timer_init(void);
void rgblight_timer_enable(void);
void rgblight_timer_disable(void);
void rgblight_timer_toggle(void);
void rgblight_effect_breathing(uint8_t interval);
void rgblight_effect_rainbow_mood(uint8_t interval);
void rgblight_effect_rainbow_swirl(uint8_t interval);
void rgblight_effect_snake(uint8_t interval);
void rgblight_effect_knight(uint8_t interval);
void rgblight_effect_christmas(void);
void rgblight_effect_rgbtest(void);
#endif
@@ -0,0 +1,35 @@
#pragma once
#ifdef AUDIO_ENABLE
#define STARTUP_SONG SONG(PLANCK_SOUND)
// #define STARTUP_SONG SONG(NO_SOUND)
#define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \
SONG(COLEMAK_SOUND), \
SONG(DVORAK_SOUND) \
}
#endif
/*
* MIDI options
*/
/* Prevent use of disabled MIDI features in the keymap */
//#define MIDI_ENABLE_STRICT 1
/* enable basic MIDI features:
- MIDI notes can be sent when in Music mode is on
*/
#define MIDI_BASIC
/* enable advanced MIDI features:
- MIDI notes can be added to the keymap
- Octave shift and transpose
- Virtual sustain, portamento, and modulation wheel
- etc.
*/
//#define MIDI_ADVANCED
/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
//#define MIDI_TONE_KEYCODE_OCTAVES 2
@@ -0,0 +1,153 @@
/* Copyright 2015-2017 Jack Humbert
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include QMK_KEYBOARD_H
extern keymap_config_t keymap_config;
enum planck_layers {
_QWERTY,
_LOWER,
_RAISE,
_ADJUST
};
enum planck_keycodes {
// QWERTY = SAFE_RANGE,
BACKLIT,
EXT_PLV
};
#define LOWER MO(_LOWER)
#define RAISE MO(_RAISE)
#define CTRL_ESC MT(MOD_LCTL, KC_ESC)
#define HYPER LCTL(LALT(QK_LGUI))
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Qwerty
* ,-------------------------------------------------------------------------------------------------------.
* | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp |
* |--------+--------+--------+--------+--------+-------+-------+------+--------+--------+--------+--------|
* | Ct/Esc | A | S | D | F | G | H | J | K | L | ; | " |
* |--------+--------+--------+--------+--------+-------+-------+------+--------+--------+--------+--------|
* | Shift | Z | X | C | V | B | N | M | , | . | / | Enter |
* |--------+--------+--------+--------+--------+-------+-------+------+--------+--------+--------+--------|
* | | Ctrl | Raise | Alt | GUI | Space | Lowr | Hyper | | | Raise |
* `-------------------------------------------------------------------------------------------------------'
*/
[_QWERTY] = LAYOUT_planck_grid(
{KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC},
{CTRL_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT},
{KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT },
{_______, KC_LCTL, RAISE, KC_LALT, KC_LGUI, KC_SPC, KC_SPC, LOWER, HYPER, _______, _______, RAISE }
),
/* Lower
* ,-----------------------------------------------------------------------------------------------------------.
* | | \ | / | [ | ] | ~ | | | = | + | - | _ | |
* |-------+--------+--------+--------+--------+--------+--------+--------+--------+---------+--------+--------|
* | | { | } | ( | ) | ` | ← | ↓ | ↑ | → | Alt | |
* |-------+--------+--------+--------+--------+--------+--------+--------+--------+---------+--------+--------|
* | | ! | @ | # | $ | % | ^ | & | * | ( | ) | |
* |-------+--------+--------+--------+--------+--------+--------+--------+--------+---------+--------+--------|
* | | | | | | | | | | | |
* `-----------------------------------------------------------------------------------------------------------'
*/
[_LOWER] = LAYOUT_planck_grid(
{_______, KC_BSLS, KC_SLSH, KC_LBRC, KC_RBRC, KC_TILD, KC_PIPE, KC_EQL, KC_PLUS, KC_MINS, KC_UNDS, _______},
{_______, KC_LCBR, KC_RCBR, KC_LPRN, KC_RPRN, KC_GRV, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_LALT, _______},
{_______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______},
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
),
/* Raise
* ,----------------------------------------------------------------------------------------------------------.
* | | | | | | | | 7 | 8 | 9 | | |
* |-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
* | | VolMte | Vol - | Vol + | Ply/Pse| | | 4 | 5 | 6 | | |
* |-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
* | | Trak ← | Trak → | Scrn - | Scrn + | | | 1 | 2 | 3 | | |
* |-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
* | | | | | | | | 0 | . | | |
* `----------------------------------------------------------------------------------------------------------'
*/
[_RAISE] = LAYOUT_planck_grid(
{_______, _______, _______, _______, _______, _______, _______, KC_7, KC_8, KC_9, _______, _______},
{_______, KC_MUTE, KC_VOLD, KC_VOLU, KC_MPLY, _______, _______, KC_4, KC_5, KC_6, _______, _______},
{_______, KC_MRWD, KC_MFFD, KC_SLCK, KC_PAUS, _______, _______, KC_1, KC_2, KC_3, _______, _______},
{_______, _______, _______, _______, _______, _______, _______, KC_0, KC_0, KC_DOT, _______, _______}
),
/* Adjust (Lower + Raise)
* ,----------------------------------------------------------------------------------------------------------.
* | | Reset | | | | | | | | | | Del |
* |-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
* | | | MuMod | AudOn | AudOff | | | Qwerty | | | | |
* |-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
* | | Voice- | Voice+ | MusOn | Musoff | MIDIon | MIDIof | TermOn | TermOff| | | |
* |-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
* | | | | | | | | | | | |
* `----------------------------------------------------------------------------------------------------------'
*/
[_ADJUST] = LAYOUT_planck_grid(
{_______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL },
{_______, _______, MU_MOD, AU_ON, AU_OFF, _______, _______, QWERTY, _______, _______, _______, _______},
{_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, TERM_ON, TERM_OFF, _______, _______, _______},
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
)
};
#ifdef AUDIO_ENABLE
float plover_song[][2] = SONG(PLOVER_SOUND);
float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND);
#endif
uint32_t layer_state_set_user(uint32_t state) {
return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST);
}
bool music_mask_user(uint16_t keycode) {
switch (keycode) {
case RAISE:
case LOWER:
return false;
default:
return true;
}
}
/*
* Example
* ,----------------------------------------------------------------------------------------------------------.
* | | | | | | | | | | | | |
* |-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
* | | | | | | | | | | | | |
* |-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
* | | | | | | | | | | | | |
* |-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
* | | | | | | | | | | | |
* `----------------------------------------------------------------------------------------------------------'
*
[_EXAMPLE] = LAYOUT_planck_grid(
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
),
*/
@@ -0,0 +1,63 @@
# [🐦 @rjhilgefort](https://twitter.com/rjhilgefort) Planck Layout
A simple and practical layout featuring:
- Hyper Key === CTRL + ALT + GUI
- Ctrl/Esc key that is CTRL when held and ESC when tapped
- Symbols layer that focuses on coding
- Numpad + media layer
![Imgur](https://i.imgur.com/elygxAb.jpg)
## Main
```
,-------------------------------------------------------------------------------------------------------.
| Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp |
|--------|--------|--------|--------|--------|-------|-------|------|--------|--------|--------|--------|
| Ct/Esc | A | S | D | F | G | H | J | K | L | ; | " |
|--------|--------|--------|--------|--------|-------|-------|------|--------|--------|--------|--------|
| Shift | Z | X | C | V | B | N | M | , | . | / | Enter |
|--------|--------|--------|--------|--------|-------|-------|------|--------|--------|--------|--------|
| | Ctrl | Raise | Alt | GUI | Space | Lowr | Hyper | | | Raise |
`-------------------------------------------------------------------------------------------------------'
```
## Lower
```
,-----------------------------------------------------------------------------------------------------------.
| | \ | / | [ | ] | ~ | | | = | + | - | _ | |
|-------|--------|--------|--------|--------|--------|--------|--------|--------|---------|--------|--------|
| | { | } | ( | ) | ` | ← | ↓ | ↑ | → | Alt | |
|-------|--------|--------|--------|--------|--------|--------|--------|--------|---------|--------|--------|
| | ! | @ | # | $ | % | ^ | & | * | ( | ) | |
|-------|--------|--------|--------|--------|--------|--------|--------|--------|---------|--------|--------|
| | | | | | | | | | | |
`-----------------------------------------------------------------------------------------------------------'
```
## Raise
```
,----------------------------------------------------------------------------------------------------------.
| | | | | | | | 7 | 8 | 9 | | |
|-------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------|
| | VolMte | Vol - | Vol + | Ply/Pse| | | 4 | 5 | 6 | | |
|-------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------|
| | Trak ← | Trak → | Scrn - | Scrn + | | | 1 | 2 | 3 | | |
|-------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------|
| | | | | | | | 0 | . | | |
`----------------------------------------------------------------------------------------------------------'
```
## Adjust (Lower + Raise)
```
,----------------------------------------------------------------------------------------------------------.
| | Reset | | | | | | | | | | Del |
|-------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------|
| | | MuMod | AudOn | AudOff | | | Qwerty | | | | |
|-------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------|
| | Voice- | Voice+ | MusOn | Musoff | MIDIon | MIDIof | TermOn | TermOff| | | |
|-------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------|
| | | | | | | | | | | |
`----------------------------------------------------------------------------------------------------------'
```
Whitespace-only changes.
+39
View File
@@ -0,0 +1,39 @@
#pragma once
#ifdef AUDIO_ENABLE
#define STARTUP_SONG SONG(PLANCK_SOUND)
// #define STARTUP_SONG SONG(NO_SOUND)
#define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \
SONG(COLEMAK_SOUND), \
SONG(DVORAK_SOUND) \
}
#endif
/*
* MIDI options
*/
/* Prevent use of disabled MIDI features in the keymap */
//#define MIDI_ENABLE_STRICT 1
/* enable basic MIDI features:
- MIDI notes can be sent when in Music mode is on
*/
#define MIDI_BASIC
/* enable advanced MIDI features:
- MIDI notes can be added to the keymap
- Octave shift and transpose
- Virtual sustain, portamento, and modulation wheel
- etc.
*/
//#define MIDI_ADVANCED
/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
//#define MIDI_TONE_KEYCODE_OCTAVES 2
// Most tactile encoders have detents every 4 stages
#define ENCODER_RESOLUTION 4
+297
View File
@@ -0,0 +1,297 @@
/* Copyright 2015-2017 Jack Humbert
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include QMK_KEYBOARD_H
#include "muse.h"
extern keymap_config_t keymap_config;
enum planck_layers {
_QWERTY,
_COLEMAK,
_DVORAK,
_LOWER,
_RAISE,
_PLOVER,
_ADJUST
};
enum planck_keycodes {
QWERTY = SAFE_RANGE,
COLEMAK,
DVORAK,
PLOVER,
BACKLIT,
EXT_PLV
};
#define LOWER MO(_LOWER)
#define RAISE MO(_RAISE)
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Qwerty
* ,-----------------------------------------------------------------------------------.
* | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | Tab | A | S | D | F | G | H | J | K | L | ; |Enter |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | Shift| Z | X | C | V | B | N | M | , | . | Up |Shift |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | / | Left | Down |Right |
* `-----------------------------------------------------------------------------------'
*/
[_QWERTY] = LAYOUT_planck_grid(
KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, KC_RSFT,
BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_SLSH, KC_LEFT, KC_DOWN, KC_RGHT
),
/* Lower
* ,-----------------------------------------------------------------------------------.
* | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | | |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | ' |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | | Vol- | Vol+ |Brite-|Brite+|
* `-----------------------------------------------------------------------------------'
*/
[_LOWER] = LAYOUT_planck_grid(
KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PIPE,
KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_QUOT,
_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______,
_______, _______, _______, _______, _______, _______, _______, _______, KC_VOLD, KC_VOLU, KC_BRMD, KC_BRMU
),
/* Raise
* ,-----------------------------------------------------------------------------------.
* | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | \ |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | ' |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | | Vol- | Vol+ |Brite-|Brite+|
* `-----------------------------------------------------------------------------------'
*/
[_RAISE] = LAYOUT_planck_grid(
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS,
KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_QUOT,
_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______,
_______, _______, _______, _______, _______, _______, _______, _______, KC_VOLD, KC_VOLU, KC_BRMD, KC_BRMU
),
/* Adjust (Lower + Raise)
* ,-----------------------------------------------------------------------------------.
* | | Reset| | | | | | | | | | Del |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty| | | | |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | | | | | |
* `-----------------------------------------------------------------------------------'
*/
[_ADJUST] = LAYOUT_planck_grid(
_______, RESET, DEBUG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL ,
_______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, _______, _______, _______, _______,
_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, TERM_ON, TERM_OFF, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
)
};
#ifdef AUDIO_ENABLE
float plover_song[][2] = SONG(PLOVER_SOUND);
float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND);
#endif
uint32_t layer_state_set_user(uint32_t state) {
return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST);
}
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case QWERTY:
if (record->event.pressed) {
print("mode just switched to qwerty and this is a huge string\n");
set_single_persistent_default_layer(_QWERTY);
}
return false;
break;
case BACKLIT:
if (record->event.pressed) {
register_code(KC_RSFT);
#ifdef BACKLIGHT_ENABLE
backlight_step();
#endif
#ifdef KEYBOARD_planck_rev5
PORTE &= ~(1<<6);
#endif
} else {
unregister_code(KC_RSFT);
#ifdef KEYBOARD_planck_rev5
PORTE |= (1<<6);
#endif
}
return false;
break;
case EXT_PLV:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
PLAY_SONG(plover_gb_song);
#endif
layer_off(_PLOVER);
}
return false;
break;
}
return true;
}
bool muse_mode = false;
uint8_t last_muse_note = 0;
uint16_t muse_counter = 0;
uint8_t muse_offset = 70;
uint16_t muse_tempo = 50;
void encoder_update(bool clockwise) {
if (muse_mode) {
if (IS_LAYER_ON(_RAISE)) {
if (clockwise) {
muse_offset++;
} else {
muse_offset--;
}
} else {
if (clockwise) {
muse_tempo+=1;
} else {
muse_tempo-=1;
}
}
} else {
if (clockwise) {
#ifdef MOUSEKEY_ENABLE
tap_code(KC_MS_WH_DOWN);
#else
tap_code(KC_PGDN);
#endif
} else {
#ifdef MOUSEKEY_ENABLE
tap_code(KC_MS_WH_UP);
#else
tap_code(KC_PGUP);
#endif
}
}
}
void dip_update(uint8_t index, bool active) {
switch (index) {
case 0:
if (active) {
#ifdef AUDIO_ENABLE
PLAY_SONG(plover_song);
#endif
layer_on(_ADJUST);
} else {
#ifdef AUDIO_ENABLE
PLAY_SONG(plover_gb_song);
#endif
layer_off(_ADJUST);
}
break;
case 1:
if (active) {
muse_mode = true;
} else {
muse_mode = false;
#ifdef AUDIO_ENABLE
stop_all_notes();
#endif
}
}
}
void matrix_scan_user(void) {
#ifdef AUDIO_ENABLE
if (muse_mode) {
if (muse_counter == 0) {
uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()];
if (muse_note != last_muse_note) {
stop_note(compute_freq_for_midi_note(last_muse_note));
play_note(compute_freq_for_midi_note(muse_note), 0xF);
last_muse_note = muse_note;
}
}
muse_counter = (muse_counter + 1) % muse_tempo;
}
#endif
}
bool music_mask_user(uint16_t keycode) {
switch (keycode) {
case RAISE:
case LOWER:
return false;
default:
return true;
}
}
void rgb_matrix_indicators_user(void) {
#ifdef RGB_MATRIX_ENABLE
rgb_led led;
switch (biton32(layer_state)) {
case _RAISE:
for (int i = 0; i < DRIVER_LED_TOTAL; i++) {
led = g_rgb_leds[i];
if ( led.modifier ) {
rgb_matrix_set_color(i, 0x6B, 0x00, 0x80);
} else {
rgb_matrix_set_color(i, 0x00, 0xFF, 0x00);
}
}
break;
case _LOWER:
for (int i = 0; i < DRIVER_LED_TOTAL; i++) {
led = g_rgb_leds[i];
if ( led.modifier ) {
rgb_matrix_set_color(i, 0xFF, 0xA5, 0x00);
} else {
rgb_matrix_set_color(i, 0x00, 0x67, 0xC7);
}
}
break;
case _ADJUST:
for (int i = 0; i < DRIVER_LED_TOTAL; i++) {
rgb_matrix_set_color(i, 0xFF, 0x99, 0x00);
}
rgb_matrix_set_color(1, 0xFF, 0x00, 0x00);
break;
default:
break;
}
#endif
}
+31
View File
@@ -0,0 +1,31 @@
# tomholford's layout
This layout is data-driven: I installed [WhatPulse](https://whatpulse.org/) a few months ago and generated a heatmap of the most frequently used keys. I also optimized for my most-used programming languages, and muscle memory.
## Changes from Default
### QWERTY
- swap escape and tab
- rearrange arrows in original layout
- swap rshift and Enter
- map / to original location of left arrow key
### RAISE
- move backslash to backspace
- map quote to original location from qwerty layer
- map brightness up / down to original location of left and up arrows
- map volume up / down to original location of down and right arrows
### LOWER
- move pipe to backspace
- map quote to original location from qwerty layer
- map brightness up / down to original location of left and up arrows
- map volume up / down to original location of down and right arrows
## RGB LED
- Illuminate when pressing RAISE, LOWER, or ADJUST ([source](https://www.reddit.com/r/olkb/comments/8wvk8s/custom_rgb_configuration_by_keycodelayer/))
+1
View File
@@ -0,0 +1 @@
SRC += muse.c
+34
View File
@@ -0,0 +1,34 @@
/*
Copyright 2018 Mattia Dal Ben <matthewdibi@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
/* Use I2C or Serial, not both */
#define USE_SERIAL
// #define USE_I2C
/* Select hand configuration */
#define MASTER_LEFT
//#define MASTER_RIGHT
//#define EE_HANDS
#undef RGBLED_NUM
#define RGBLIGHT_ANIMATIONS
#define RGBLED_NUM 14
#define RGBLIGHT_HUE_STEP 8
#define RGBLIGHT_SAT_STEP 8
#define RGBLIGHT_VAL_STEP 8
+92
View File
@@ -0,0 +1,92 @@
#include QMK_KEYBOARD_H
extern keymap_config_t keymap_config;
// Each layer gets a name for readability, which is then used in the keymap matrix below.
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
// Layer names don't all need to be of the same length, obviously, and you can also skip them
// entirely and just use numbers.
#define _QWERTY 0
#define _SYMB 1
#define _NAV 2
#define _ADJUST 3
enum custom_keycodes {
QWERTY = SAFE_RANGE,
SYMB,
NAV,
ADJUST,
};
// Shortcut to make keymap more readable
#define SYM_L MO(_SYMB)
#define KC_ALAS LALT_T(KC_PAST)
#define KC_CTES LCTL_T(KC_ESC)
#define KC_CTQU RCTL_T(KC_QUOT)
#define KC_NAGR LT(_NAV, KC_GRV)
#define KC_NAMI LT(_NAV, KC_MINS)
#define KC_ADEN LT(_ADJUST, KC_END)
#define KC_ADPU LT(_ADJUST, KC_PGUP)
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_QWERTY] = LAYOUT(
//┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐
KC_NAGR ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 , KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_NAMI ,
//├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤
KC_TAB ,KC_Q ,KC_W ,KC_E ,KC_R ,KC_T ,SYM_L , SYM_L ,KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,KC_EQL ,
//├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤
KC_CTES ,KC_A ,KC_S ,KC_D ,KC_F ,KC_G ,KC_LBRC , KC_RBRC ,KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN ,KC_CTQU ,
//├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤
KC_LSFT ,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,KC_ADPU ,KC_PGDN , KC_HOME ,KC_ADEN ,KC_N ,KC_M ,KC_COMM ,KC_DOT ,KC_SLSH ,KC_RSFT ,
//├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤
KC_BSLS ,KC_PPLS ,KC_PMNS ,KC_ALAS , KC_LGUI , KC_BSPC ,KC_DEL , KC_ENT ,KC_SPC , KC_RALT , KC_LEFT ,KC_DOWN ,KC_UP ,KC_RGHT
//└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘
),
[_SYMB] = LAYOUT(
//┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐
_______ ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 , KC_F8 ,KC_F9 ,KC_F10 ,KC_F11 ,KC_F12 ,_______ ,
//├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤
_______ ,KC_EXLM ,KC_AT ,KC_LCBR ,KC_RCBR ,KC_PIPE ,KC_F6 , KC_F7 ,XXXXXXX ,KC_KP_7 ,KC_KP_8 ,KC_KP_9 ,XXXXXXX ,_______ ,
//├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤
_______ ,KC_HASH ,KC_DLR ,KC_LBRC ,KC_RBRC ,KC_GRV ,_______ , _______ ,XXXXXXX ,KC_KP_4 ,KC_KP_5 ,KC_KP_6 ,XXXXXXX ,XXXXXXX ,
//├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤
_______ ,KC_PERC ,KC_CIRC ,KC_LPRN ,KC_RPRN ,KC_TILD ,_______ ,_______ , _______ ,_______ ,XXXXXXX ,KC_KP_1 ,KC_KP_2 ,KC_KP_3 ,XXXXXXX ,XXXXXXX ,
//├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤
_______ ,_______ ,_______ ,_______ , _______ , _______ ,_______ , _______ ,_______ , KC_KP_0 , KC_KP_0 ,KC_PDOT ,XXXXXXX ,XXXXXXX
//└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘
),
[_NAV] = LAYOUT(
//┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐
_______ ,_______ ,_______ ,_______ ,_______ ,_______ , _______ ,_______ ,_______ ,_______ ,_______ ,_______ ,
//├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤
XXXXXXX ,XXXXXXX ,KC_MS_U ,XXXXXXX ,KC_WH_U ,XXXXXXX ,_______ , _______ ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,
//├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤
XXXXXXX ,KC_MS_L ,KC_MS_D ,KC_MS_R ,KC_WH_D ,XXXXXXX ,_______ , _______ ,KC_LEFT ,KC_DOWN ,KC_UP ,KC_RIGHT,XXXXXXX ,XXXXXXX ,
//├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤
XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,_______ ,_______ , _______ ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,
//├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤
XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , KC_BTN1 , KC_BTN2 ,_______ , _______ ,_______ , XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX
//└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘
),
[_ADJUST] = LAYOUT(
//┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐
XXXXXXX ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 , KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,KC_F11 ,
//├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤
XXXXXXX ,RESET ,RGB_M_P ,RGB_TOG ,RGB_MOD ,RGB_HUD ,RGB_HUI , RGB_SAD ,RGB_SAI ,RGB_VAD ,RGB_VAI ,XXXXXXX ,XXXXXXX ,KC_F12 ,
//├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤
XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,
//├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤
XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,_______ ,XXXXXXX , XXXXXXX ,_______ ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,
//├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤
XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX , XXXXXXX ,XXXXXXX , XXXXXXX ,XXXXXXX , XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX
//└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘
)
};
+399
View File
@@ -0,0 +1,399 @@
[
{
"name": "Redox/rev1",
"author": "Fabien Culpo",
"switchMount": "cherry",
"plate": false,
"pcb": false
},
[
{
"x": 3.5
},
"#\n3",
{
"x": 10.5
},
"*\n8"
],
[
{
"y": -0.875,
"x": 2.5
},
"@\n2",
{
"x": 1
},
"$\n4",
{
"x": 8.5
},
"&\n7",
{
"x": 1
},
"(\n9"
],
[
{
"y": -0.875,
"x": 5.5
},
"%\n5",
{
"x": 6.5
},
"^\n6"
],
[
{
"y": -0.875,
"x": 0.25,
"a": 5,
"w": 1.25
},
"`\nLayer 2\n\n\n\n\n~",
{
"a": 4
},
"!\n1",
{
"x": 14.5
},
")\n0",
{
"a": 5,
"w": 1.25
},
"_\nLayer 2\n\n\n\n\n-"
],
[
{
"y": -0.625,
"x": 6.5
},
"Layer 1",
{
"x": 4.5
},
"Layer 1"
],
[
{
"y": -0.75,
"x": 3.5,
"a": 4
},
"E",
{
"x": 10.5
},
"I"
],
[
{
"y": -0.875,
"x": 2.5
},
"W",
{
"x": 1
},
"R",
{
"x": 8.5
},
"U",
{
"x": 1
},
"O"
],
[
{
"y": -0.875,
"x": 5.5
},
"T",
{
"x": 6.5
},
"Y"
],
[
{
"y": -0.875,
"x": 0.25,
"a": 7,
"w": 1.25
},
"TAB",
{
"a": 4
},
"Q",
{
"x": 14.5
},
"P",
{
"a": 5,
"w": 1.25
},
"+\n="
],
[
{
"y": -0.625,
"x": 6.5,
"a": 7,
"h": 1.5
},
"[",
{
"x": 4.5,
"h": 1.5
},
"]"
],
[
{
"y": -0.75,
"x": 3.5,
"a": 4
},
"D",
{
"x": 10.5
},
"K"
],
[
{
"y": -0.875,
"x": 2.5
},
"S",
{
"x": 1,
"n": true
},
"F",
{
"x": 8.5,
"n": true
},
"J",
{
"x": 1
},
"L"
],
[
{
"y": -0.875,
"x": 5.5
},
"G",
{
"x": 6.5
},
"H"
],
[
{
"y": -0.875,
"x": 0.25,
"a": 5,
"w": 1.25
},
"ESC\nCTRL",
{
"a": 4
},
"A",
{
"x": 14.5
},
":\n;",
{
"a": 5,
"w": 1.25
},
"'\nCTRL"
],
[
{
"y": -0.375,
"x": 3.5,
"a": 4
},
"C",
{
"x": 10.5
},
"<\n,"
],
[
{
"y": -0.875,
"x": 2.5
},
"X",
{
"x": 1
},
"V",
{
"x": 8.5
},
"M",
{
"x": 1
},
">\n."
],
[
{
"y": -0.875,
"x": 5.5
},
"B",
{
"x": 6.5
},
"N"
],
[
{
"y": -0.875,
"x": 0.25,
"a": 5,
"w": 1.25
},
"SHIFT",
{
"a": 4
},
"Z",
{
"x": 14.5
},
"?\n/",
{
"a": 5,
"w": 1.25
},
"SHIFT"
],
[
{
"y": -0.375,
"x": 3.5
},
"*\nALT",
{
"x": 10.5
},
"Left"
],
[
{
"y": -0.875,
"x": 2.5
},
"-",
{
"x": 12.5
},
"Down"
],
[
{
"y": -0.75,
"x": 0.5
},
"|\n\n\n\n\n\n\\",
"+",
{
"x": 14.5
},
"Up",
{
"sb": "cherry",
"st": "MX1A-21xx"
},
"Right"
],
[
{
"r": 15,
"y": -2.625,
"x": 5.75,
"a": 7,
"w": 1.25
},
"SUPER"
],
[
{
"r": 30,
"rx": 6.5,
"ry": 4.25,
"y": -1,
"a": 5
},
"PgUp\nLay. 3",
{
"a": 7
},
"PgDn"
],
[
{
"h": 1.5
},
"Bksp",
{
"h": 1.5
},
"Del"
],
[
{
"r": -30,
"rx": 13,
"y": -1,
"x": -2
},
"Home",
{
"a": 5
},
"End\nLay. 3"
],
[
{
"x": -2,
"a": 7,
"h": 1.5
},
"Enter",
{
"h": 1.5
},
"Space"
],
[
{
"r": -15,
"rx": 0,
"ry": 0,
"y": 7.75,
"x": 11.75,
"w": 1.25
},
"ALT"
]
]
+18
View File
@@ -0,0 +1,18 @@
# A tweaked keymap for Redox
This keymap modifies the [default keymap](https://github.com/qmk/qmk_firmware/tree/master/keyboards/redox) for the awesome [Redox keyboard](https://github.com/mattdibi/redox-keyboard) designed by Mattia Dal Ben.
Also heavily inspired by nrichers layout.
![fculpo Layout Image](https://i.imgur.com/OXT8boJ.png)
## Changes to the default keymap
These keymap changes are meant to improve the usability of the layout in everyday use:
- Move `GUI` (`SUPER`) key to where default left `CTRL` is
- Move `/?` into usual location next to right `SHIFT` - the default flash from Falbatech put `\|` here (might not be the Redox default?), which felt unintuitive
- Put `\|` into bottom-left spot where `GUI` (`SUPER`) was - had to go somewhere and this bottom-left placement sort of balances with the almost bottom-right `/?`
- Change default `ESC` into `ESC` on tap, `CTRL` on hold - Love the UNIX-ey `CTRL` key location and wanted to keep `ESC` in the original position
- Change default `'` above right `SHIFT` into `'` on tap, `CTRL` on hold - Love the UNIX-ey CTRL key location, but it can give you 'left claw hand', which a second, mirrored `CTRL` key fixes
- Add `F11` and `F12` keys to two layers - needed on macOS if you want to control volume up and down from your keyboard (not shown, on a different layer)S
+2
View File
@@ -0,0 +1,2 @@
RGBLIGHT_ENABLE = yes
-52
View File
@@ -1,52 +0,0 @@
#include "backlight.h"
#include <avr/pgmspace.h>
/* backlighting */
void init_backlight_led(void)
{
DDRC |= (1<<PC2 | 1<<PC7);
DDRD |= (1<<PD5 | 1<<PD6);
DDRB |= (1<<PB0);
}
void backlight_led_off(uint8_t index)
{
switch (index) {
case 0:
PORTC |= (1<<PC2);
break;
case 1:
PORTC |= (1<<PC7);
break;
case 2:
PORTD |= (1<<PD5);
break;
case 3:
PORTD |= (1<<PD6);
break;
case 4:
PORTB |= (1<<PB0);
break;
}
}
void backlight_led_on(uint8_t index)
{
switch (index) {
case 0:
PORTC &= ~(1<<PC2);
break;
case 1:
PORTC &= ~(1<<PC7);
break;
case 2:
PORTD &= ~(1<<PD5);
break;
case 3:
PORTD &= ~(1<<PD6);
break;
case 4:
PORTB &= ~(1<<PB0);
break;
}
}
+17 -8
View File
@@ -1,12 +1,21 @@
#ifndef STARYU_BL /*
#define STARYU_BL Copyright 2019
#include <stdint.h> 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.
void init_backlight_led(void); 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.
void backlight_led_on(uint8_t index); 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
void backlight_led_off(uint8_t index); // Add backwards compatibility for existing keymaps
#define backlight_led_off(i) backlight_set_value(i, 0)
#endif #define backlight_led_on(i) backlight_set_value(i, 1)
+28 -34
View File
@@ -14,8 +14,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef CONFIG_H #pragma once
#define CONFIG_H
#include "config_common.h" #include "config_common.h"
@@ -32,43 +31,38 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define MATRIX_COLS 5 #define MATRIX_COLS 5
/* key matrix pins */ /* key matrix pins */
#define MATRIX_ROW_PINS { } #define MATRIX_ROW_PINS { NO_PIN }
#define MATRIX_COL_PINS { D0, D1, D2, D3, D4 } #define MATRIX_COL_PINS { D0, D1, D2, D3, D4 }
#define UNUSED_PINS #define UNUSED_PINS
// from light_ws2812_config @
// https://github.com/kairyu/tmk_keyboard_custom/tree/master/keyboard/staryu
#define RGB_DI_PIN C6
#define RGBLIGHT_ANIMATIONS
#define RGBLED_NUM 1 // Number of LEDs
/* COL2ROW or ROW2COL */ /* COL2ROW or ROW2COL */
#define DIODE_DIRECTION COL2ROW #define DIODE_DIRECTION COL2ROW
#define RGB_DI_PIN C6
#define RGBLED_NUM 1 // Number of LEDs
#define RGBLIGHT_ANIMATIONS
// #ifdef RGB_DI_PIN
// #define RGBLIGHT_HUE_STEP 8
// #define RGBLIGHT_SAT_STEP 8
// #define RGBLIGHT_VAL_STEP 8
// #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */
// #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */
// /*== all animations enable ==*/
// #define RGBLIGHT_ANIMATIONS
// /*== or choose animations ==*/
// #define RGBLIGHT_EFFECT_BREATHING
// #define RGBLIGHT_EFFECT_RAINBOW_MOOD
// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL
// #define RGBLIGHT_EFFECT_SNAKE
// #define RGBLIGHT_EFFECT_KNIGHT
// #define RGBLIGHT_EFFECT_CHRISTMAS
// #define RGBLIGHT_EFFECT_STATIC_GRADIENT
// #define RGBLIGHT_EFFECT_RGB_TEST
// #define RGBLIGHT_EFFECT_ALTERNATING
// #endif
#define BACKLIGHT_LEVELS 1 // either on/off
#define RGBLIGHT_LIMIT_VAL 200
/* Set 0 if debouncing isn't needed */ /* Set 0 if debouncing isn't needed */
#define DEBOUNCING_DELAY 5 #define DEBOUNCING_DELAY 5
// TODO backlighting
#define BACKLIGHT_LEVELS 10
// #define BACKLIGHT_PIN B7
/*
Backlight: C2, C7, D5, D6, B0
switch (index) {
case 0:
PORTC &= ~(1<<PC2);
break;
case 1:
PORTC &= ~(1<<PC7);
break;
case 2:
PORTD &= ~(1<<PD5);
break;
case 3:
PORTD &= ~(1<<PD6);
break;
case 4:
PORTB &= ~(1<<PB0);
break;
*/
#endif
+72 -49
View File
@@ -20,62 +20,85 @@ enum layers {
_LAYER0, _LAYER0,
_LAYER1, _LAYER1,
_LAYER2, _LAYER2,
_LAYER3 _LAYER3,
_LAYER4
}; };
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_LAYER0] = LAYOUT(
/* ┌─────────┬─────────┬─────────┐ */
KC_UP, TO(_LAYER1),
/* ├─────────┼─────────┼─────────┤ */
KC_LEFT, KC_DOWN, KC_RIGHT
/* └─────────┴─────────┴─────────┘ */
),
[_LAYER1] = LAYOUT(
/* ┌─────────┬─────────┬─────────┐ */
KC_PGUP, TO(_LAYER2),
/* ├─────────┼─────────┼─────────┤ */
KC_HOME, KC_PGDN, KC_END
/* └─────────┴─────────┴─────────┘ */
),
[_LAYER2] = LAYOUT(
/* ┌─────────┬─────────┬─────────┐ */
KC_MSEL, TO(_LAYER3),
/* ├─────────┼─────────┼─────────┤ */
KC_MPRV, KC_MPLY, KC_MNXT
/* └─────────┴─────────┴─────────┘ */
),
[_LAYER3] = LAYOUT(
/* ┌─────────┬─────────┬─────────┐ */
KC_MS_U, TO(_LAYER4),
/* ├─────────┼─────────┼─────────┤ */
KC_MS_L, KC_MS_D, KC_MS_R
/* └─────────┴─────────┴─────────┘ */
),
[_LAYER4] = LAYOUT(
/* ┌─────────┬─────────┬─────────┐ */
XXXXXXX, TO(_LAYER0),
/* ├─────────┼─────────┼─────────┤ */
RGB_TOG, BL_TOGG, BL_STEP
/* └─────────┴─────────┴─────────┘ */
),
const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = {
/* Keymap 0
* ,-----------.
* | |Up |Fn0|
* |---+---+---|
* |Lef|Dow|Rig|
* `-----------'
*/
LAYOUT( KC_UP, TO(_LAYER1), KC_LEFT,KC_DOWN,KC_RIGHT ),
/* Keymap 1
* ,-----------.
* | |PgU|Fn1|
* |---+---+---|
* |Hom|PgD|End|
* `-----------'
*/
LAYOUT( KC_PGUP,TO(_LAYER2), KC_HOME,KC_PGDN,KC_END ),
/* Keymap 2
* ,-----------.
* | |Sel|Fn2|
* |---+---+---|
* |Pre|Pla|Nex|
* `-----------'
*/
LAYOUT( KC_MSEL,TO(_LAYER3), KC_MPRV,KC_MPLY,KC_MNXT ),
/* Keymap 3
* ,-----------.
* | |MsU|Fn3|
* |---+---+---|
* |MsL|MsD|MsR|
* `-----------'
*/
LAYOUT( KC_MS_U,TO(_LAYER0), KC_MS_L,KC_MS_D,KC_MS_R ),
// /* Keymap 4
// * ,-----------.
// * | |Fn6|Fn4|
// * |---+---+---|
// * |Fn7|Fn5|Fn8|
// * `-----------'
// */
// LAYOUT( FN6, FN4, FN7, FN5, FN8 ),
}; };
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { void eeconfig_init_user(void) {
return MACRO_NONE ; // use the non noeeprom versions, to write these values to EEPROM too
rgblight_enable();
rgblight_mode(RGBLIGHT_MODE_BREATHING+1);
backlight_enable();
} }
void matrix_init_user(void) { void keyboard_post_init_user(void) {
//layer_state_set_user is not called for inital state - set it here
rgblight_sethsv_noeeprom_white();
} }
void matrix_scan_user(void) { uint32_t layer_state_set_user(uint32_t state) {
} switch (biton32(state)) {
case _LAYER1:
void led_set_user(uint8_t usb_led) { rgblight_sethsv_noeeprom_cyan();
break;
case _LAYER2:
rgblight_sethsv_noeeprom_magenta();
break;
case _LAYER3:
rgblight_sethsv_noeeprom_red();
break;
case _LAYER4:
rgblight_sethsv_noeeprom_orange();
break;
case _LAYER0:
default: // for any other layers, or the default layer
rgblight_sethsv_noeeprom_white();
break;
}
return state;
} }
+34 -16
View File
@@ -1,10 +1,6 @@
# MCU name # MCU name
MCU = atmega32u2 MCU = atmega32u2
BOOTLOADER = lufa-dfu
SRC = backlight_staryu.c
# Processor frequency. # Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the # This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency in Hz. You can then use this symbol in your source code to # processor frequency in Hz. You can then use this symbol in your source code to
@@ -40,21 +36,43 @@ F_USB = $(F_CPU)
# Interrupt driven control endpoint task(+60) # Interrupt driven control endpoint task(+60)
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
# Bootloader selection
# Teensy halfkay
# Pro Micro caterina
# Atmel DFU atmel-dfu
# LUFA DFU lufa-dfu
# QMK DFU qmk-dfu
# atmega32a bootloadHID
BOOTLOADER = lufa-dfu
# Boot Section Size in *bytes*
OPT_DEFS += -DBOOTLOADER_SIZE=4096 # If you don't know the bootloader type, then you can specify the
# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line
# Teensy halfKay 512
# Teensy++ halfKay 1024
# Atmel DFU loader 4096
# LUFA bootloader 4096
# USBaspLoader 2048
# OPT_DEFS += -DBOOTLOADER_SIZE=4096
# Build Options # Build Options
# comment out to disable the options. # comment out to disable the options.
# #
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE = no # Mouse keys(+4700) MOUSEKEY_ENABLE = no # Mouse keys(+4700)
EXTRAKEY_ENABLE = yes # Audio control and System control(+450) EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
CONSOLE_ENABLE = yes # Console for debug(+400) CONSOLE_ENABLE = no # Console for debug(+400)
COMMAND_ENABLE = no # Commands for debug and configuration COMMAND_ENABLE = no # Commands for debug and configuration
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
NKRO_ENABLE = no # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
BACKLIGHT_ENABLE = yes # In-switch LEDs # if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
AUDIO_ENABLE = no # There is no available timer or pin for audio on the NovelPad NKRO_ENABLE = no # USB Nkey Rollover
RGBLIGHT_ENABLE = yes # RGB LEDs for underglow, installed and enabled by default for the NovelPad BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default
RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config)
UNICODE_ENABLE = no # Unicode
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
AUDIO_ENABLE = no # Audio output on port C6
FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400)
+25 -7
View File
@@ -15,12 +15,30 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "staryu.h" #include "staryu.h"
#include "backlight_staryu.h"
// for keyboard subdirectory level init functions #ifdef BACKLIGHT_ENABLE
// @Override
void matrix_init_kb(void) { #ifdef BACKLIGHT_PIN
// call user level keymaps, if any #pragma error "BACKLIGHT_PIN must stay undefined otherwise software pwm is incorrectly used"
init_backlight_led(); #endif
matrix_init_user();
#define BACKLIGHT_PIN_COUNT 5
static const pin_t backlight_pins[BACKLIGHT_PIN_COUNT] = { C2, C7, D5, D6, B0 };
void backlight_init_ports(void) {
for (uint8_t index = 0; index < BACKLIGHT_PIN_COUNT; index++) {
setPinOutput(backlight_pins[index]);
}
} }
void backlight_set_value(uint8_t index, uint8_t level) {
writePin(backlight_pins[index], !!level);
}
void backlight_set(uint8_t level) {
for (uint8_t index = 0; index < BACKLIGHT_PIN_COUNT; index++) {
backlight_set_value(index, level);
}
}
#endif //BACKLIGHT_ENABLE
+8 -4
View File
@@ -14,15 +14,19 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef KB_H #pragma once
#define KB_H
#include "quantum.h" #include "quantum.h"
#define LAYOUT( \ #define LAYOUT( \
K00, K01, \ K00, K01, \
K10, K11, K12 \ K10, K11, K12 \
) { \ ) { \
{ K00, K01, K12, K11, K10 }, \ { K00, K01, K12, K11, K10 }, \
} }
#ifdef BACKLIGHT_ENABLE
void backlight_set_value(uint8_t index, uint8_t level);
#endif #endif
+66
View File
@@ -0,0 +1,66 @@
/*
Copyright 2019 westfoxtrot
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "config_common.h"
/* USB Device descriptor parameter */
#define VENDOR_ID 0x21FF
#define PRODUCT_ID 0xAA97
#define DEVICE_VER 0x0001
#define MANUFACTURER westfoxtrot
#define PRODUCT cypher
#define DESCRIPTION Cypher
/* key matrix size */
#define MATRIX_ROWS 10
#define MATRIX_COLS 10
/*
* Keyboard Matrix Assignments
*
* Change this to how you wired your keyboard
* COLS: AVR pins used for columns, left to right
* ROWS: AVR pins used for rows, top to bottom
* DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
* ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
*
*/
#define MATRIX_ROW_PINS { B0, B1, B2, B3, B4, F6, B6, B7, C6, C7 }
#define MATRIX_COL_PINS { D0, D1, D2, D3, D4, D5, D6, D7, E6, F0 }
#define UNUSED_PINS
/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */
#define DIODE_DIRECTION COL2ROW
#define BACKLIGHT_PIN B5
#define BACKLIGHT_BREATHING
#define BACKLIGHT_LEVELS 5
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not 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
/* If defined, GRAVE_ESC will always act as ESC when CTRL is held.
* This is userful for the Windows task manager shortcut (ctrl+shift+esc).
*/
#define GRAVE_ESC_CTRL_OVERRIDE
+56
View File
@@ -0,0 +1,56 @@
/* Copyright 2019 westfoxtrot
*
* 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 "cypher.h"
void matrix_init_kb(void) {
// put your keyboard start-up code here
// runs once when the firmware starts up
matrix_init_user();
}
void matrix_scan_kb(void) {
// put your looping keyboard code here
// runs every cycle (a lot)
matrix_scan_user();
}
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
// put your per-action keyboard code here
// runs for every action, just before processing by the firmware
return process_record_user(keycode, record);
}
void led_set_kb(uint8_t usb_led) {
if (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) {
writePinHigh(F4);
} else {
writePinLow(F4);
}
if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) {
writePinHigh(F1);
} else {
writePinLow(F1);
}
if (IS_LED_ON(usb_led, USB_LED_SCROLL_LOCK)) {
writePinHigh(F5);
} else {
writePinLow(F5);
}
led_set_user(usb_led);
}
+68
View File
@@ -0,0 +1,68 @@
/* Copyright 2019 westfoxtrot
*
* 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
#define ___ KC_NO
#include "quantum.h"
/* This a shortcut to help you visually see your layout.
*
* The first section contains all of the arguments representing the physical
* layout of the board and position of the keys.
*
* The second converts the arguments into a two-dimensional array which
* represents the switch matrix.
*/
#define LAYOUT_ansi( \
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K50, K51, K52, K53, K54, K55, K56, K57, K58,\
K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K60, K61, K62, K63, K65, K66, K67, K68, \
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K70, K71, K73, K75, K76, K77, K78, \
K30, K32, K33, K34, K35, K36, K37, K38, K39, K80, K81, K82, K83, K85, K86, K87, K88, \
K40, K41, K42, K46, K49, K90, K91, K92, K93, K95, K96, K97, K98 \
) \
{ \
{ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09 }, \
{ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19 }, \
{ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29 }, \
{ K30, ___, K32, K33, K34, K35, K36, K37, K38, K39 }, \
{ K40, K41, K42, ___, ___, ___, K46, ___, ___, K49 }, \
{ K50, K51, K52, K53, K54, K55, K56, K57, K58 }, \
{ K60, K61, K62, K63, ___, K65, K66, K67, K68 }, \
{ K70, K71, ___, K73, ___, K75, K76, K77, K78 }, \
{ K80, K81, K82, K83, ___, K85, K86, K87, K88 }, \
{ K90, K91, K92, K93, ___, K95, K96, K97, K98 } \
}
#define LAYOUT_iso( \
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K50, K51, K52, K53, K54, K55, K56, K57, K58,\
K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K60, K61, K62, K65, K66, K67, K68, \
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K70, K71, K72, K73, K75, K76, K77, K78, \
K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K80, K81, K82, K83, K85, K86, K87, K88, \
K40, K41, K42, K46, K49, K90, K91, K92, K93, K95, K96, K97, K98 \
) \
{ \
{ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09 }, \
{ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19 }, \
{ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29 }, \
{ K30, K31, K32, K33, K34, K35, K36, K37, K38, K39 }, \
{ K40, K41, K42, ___, ___, ___, K46, ___, ___, K49 }, \
{ K50, K51, K52, K53, K54, K55, K56, K57, K58 }, \
{ K60, K61, K62, ___, ___, K65, K66, K67, K68 }, \
{ K70, K71, K72, K73, ___, K75, K76, K77, K78 }, \
{ K80, K81, K82, K83, ___, K85, K86, K87, K88 }, \
{ K90, K91, K92, K93, ___, K95, K96, K97, K98 } \
}
+12
View File
@@ -0,0 +1,12 @@
{
"keyboard_name": "Cypher",
"width": 19.5,
"height": 5,
"layouts": {
"LAYOUT_ansi": {
"layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0}, {"label":"~", "x":14, "y":0}, {"label":"Num Lock", "x":15.5, "y":0}, {"label":"/", "x":16.5, "y":0}, {"label":"*", "x":17.5, "y":0}, {"label":"-", "x":18.5, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"7", "x":15.5, "y":1}, {"label":"8", "x":16.5, "y":1}, {"label":"9", "x":17.5, "y":1}, {"label":"+", "x":18.5, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"4", "x":15.5, "y":2}, {"label":"5", "x":16.5, "y":2}, {"label":"6", "x":17.5, "y":2}, {"label":"=", "x":18.5, "y":2}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Up", "x":14.25, "y":3.25}, {"label":"1", "x":15.5, "y":3}, {"label":"2", "x":16.5, "y":3}, {"label":"3", "x":17.5, "y":3}, {"label":"Enter", "x":18.5, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4}, {"label":"Alt", "x":2.25, "y":4, "w":1.25}, {"label":"Space", "x":3.5, "y":4, "w":6}, {"label":"Alt", "x":9.5, "y":4, "w":1.25}, {"label":"Win", "x":10.75, "y":4}, {"label":"Ctrl", "x":11.75, "y":4, "w":1.25}, {"label":"Left", "x":13.25, "y":4.25}, {"label":"Down", "x":14.25, "y":4.25}, {"label":"Right", "x":15.25, "y":4.25}, {"label":"0", "x":16.5, "y":4}, {"label":".", "x":17.5, "y":4}, {"label":"Backspace", "x":18.5, "y":4}] },
"LAYOUT_iso": {
"layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0}, {"label":"~", "x":14, "y":0}, {"label":"Num Lock", "x":15.5, "y":0}, {"label":"/", "x":16.5, "y":0}, {"label":"*", "x":17.5, "y":0}, {"label":"-", "x":18.5, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"7", "x":15.5, "y":1}, {"label":"8", "x":16.5, "y":1}, {"label":"9", "x":17.5, "y":1}, {"label":"+", "x":18.5, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"~", "x":12.75, "y":2}, {"label":"4", "x":15.5, "y":2}, {"label":"5", "x":16.5, "y":2}, {"label":"6", "x":17.5, "y":2}, {"label":"=", "x":18.5, "y":2}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"|", "x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Up", "x":14.25, "y":3.25}, {"label":"1", "x":15.5, "y":3}, {"label":"2", "x":16.5, "y":3}, {"label":"3", "x":17.5, "y":3}, {"label":"Enter", "x":18.5, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4}, {"label":"Alt", "x":2.25, "y":4, "w":1.25}, {"label":"Space", "x":3.5, "y":4, "w":6}, {"label":"Alt", "x":9.5, "y":4, "w":1.25}, {"label":"Win", "x":10.75, "y":4}, {"label":"Ctrl", "x":11.75, "y":4, "w":1.25}, {"label":"Left", "x":13.25, "y":4.25}, {"label":"Down", "x":14.25, "y":4.25}, {"label":"Right", "x":15.25, "y":4.25}, {"label":"0", "x":16.5, "y":4}, {"label":".", "x":17.5, "y":4}, {"label":"Backspace", "x":18.5, "y":4}] }
}
}
@@ -0,0 +1,19 @@
/* Copyright 2019 westfoxtrot
*
* 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
// place overrides here
@@ -0,0 +1,49 @@
/* Copyright 2019 westfoxtrot
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include QMK_KEYBOARD_H
#define _MA 0
#define _F1 1
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_MA] = LAYOUT_iso( /* Base */
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_DEL, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS,\
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_P7, KC_P8, KC_P9, KC_PPLS,\
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_NUHS, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PEQL,\
KC_LSFT,KC_NUBS,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_LCTRL, KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI,MO(_F1), KC_LEFT,KC_DOWN,KC_RGHT, KC_P0, KC_PDOT, KC_BSPC),
[_F1] = LAYOUT_iso( /* Function Layer */
RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, _______,\
_______, BL_TOGG,BL_STEP,BL_ON,BL_OFF,BL_INC,BL_DEC,BL_BRTG,_______,_______,_______,_______, _______, _______, _______, _______, _______,\
_______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______, _______, _______, _______, _______,\
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, _______, _______, _______,\
_______, _______,_______, _______, _______,_______,_______, _______,_______,_______, _______, _______, _______),
};
void matrix_init_user(void) {
//user initialization
}
void matrix_scan_user(void) {
//user matrix
}
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return true;
}
@@ -0,0 +1 @@
# The default iso keymap for cypher
@@ -0,0 +1,19 @@
/* Copyright 2019 westfoxtrot
*
* 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
// place overrides here
@@ -0,0 +1,49 @@
/* Copyright 2019 westfoxtrot
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include QMK_KEYBOARD_H
#define _MA 0
#define _F1 1
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_MA] = LAYOUT_ansi( /* Base */
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_DEL, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS,\
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_P7, KC_P8, KC_P9, KC_PPLS,\
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_P4, KC_P5, KC_P6, KC_PEQL,\
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_LCTRL, KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI,MO(_F1), KC_LEFT,KC_DOWN,KC_RGHT, KC_P0, KC_PDOT, KC_BSPC),
[_F1] = LAYOUT_ansi( /* Function Layer */
RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, _______,\
_______, BL_TOGG,BL_STEP,BL_ON,BL_OFF,BL_INC,BL_DEC,BL_BRTG,_______,_______,_______,_______, _______, _______, _______, _______, _______, _______,\
_______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, _______, _______,\
_______, _______,_______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, _______, _______, _______,\
_______, _______,_______, _______, _______,_______,_______, _______,_______,_______, _______, _______, _______),
};
void matrix_init_user(void) {
//user initialization
}
void matrix_scan_user(void) {
//user matrix
}
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return true;
}
@@ -0,0 +1 @@
# The default keymap for cypher
+15
View File
@@ -0,0 +1,15 @@
# cypher
![cypher](https://github.com/westfoxtrot/Cypher_PCB)
PCB for the cypher keyboard
Keyboard Maintainer: [westfoxtrot](https://github.com/westfoxtrot)
Hardware Supported: Cypher PCB
Hardware Availability: with group buy + Files released here (https://github.com/westfoxtrot/Cypher_PCB)
Make example for this keyboard (after setting up your build environment):
make westfoxtrot/cypher: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).
+81
View File
@@ -0,0 +1,81 @@
# MCU name
#MCU = at90usb1286
MCU = atmega32u4
# Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code.
#
# This will be an integer division of F_USB below, as it is sourced by
# F_USB after it has run through any CPU prescalers. Note that this value
# does not *change* the processor frequency - it should merely be updated to
# reflect the processor speed set externally so that the code can use accurate
# software delays.
F_CPU = 16000000
#
# LUFA specific
#
# Target architecture (see library "Board Types" documentation).
ARCH = AVR8
# Input clock frequency.
# This will define a symbol, F_USB, in all source code files equal to the
# input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
# at the end, this will be done automatically to create a 32-bit value in your
# source code.
#
# If no clock division is performed on the input clock inside the AVR (via the
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
F_USB = $(F_CPU)
# Interrupt driven control endpoint task(+60)
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
# Bootloader selection
# Teensy halfkay
# Pro Micro caterina
# Atmel DFU atmel-dfu
# LUFA DFU lufa-dfu
# QMK DFU qmk-dfu
# atmega32a bootloadHID
BOOTLOADER = atmel-dfu
# If you don't know the bootloader type, then you can specify the
# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line
# Teensy halfKay 512
# Teensy++ halfKay 1024
# Atmel DFU loader 4096
# LUFA bootloader 4096
# USBaspLoader 2048
# OPT_DEFS += -DBOOTLOADER_SIZE=4096
# Build Options
# change yes to no to disable
#
BOOTMAGIC_ENABLE = no # 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
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
NKRO_ENABLE = yes # USB Nkey Rollover
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default
RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config)
UNICODE_ENABLE = no # Unicode
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
AUDIO_ENABLE = no # Audio output on port C6
FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400)
@@ -22,7 +22,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
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_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_CTLE, 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_CTLE, 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_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, LT_SPCF, KC_RALT, TD_TWIN, MO(3), KC_RCTL), KC_LCTL, KC_LGUI, KC_LALT, LT_SPCF, KC_RALT, TD_TWIN, MO(3), TD_TCTL),
[1] = LAYOUT_60_ansi( [1] = 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_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,
@@ -1 +0,0 @@
Note: This board will not flash if the "g_rgb_leds" const is not set to weak in the ergodox_ez.c file
@@ -1,70 +1,2 @@
/* placeholder file */ /* placeholder file */
#include QMK_KEYBOARD_H #include QMK_KEYBOARD_H
#ifdef RGB_MATRIX_ENABLE
const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
/*{row | col << 4}
| {x=0..224, y=0..64}
| | modifier
| | | */
{{0|(0<<4)}, {24.9*5, 16*0}, 0}, // LED 1 on right
{{0|(1<<4)}, {24.9*6, 16*0}, 0}, // LED 2
{{0|(2<<4)}, {24.9*7, 16*0}, 0}, // LED 3
{{0|(3<<4)}, {24.9*8, 16*0}, 0}, // LED 4
{{0|(4<<4)}, {24.9*9, 16*0}, 0}, // LED 5
{{1|(5<<4)}, {24.9*5, 16*1}, 0}, // LED 6
{{1|(6<<4)}, {24.9*6, 16*1}, 0}, // LED 7
{{1|(7<<4)}, {24.9*7, 16*1}, 0}, // LED 8
{{1|(8<<4)}, {24.9*8, 16*1}, 0}, // LED 9
{{1|(9<<4)}, {24.9*9, 16*1}, 0}, // LED 10
{{2|(5<<4)}, {24.9*5, 16*2}, 0}, // LED 11
{{2|(6<<4)}, {24.9*6, 16*2}, 0}, // LED 12
{{2|(7<<4)}, {24.9*7, 16*2}, 0}, // LED 13
{{2|(8<<4)}, {24.9*8, 16*2}, 0}, // LED 14
{{2|(9<<4)}, {24.9*9, 16*2}, 0}, // LED 15
{{3|(5<<4)}, {24.9*5, 16*2}, 0}, // LED 16
{{3|(6<<4)}, {24.9*6, 16*2}, 0}, // LED 17
{{3|(7<<4)}, {24.9*7, 16*2}, 0}, // LED 18
{{3|(8<<4)}, {24.9*8, 16*2}, 0}, // LED 19
{{3|(9<<4)}, {24.9*9, 16*2}, 0}, // LED 20
{{4|(6<<4)}, {24.9*6, 16*2}, 1}, // LED 21
{{4|(7<<4)}, {24.9*7, 16*2}, 1}, // LED 22
{{4|(8<<4)}, {24.9*8, 16*2}, 1}, // LED 23
{{4|(9<<4)}, {24.9*9, 16*2}, 1}, // LED 24
{{0|(0<<4)}, {24.9*4, 16*0}, 0}, // LED 1 on left
{{0|(1<<4)}, {24.9*3, 16*0}, 0}, // LED 2
{{0|(2<<4)}, {24.9*2, 16*0}, 0}, // LED 3
{{0|(3<<4)}, {24.9*1, 16*0}, 0}, // LED 4
{{0|(4<<4)}, {24.9*0, 16*0}, 0}, // LED 5
{{1|(5<<4)}, {24.9*4, 16*1}, 0}, // LED 6
{{1|(6<<4)}, {24.9*3, 16*1}, 0}, // LED 7
{{1|(7<<4)}, {24.9*2, 16*1}, 0}, // LED 8
{{1|(8<<4)}, {24.9*1, 16*1}, 0}, // LED 9
{{1|(9<<4)}, {24.9*0, 16*1}, 0}, // LED 10
{{2|(5<<4)}, {24.9*4, 16*2}, 0}, // LED 11
{{2|(6<<4)}, {24.9*3, 16*2}, 0}, // LED 12
{{2|(7<<4)}, {24.9*2, 16*2}, 0}, // LED 13
{{2|(8<<4)}, {24.9*1, 16*2}, 0}, // LED 14
{{2|(9<<4)}, {24.9*0, 16*2}, 0}, // LED 15
{{3|(5<<4)}, {24.9*4, 16*2}, 0}, // LED 16
{{3|(6<<4)}, {24.9*3, 16*2}, 0}, // LED 17
{{3|(7<<4)}, {24.9*2, 16*2}, 0}, // LED 18
{{3|(8<<4)}, {24.9*1, 16*2}, 0}, // LED 19
{{3|(9<<4)}, {24.9*0, 16*2}, 0}, // LED 20
{{4|(6<<4)}, {24.9*3, 16*2}, 1}, // LED 21
{{4|(7<<4)}, {24.9*2, 16*2}, 1}, // LED 22
{{4|(8<<4)}, {24.9*1, 16*2}, 1}, // LED 23
{{4|(9<<4)}, {24.9*0, 16*2}, 1}, // LED 24
};
#endif
@@ -10,6 +10,7 @@
#undef RGBLED_NUM #undef RGBLED_NUM
#define RGBLIGHT_ANIMATIONS #define RGBLIGHT_ANIMATIONS
#define RGBLED_NUM 12 #define RGBLED_NUM 12
#define RGBLED_SPLIT { 6, 6 }
#define RGBLIGHT_HUE_STEP 8 #define RGBLIGHT_HUE_STEP 8
#define RGBLIGHT_SAT_STEP 8 #define RGBLIGHT_SAT_STEP 8
#define RGBLIGHT_VAL_STEP 8 #define RGBLIGHT_VAL_STEP 8
@@ -1,12 +1,13 @@
# Enable RGB if not a Planck ifneq ($(LAYOUTS_HAS_RGB), no)
ifeq ($(LAYOUTS_HAS_RGB),yes)
RGBLIGHT_ENABLE = yes RGBLIGHT_ENABLE = yes
endif endif
AUDIO_ENABLE = no AUDIO_ENABLE = no
ifeq ($(strip $(KEYBOARD)), zlant) ifeq ($(strip $(KEYBOARD)), zlant)
BACKLIGHT_ENABLE = no BACKLIGHT_ENABLE = no
else ifeq ($(strip $(KEYBOARD)), 40percentclub/4x4) else ifeq ($(strip $(KEYBOARD)), 40percentclub/4x4)
BACKLIGHT_ENABLE = no BACKLIGHT_ENABLE = no
else ifneq (, $(findstring lets_split, $(KEYBOARD)))
BACKLIGHT_ENABLE = no
else else
BACKLIGHT_ENABLE = yes BACKLIGHT_ENABLE = yes
endif endif
+85
View File
@@ -628,4 +628,89 @@
H__NOTE(_A5), B__NOTE(_A5), H__NOTE(_A5), H__NOTE(_G5), H__NOTE(_D5), BD_NOTE(_FS5), W__NOTE(_E5), B__NOTE(_D5), \ H__NOTE(_A5), B__NOTE(_A5), H__NOTE(_A5), H__NOTE(_G5), H__NOTE(_D5), BD_NOTE(_FS5), W__NOTE(_E5), B__NOTE(_D5), \
H__NOTE(_G4), H__NOTE(_FS4), W__NOTE(_E4), BD_NOTE(_D4), H__NOTE(_G4), H__NOTE(_FS4), W__NOTE(_E4), BD_NOTE(_D4),
#define SONG_OF_THE_ANCIENTS \
H__NOTE(_D6), H__NOTE(_EF6), B__NOTE(_EF6), H__NOTE(_EF6), H__NOTE(_D6), H__NOTE(_BF5), H__NOTE(_G5), BD_NOTE(_C6), H__NOTE(_D6), \
H__NOTE(_EF6), B__NOTE(_EF6), H__NOTE(_EF6), H__NOTE(_D6), H__NOTE(_BF5), H__NOTE(_G5), BD_NOTE(_G6), H__NOTE(_G5), \
H__NOTE(_AF5), B__NOTE(_G6), H__NOTE(_AF6), H__NOTE(_G6), H__NOTE(_F6), H__NOTE(_D6), H__NOTE(_D6), H__NOTE(_EF6), \
B__NOTE(_EF6), WD_NOTE(_G5), WD_NOTE(_BF5), H__NOTE(_D6), H__NOTE(_EF6), B__NOTE(_EF6), H__NOTE(_EF6), H__NOTE(_D6), \
H__NOTE(_BF5), H__NOTE(_G5), BD_NOTE(_C6), WD_NOTE(_B5), WD_NOTE(_G5), WD_NOTE(_G6), W__NOTE(_G6), H__NOTE(_AF6), \
W__NOTE(_G6), H__NOTE(_AF6), H__NOTE(_G6), H__NOTE(_F6), H__NOTE(_D6), H__NOTE(_D6), H__NOTE(_EF6), B__NOTE(_EF6), \
WD_NOTE(_E6), H__NOTE(_E6), H__NOTE(_F6), H__NOTE(_G6), H__NOTE(_BF6), H__NOTE(_AF6), W__NOTE(_AF6), H__NOTE(_C6), \
H__NOTE(_BF6), H__NOTE(_AF6), W__NOTE(_AF6), H__NOTE(_C6), H__NOTE(_AF6), BD_NOTE(_G6), WD_NOTE(_B5), WD_NOTE(_G6), \
W__NOTE(_G6), H__NOTE(_AF6), W__NOTE(_G6), H__NOTE(_AF6), H__NOTE(_G6), H__NOTE(_F6), H__NOTE(_D6), H__NOTE(_D6), \
H__NOTE(_EF6), B__NOTE(_EF6), WD_NOTE(_E6), H__NOTE(_E6), H__NOTE(_F6), H__NOTE(_G6), H__NOTE(_BF6), H__NOTE(_AF6), \
W__NOTE(_AF6), H__NOTE(_C6), H__NOTE(_AF6), H__NOTE(_G6), W__NOTE(_G6), H__NOTE(_F6), H__NOTE(_D6), BD_NOTE(_EF6), \
WD_NOTE(_F6), WD_NOTE(_G6), BD_NOTE(_C7),
#define NIER_AMUSEMENT_PARK \
H__NOTE(_D5), E__NOTE(_G6), E__NOTE(_GF6), Q__NOTE(_F6), Q__NOTE(_E6), Q__NOTE(_EF6), Q__NOTE(_DF6), Q__NOTE(_EF6), WD_NOTE(_D6), \
Q__NOTE(_G5), Q__NOTE(_A5), H__NOTE(_BF5), H__NOTE(_D6), H__NOTE(_G6), H__NOTE(_A6), W__NOTE(_BF6), W__NOTE(_EF7), \
H__NOTE(_D5), E__NOTE(_G6), E__NOTE(_GF6), Q__NOTE(_F6), Q__NOTE(_E6), Q__NOTE(_EF6), Q__NOTE(_DF6), Q__NOTE(_EF6), \
WD_NOTE(_D6), Q__NOTE(_G5), Q__NOTE(_A5), H__NOTE(_BF5), H__NOTE(_D6), H__NOTE(_G6), H__NOTE(_A6), W__NOTE(_BF6), \
H__NOTE(_EF7), H__NOTE(_D5), HD_NOTE(_A5), HD_NOTE(_BF5), B__NOTE(_D5), H__NOTE(_D5), HD_NOTE(_G5), HD_NOTE(_F5), \
H__NOTE(_EF5), WD_NOTE(_D5), H__NOTE(_D5), HD_NOTE(_A5), HD_NOTE(_BF5), WD_NOTE(_D5), W__NOTE(_D5), B__NOTE(_G5), \
H__NOTE(_D5), HD_NOTE(_A5), HD_NOTE(_BF5), B__NOTE(_D5), H__NOTE(_D5), HD_NOTE(_G5), HD_NOTE(_F5), H__NOTE(_EF5), \
W__NOTE(_D5), W__NOTE(_C5), W__NOTE(_BF4), W__NOTE(_C5), W__NOTE(_D5), W__NOTE(_G5), B__NOTE(_D5), B__NOTE(_E5), \
W__NOTE(_EF5), QD_NOTE(_C5), QD_NOTE(_D5), Q__NOTE(_EF5), H__NOTE(_G5), H__NOTE(_F5), H__NOTE(_EF5), H__NOTE(_F5), \
B__NOTE(_D5), B__NOTE(_BF4), W__NOTE(_EF5), QD_NOTE(_C5), QD_NOTE(_D5), Q__NOTE(_EF5), H__NOTE(_G5), H__NOTE(_F5), \
H__NOTE(_EF5), H__NOTE(_F5), W__NOTE(_D5), W__NOTE(_BF5), W__NOTE(_G5), W__NOTE(_D5), W__NOTE(_EF5), QD_NOTE(_C5), \
QD_NOTE(_D5), Q__NOTE(_EF5), H__NOTE(_G5), H__NOTE(_F5), H__NOTE(_EF5), H__NOTE(_F5), B__NOTE(_D5), B__NOTE(_BF4), \
B__NOTE(_C5), H__NOTE(_C5), H__NOTE(_D5), H__NOTE(_EF5), H__NOTE(_F5), WD_NOTE(_G5), H__NOTE(_C5), W__NOTE(_AF5), \
WD_NOTE(_G5),
#define COPIED_CITY \
Q__NOTE(_F6), Q__NOTE(_BF5), Q__NOTE(_EF6), Q__NOTE(_G5), Q__NOTE(_AF5), Q__NOTE(_G6), Q__NOTE(_AF6), Q__NOTE(_EF6), Q__NOTE(_BF5), \
Q__NOTE(_F6), Q__NOTE(_G5), Q__NOTE(_AF5), Q__NOTE(_EF6), Q__NOTE(_G5), Q__NOTE(_F5), Q__NOTE(_D6), Q__NOTE(_C6), \
Q__NOTE(_G5), Q__NOTE(_BF5), Q__NOTE(_EF5), Q__NOTE(_AF5), Q__NOTE(_G5), Q__NOTE(_EF5), Q__NOTE(_BF4), H__NOTE(_C5), \
Q__NOTE(_F5), Q__NOTE(_G5), Q__NOTE(_AF5), Q__NOTE(_EF6), Q__NOTE(_BF5), Q__NOTE(_G6), Q__NOTE(_EF6), Q__NOTE(_BF6), \
Q__NOTE(_AF6), Q__NOTE(_EF6), Q__NOTE(_BF5), Q__NOTE(_F6), Q__NOTE(_G5), Q__NOTE(_F5), Q__NOTE(_EF6), Q__NOTE(_BF5), \
Q__NOTE(_B6), Q__NOTE(_DF6), Q__NOTE(_EF6), Q__NOTE(_F6), Q__NOTE(_AF6), Q__NOTE(_EF7), Q__NOTE(_F6), Q__NOTE(_C6), \
Q__NOTE(_G5), Q__NOTE(_AF5), Q__NOTE(_BF5), Q__NOTE(_C6), Q__NOTE(_EF6), Q__NOTE(_G5), Q__NOTE(_EF5), Q__NOTE(_F5), \
Q__NOTE(_G5), Q__NOTE(_EF5), Q__NOTE(_F5), Q__NOTE(_C5), Q__NOTE(_EF5), Q__NOTE(_C5), Q__NOTE(_BF4), Q__NOTE(_G4), \
Q__NOTE(_F4), Q__NOTE(_G4), H__NOTE(_AF4), Q__NOTE(_C5), Q__NOTE(_EF5), Q__NOTE(_F5), Q__NOTE(_C5), Q__NOTE(_EF5), \
Q__NOTE(_F5), Q__NOTE(_G5), Q__NOTE(_BF5), Q__NOTE(_AF5), Q__NOTE(_G5), Q__NOTE(_EF5), Q__NOTE(_F5), Q__NOTE(_C5), \
Q__NOTE(_AF4), Q__NOTE(_F5), Q__NOTE(_G5), Q__NOTE(_AF5), Q__NOTE(_G5), Q__NOTE(_F5), Q__NOTE(_EF5), Q__NOTE(_F5), \
Q__NOTE(_G5), Q__NOTE(_BF5), Q__NOTE(_C6), Q__NOTE(_G6), Q__NOTE(_EF6), WD_NOTE(_F7),
#define VAGUE_HOPE_COLD_RAIN \
HD_NOTE(_D6), HD_NOTE(_E6), HD_NOTE(_CS6), HD_NOTE(_D6), HD_NOTE(_B5), Q__NOTE(_B5), Q__NOTE(_CS6), Q__NOTE(_D6), WD_NOTE(_A6), \
HD_NOTE(_FS6), HD_NOTE(_G6), HD_NOTE(_D6), HD_NOTE(_E6), HD_NOTE(_FS6), Q__NOTE(_D5), Q__NOTE(_CS5), Q__NOTE(_A4), \
W__NOTE(_FS4), H__NOTE(_D6), HD_NOTE(_E6), HD_NOTE(_FS6), HD_NOTE(_CS6), HD_NOTE(_E6), HD_NOTE(_D6), Q__NOTE(_CS6), \
Q__NOTE(_D6), Q__NOTE(_E6), W__NOTE(_FS6), H__NOTE(_CS6), WD_NOTE(_D6), HD_NOTE(_D6), Q__NOTE(_D6), H__NOTE(_E6), \
WD_NOTE(_CS6), HD_NOTE(_AS5), HD_NOTE(_B5), HD_NOTE(_B5), Q__NOTE(_B4), Q__NOTE(_CS5), Q__NOTE(_D5), HD_NOTE(_A5), \
Q__NOTE(_B5), Q__NOTE(_CS6), Q__NOTE(_A6), HD_NOTE(_FS6), Q__NOTE(_D5), Q__NOTE(_CS5), Q__NOTE(_A4), H__NOTE(_FS4), \
HD_NOTE(_FS6), HD_NOTE(_D6), HD_NOTE(_E6), HD_NOTE(_A6), HD_NOTE(_FS6), Q__NOTE(_CS5), Q__NOTE(_D5), Q__NOTE(_A5), \
HD_NOTE(_FS5), Q__NOTE(_FS6), Q__NOTE(_FS6), Q__NOTE(_GS6), HD_NOTE(_A6), Q__NOTE(_B6), H__NOTE(_A6), H__NOTE(_GS6), \
H__NOTE(_FS6), H__NOTE(_E6), H__NOTE(_CS6), H__NOTE(_FS6), E__NOTE(_FS5), E__NOTE(_CS5), Q__NOTE(_B4), H__NOTE(_AS4), \
W__NOTE(_FS5), HD_NOTE(_FS6), HD_NOTE(_B5), H__NOTE(_D6), H__NOTE(_CS6), H__NOTE(_E6), HD_NOTE(_A6), HD_NOTE(_E6), \
W__NOTE(_D6), Q__NOTE(_CS6), Q__NOTE(_D6), HD_NOTE(_E6), HD_NOTE(_FS6), WD_NOTE(_B6), HD_NOTE(_E6), HD_NOTE(_FS6), \
HD_NOTE(_B5), Q__NOTE(_B5), Q__NOTE(_B5), Q__NOTE(_CS6), H__NOTE(_D6), H__NOTE(_E6), H__NOTE(_FS6), HD_NOTE(_E6), \
HD_NOTE(_CS6), H__NOTE(_FS6), H__NOTE(_A6), H__NOTE(_B6), W__NOTE(_A6), H__NOTE(_FS6), BD_NOTE(_B6),
#define KAINE_SALVATION \
BD_NOTE(_D5), W__NOTE(_BF4), W__NOTE(_C5), W__NOTE(_F5), BD_NOTE(_D5), BD_NOTE(_BF4), BD_NOTE(_C5), W__NOTE(_BF4), W__NOTE(_C5), \
W__NOTE(_D5), BD_NOTE(_C5), BD_NOTE(_F4), BD_NOTE(_D5), W__NOTE(_BF4), W__NOTE(_C5), W__NOTE(_F5), BD_NOTE(_D5), \
BD_NOTE(_BF4), WD_NOTE(_EF5), WD_NOTE(_BF4), W__NOTE(_A4), W__NOTE(_BF4), W__NOTE(_C5), B__NOTE(_C5), H__NOTE(_B4), \
H__NOTE(_C5), BD_NOTE(_D5), WD_NOTE(_G5), W__NOTE(_G5), H__NOTE(_FS5), H__NOTE(_G5), H__NOTE(_A5), H__NOTE(_B5), \
H__NOTE(_A5), H__NOTE(_G5), H__NOTE(_FS5), WD_NOTE(_G5), W__NOTE(_G5), H__NOTE(_D6), H__NOTE(_C6), H__NOTE(_B5), \
H__NOTE(_A5), WD_NOTE(_G5), WD_NOTE(_G5), W__NOTE(_G5), H__NOTE(_FS5), H__NOTE(_G5), H__NOTE(_A5), H__NOTE(_B5), \
H__NOTE(_A5), H__NOTE(_G5), H__NOTE(_FS5), W__NOTE(_G5), H__NOTE(_B5), H__NOTE(_A5), H__NOTE(_G5), H__NOTE(_FS5), \
BD_NOTE(_E5), WD_NOTE(_G5), W__NOTE(_G5), H__NOTE(_FS5), H__NOTE(_G5), H__NOTE(_A5), H__NOTE(_B5), H__NOTE(_A5), \
H__NOTE(_G5), H__NOTE(_FS5), WD_NOTE(_G5), W__NOTE(_G5), H__NOTE(_D6), H__NOTE(_C6), H__NOTE(_B5), H__NOTE(_A5), \
WD_NOTE(_G5), WD_NOTE(_G5), W__NOTE(_G5), H__NOTE(_FS5), H__NOTE(_G5), H__NOTE(_A5), H__NOTE(_B5), H__NOTE(_A5), \
H__NOTE(_G5), H__NOTE(_FS5), W__NOTE(_G5), H__NOTE(_D6), WD_NOTE(_D6), W__NOTE(_F5), H__NOTE(_C6), H__NOTE(_C6), \
H__NOTE(_BF5), H__NOTE(_A5), WD_NOTE(_G5), WD_NOTE(_F5), WD_NOTE(_G5), WD_NOTE(_A5), BD_NOTE(_G5),
#define WEIGHT_OF_THE_WORLD \
H__NOTE(_B5), Q__NOTE(_C6), Q__NOTE(_C6), Q__NOTE(_B5), H__NOTE(_C6), H__NOTE(_G6), WD_NOTE(_G6), H__NOTE(_B5), Q__NOTE(_C6), \
Q__NOTE(_C6), Q__NOTE(_B5), H__NOTE(_C6), H__NOTE(_G6), H__NOTE(_G6), Q__NOTE(_A6), W__NOTE(_G6), Q__NOTE(_C6), \
Q__NOTE(_D6), H__NOTE(_E6), Q__NOTE(_F6), H__NOTE(_E6), H__NOTE(_F6), HD_NOTE(_E6), H__NOTE(_D6), H__NOTE(_C6), \
H__NOTE(_D6), WD_NOTE(_D6), Q__NOTE(_C6), Q__NOTE(_B5), WD_NOTE(_B5), H__NOTE(_B5), Q__NOTE(_C6), Q__NOTE(_C6), \
Q__NOTE(_B5), H__NOTE(_C6), H__NOTE(_G6), WD_NOTE(_G6), H__NOTE(_B5), Q__NOTE(_C6), Q__NOTE(_C6), Q__NOTE(_B5), \
H__NOTE(_C6), H__NOTE(_G6), H__NOTE(_G6), Q__NOTE(_A6), W__NOTE(_G6), Q__NOTE(_C6), Q__NOTE(_D6), H__NOTE(_E6), \
Q__NOTE(_F6), H__NOTE(_E6), H__NOTE(_F6), HD_NOTE(_E6), H__NOTE(_D6), H__NOTE(_C6), H__NOTE(_D6), BD_NOTE(_D6), \
Q__NOTE(_E6), Q__NOTE(_D6), Q__NOTE(_C6), Q__NOTE(_B5), H__NOTE(_C6), Q__NOTE(_C6), H__NOTE(_C6), HD_NOTE(_C6), \
H__NOTE(_B5), H__NOTE(_C6), H__NOTE(_E6), H__NOTE(_G6), WD_NOTE(_G6), Q__NOTE(_C6), B__NOTE(_C6), H__NOTE(_B6), \
Q__NOTE(_C7), BD_NOTE(_C7),
#endif #endif
+18 -10
View File
@@ -66,6 +66,15 @@ bool is_rgblight_initialized = false;
LED_TYPE led[RGBLED_NUM]; LED_TYPE led[RGBLED_NUM];
bool rgblight_timer_enabled = false; bool rgblight_timer_enabled = false;
static uint8_t clipping_start_pos = 0;
static uint8_t clipping_num_leds = RGBLED_NUM;
void rgblight_set_clipping_range(uint8_t start_pos, uint8_t num_leds) {
clipping_start_pos = start_pos;
clipping_num_leds = num_leds;
}
void sethsv(uint16_t hue, uint8_t sat, uint8_t val, LED_TYPE *led1) { void sethsv(uint16_t hue, uint8_t sat, uint8_t val, LED_TYPE *led1) {
uint8_t r = 0, g = 0, b = 0, base, color; uint8_t r = 0, g = 0, b = 0, base, color;
@@ -621,7 +630,7 @@ void rgblight_sethsv_at(uint16_t hue, uint8_t sat, uint8_t val, uint8_t index) {
|| defined(RGBLIGHT_EFFECT_SNAKE) || defined(RGBLIGHT_EFFECT_KNIGHT) || defined(RGBLIGHT_EFFECT_SNAKE) || defined(RGBLIGHT_EFFECT_KNIGHT)
static uint8_t get_interval_time(const uint8_t* default_interval_address, uint8_t velocikey_min, uint8_t velocikey_max) { static uint8_t get_interval_time(const uint8_t* default_interval_address, uint8_t velocikey_min, uint8_t velocikey_max) {
return return
#ifdef VELOCIKEY_ENABLE #ifdef VELOCIKEY_ENABLE
velocikey_enabled() ? velocikey_match_speed(velocikey_min, velocikey_max) : velocikey_enabled() ? velocikey_match_speed(velocikey_min, velocikey_max) :
#endif #endif
@@ -668,21 +677,20 @@ void rgblight_sethsv_slave(uint16_t hue, uint8_t sat, uint8_t val) {
#ifndef RGBLIGHT_CUSTOM_DRIVER #ifndef RGBLIGHT_CUSTOM_DRIVER
void rgblight_set(void) { void rgblight_set(void) {
LED_TYPE *start_led = led + clipping_start_pos;
uint16_t num_leds = clipping_num_leds;
if (rgblight_config.enable) { if (rgblight_config.enable) {
LED_TYPE *ledp;
#ifdef RGBLIGHT_LED_MAP #ifdef RGBLIGHT_LED_MAP
LED_TYPE led0[RGBLED_NUM]; LED_TYPE led0[RGBLED_NUM];
for(uint8_t i = 0; i < RGBLED_NUM; i++) { for(uint8_t i = 0; i < RGBLED_NUM; i++) {
led0[i] = led[pgm_read_byte(&led_map[i])]; led0[i] = led[pgm_read_byte(&led_map[i])];
} }
ledp = led0; start_led = led0 + clipping_start_pos;
#else
ledp = led;
#endif #endif
#ifdef RGBW #ifdef RGBW
ws2812_setleds_rgbw(ledp, RGBLED_NUM); ws2812_setleds_rgbw(start_led, num_leds);
#else #else
ws2812_setleds(ledp, RGBLED_NUM); ws2812_setleds(start_led, num_leds);
#endif #endif
} else { } else {
for (uint8_t i = 0; i < RGBLED_NUM; i++) { for (uint8_t i = 0; i < RGBLED_NUM; i++) {
@@ -691,9 +699,9 @@ void rgblight_set(void) {
led[i].b = 0; led[i].b = 0;
} }
#ifdef RGBW #ifdef RGBW
ws2812_setleds_rgbw(led, RGBLED_NUM); ws2812_setleds_rgbw(start_led, num_leds);
#else #else
ws2812_setleds(led, RGBLED_NUM); ws2812_setleds(start_led, num_leds);
#endif #endif
} }
} }
@@ -813,7 +821,7 @@ void rgblight_effect_breathing(uint8_t interval) {
float val; float val;
uint8_t interval_time = get_interval_time(&RGBLED_BREATHING_INTERVALS[interval], 1, 100); uint8_t interval_time = get_interval_time(&RGBLED_BREATHING_INTERVALS[interval], 1, 100);
if (timer_elapsed(last_timer) < interval_time) { if (timer_elapsed(last_timer) < interval_time) {
return; return;
} }
+1
View File
@@ -197,6 +197,7 @@ void rgblight_setrgb_master(uint8_t r, uint8_t g, uint8_t b);
void rgblight_setrgb_slave(uint8_t r, uint8_t g, uint8_t b); void rgblight_setrgb_slave(uint8_t r, uint8_t g, uint8_t b);
void rgblight_sethsv_master(uint16_t hue, uint8_t sat, uint8_t val); void rgblight_sethsv_master(uint16_t hue, uint8_t sat, uint8_t val);
void rgblight_sethsv_slave(uint16_t hue, uint8_t sat, uint8_t val); void rgblight_sethsv_slave(uint16_t hue, uint8_t sat, uint8_t val);
void rgblight_set_clipping_range(uint8_t start_pos, uint8_t num_leds);
uint32_t eeconfig_read_rgblight(void); uint32_t eeconfig_read_rgblight(void);
void eeconfig_update_rgblight(uint32_t val); void eeconfig_update_rgblight(uint32_t val);
+21 -11
View File
@@ -11,25 +11,25 @@
# include "eeconfig.h" # include "eeconfig.h"
#endif #endif
#if defined(RGBLIGHT_ENABLE) && defined(RGBLED_SPLIT)
#include "rgblight.h"
#endif
volatile bool isLeftHand = true; volatile bool isLeftHand = true;
__attribute__((weak)) __attribute__((weak))
bool is_keyboard_left(void) { bool is_keyboard_left(void) {
#ifdef SPLIT_HAND_PIN #if defined(SPLIT_HAND_PIN)
// Test pin SPLIT_HAND_PIN for High/Low, if low it's right hand // Test pin SPLIT_HAND_PIN for High/Low, if low it's right hand
setPinInput(SPLIT_HAND_PIN); setPinInput(SPLIT_HAND_PIN);
return readPin(SPLIT_HAND_PIN); return readPin(SPLIT_HAND_PIN);
#else #elif defined(EE_HANDS)
#ifdef EE_HANDS return eeprom_read_byte(EECONFIG_HANDEDNESS);
return eeprom_read_byte(EECONFIG_HANDEDNESS); #elif defined(MASTER_RIGHT)
#else return !is_keyboard_master();
#ifdef MASTER_RIGHT
return !is_keyboard_master();
#else
return is_keyboard_master();
#endif
#endif
#endif #endif
return is_keyboard_master();
} }
bool is_keyboard_master(void) bool is_keyboard_master(void)
@@ -71,6 +71,16 @@ void matrix_setup(void)
{ {
isLeftHand = is_keyboard_left(); isLeftHand = is_keyboard_left();
#if defined(RGBLIGHT_ENABLE) && defined(RGBLED_SPLIT)
uint8_t num_rgb_leds_split[2] = RGBLED_SPLIT;
if (isLeftHand) {
rgblight_set_clipping_range(0, num_rgb_leds_split[0]);
}
else {
rgblight_set_clipping_range(num_rgb_leds_split[0], num_rgb_leds_split[1]);
}
#endif
if (is_keyboard_master()) if (is_keyboard_master())
{ {
keyboard_master_setup(); keyboard_master_setup();
+15 -8
View File
@@ -92,12 +92,13 @@ typedef struct _Serial_m2s_buffer_t {
# ifdef BACKLIGHT_ENABLE # ifdef BACKLIGHT_ENABLE
uint8_t backlight_level; uint8_t backlight_level;
# endif # endif
# if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_SPLIT) # if defined(RGBLIGHT_ENABLE) && defined(RGBLED_SPLIT)
rgblight_config_t rgblight_config; // not yet use rgblight_config_t rgblight_config; // not yet use
// //
// When MCUs on both sides drive their respective RGB LED chains, // When MCUs on both sides drive their respective RGB LED chains,
// it is necessary to synchronize, so it is necessary to communicate RGB // it is necessary to synchronize, so it is necessary to communicate RGB
// information. In that case, define the RGBLIGHT_SPLIT macro. // information. In that case, define RGBLED_SPLIT with info on the number
// of LEDs on each half.
// //
// Otherwise, if the master side MCU drives both sides RGB LED chains, // Otherwise, if the master side MCU drives both sides RGB LED chains,
// there is no need to communicate. // there is no need to communicate.
@@ -132,15 +133,20 @@ bool transport_master(matrix_row_t matrix[]) {
matrix[i] = serial_s2m_buffer.smatrix[i]; matrix[i] = serial_s2m_buffer.smatrix[i];
} }
# if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_SPLIT)
// Code to send RGB over serial goes here (not implemented yet)
# endif
# ifdef BACKLIGHT_ENABLE # ifdef BACKLIGHT_ENABLE
// Write backlight level for slave to read // Write backlight level for slave to read
serial_m2s_buffer.backlight_level = backlight_config.enable ? backlight_config.level : 0; serial_m2s_buffer.backlight_level = backlight_config.enable ? backlight_config.level : 0;
# endif # endif
# if defined(RGBLIGHT_ENABLE) && defined(RGBLED_SPLIT)
static rgblight_config_t prev_rgb = {~0};
uint32_t rgb = rgblight_read_dword();
if (rgb != prev_rgb.raw) {
serial_m2s_buffer.rgblight_config.raw = rgb;
prev_rgb.raw = rgb;
}
# endif
return true; return true;
} }
@@ -152,8 +158,9 @@ void transport_slave(matrix_row_t matrix[]) {
# ifdef BACKLIGHT_ENABLE # ifdef BACKLIGHT_ENABLE
backlight_set(serial_m2s_buffer.backlight_level); backlight_set(serial_m2s_buffer.backlight_level);
# endif # endif
# if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_SPLIT) # if defined(RGBLIGHT_ENABLE) && defined(RGBLED_SPLIT)
// Add serial implementation for RGB here // Update RGB config with the new data
rgblight_update_dword(serial_m2s_buffer.rgblight_config.raw);
# endif # endif
} }
+257 -145
View File
@@ -23,13 +23,24 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "debug.h" #include "debug.h"
#include "mousekey.h" #include "mousekey.h"
inline int8_t times_inv_sqrt2(int8_t x) {
// 181/256 is pretty close to 1/sqrt(2)
// 0.70703125 0.707106781
// 1 too small for x=99 and x=198
// This ends up being a mult and discard lower 8 bits
return (x * 181) >> 8;
}
static report_mouse_t mouse_report = {0};
static report_mouse_t mouse_report = {};
static uint8_t mousekey_repeat = 0;
static uint8_t mousekey_accel = 0;
static void mousekey_debug(void); static void mousekey_debug(void);
static uint8_t mousekey_accel = 0;
static uint8_t mousekey_repeat = 0;
static uint16_t last_timer = 0;
#ifndef MK_3_SPEED
/* /*
@@ -52,155 +63,256 @@ uint8_t mk_time_to_max = MOUSEKEY_TIME_TO_MAX;
uint8_t mk_wheel_max_speed = MOUSEKEY_WHEEL_MAX_SPEED; uint8_t mk_wheel_max_speed = MOUSEKEY_WHEEL_MAX_SPEED;
uint8_t mk_wheel_time_to_max = MOUSEKEY_WHEEL_TIME_TO_MAX; uint8_t mk_wheel_time_to_max = MOUSEKEY_WHEEL_TIME_TO_MAX;
static uint8_t move_unit(void) {
static uint16_t last_timer = 0; uint16_t unit;
if (mousekey_accel & (1<<0)) {
inline int8_t times_inv_sqrt2(int8_t x) unit = (MOUSEKEY_MOVE_DELTA * mk_max_speed)/4;
{ } else if (mousekey_accel & (1<<1)) {
// 181/256 is pretty close to 1/sqrt(2) unit = (MOUSEKEY_MOVE_DELTA * mk_max_speed)/2;
// 0.70703125 0.707106781 } else if (mousekey_accel & (1<<2)) {
// 1 too small for x=99 and x=198 unit = (MOUSEKEY_MOVE_DELTA * mk_max_speed);
// This ends up being a mult and discard lower 8 bits } else if (mousekey_repeat == 0) {
return (x * 181) >> 8; unit = MOUSEKEY_MOVE_DELTA;
} else if (mousekey_repeat >= mk_time_to_max) {
unit = MOUSEKEY_MOVE_DELTA * mk_max_speed;
} else {
unit = (MOUSEKEY_MOVE_DELTA * mk_max_speed * mousekey_repeat) / mk_time_to_max;
}
return (unit > MOUSEKEY_MOVE_MAX ? MOUSEKEY_MOVE_MAX : (unit == 0 ? 1 : unit));
} }
static uint8_t move_unit(void) static uint8_t wheel_unit(void) {
{ uint16_t unit;
uint16_t unit; if (mousekey_accel & (1<<0)) {
if (mousekey_accel & (1<<0)) { unit = (MOUSEKEY_WHEEL_DELTA * mk_wheel_max_speed)/4;
unit = (MOUSEKEY_MOVE_DELTA * mk_max_speed)/4; } else if (mousekey_accel & (1<<1)) {
} else if (mousekey_accel & (1<<1)) { unit = (MOUSEKEY_WHEEL_DELTA * mk_wheel_max_speed)/2;
unit = (MOUSEKEY_MOVE_DELTA * mk_max_speed)/2; } else if (mousekey_accel & (1<<2)) {
} else if (mousekey_accel & (1<<2)) { unit = (MOUSEKEY_WHEEL_DELTA * mk_wheel_max_speed);
unit = (MOUSEKEY_MOVE_DELTA * mk_max_speed); } else if (mousekey_repeat == 0) {
} else if (mousekey_repeat == 0) { unit = MOUSEKEY_WHEEL_DELTA;
unit = MOUSEKEY_MOVE_DELTA; } else if (mousekey_repeat >= mk_wheel_time_to_max) {
} else if (mousekey_repeat >= mk_time_to_max) { unit = MOUSEKEY_WHEEL_DELTA * mk_wheel_max_speed;
unit = MOUSEKEY_MOVE_DELTA * mk_max_speed; } else {
} else { unit = (MOUSEKEY_WHEEL_DELTA * mk_wheel_max_speed * mousekey_repeat) / mk_wheel_time_to_max;
unit = (MOUSEKEY_MOVE_DELTA * mk_max_speed * mousekey_repeat) / mk_time_to_max; }
} return (unit > MOUSEKEY_WHEEL_MAX ? MOUSEKEY_WHEEL_MAX : (unit == 0 ? 1 : unit));
return (unit > MOUSEKEY_MOVE_MAX ? MOUSEKEY_MOVE_MAX : (unit == 0 ? 1 : unit));
} }
static uint8_t wheel_unit(void) void mousekey_task(void) {
{ if (timer_elapsed(last_timer) < (mousekey_repeat ? mk_interval : mk_delay*10)) {
uint16_t unit; return;
if (mousekey_accel & (1<<0)) { }
unit = (MOUSEKEY_WHEEL_DELTA * mk_wheel_max_speed)/4; if (mouse_report.x == 0 && mouse_report.y == 0 && mouse_report.v == 0 && mouse_report.h == 0) {
} else if (mousekey_accel & (1<<1)) { return;
unit = (MOUSEKEY_WHEEL_DELTA * mk_wheel_max_speed)/2; }
} else if (mousekey_accel & (1<<2)) { if (mousekey_repeat != UINT8_MAX) mousekey_repeat++;
unit = (MOUSEKEY_WHEEL_DELTA * mk_wheel_max_speed); if (mouse_report.x > 0) mouse_report.x = move_unit();
} else if (mousekey_repeat == 0) { if (mouse_report.x < 0) mouse_report.x = move_unit() * -1;
unit = MOUSEKEY_WHEEL_DELTA; if (mouse_report.y > 0) mouse_report.y = move_unit();
} else if (mousekey_repeat >= mk_wheel_time_to_max) { if (mouse_report.y < 0) mouse_report.y = move_unit() * -1;
unit = MOUSEKEY_WHEEL_DELTA * mk_wheel_max_speed; /* diagonal move [1/sqrt(2)] */
} else { if (mouse_report.x && mouse_report.y) {
unit = (MOUSEKEY_WHEEL_DELTA * mk_wheel_max_speed * mousekey_repeat) / mk_wheel_time_to_max; mouse_report.x = times_inv_sqrt2(mouse_report.x);
} mouse_report.y = times_inv_sqrt2(mouse_report.y);
return (unit > MOUSEKEY_WHEEL_MAX ? MOUSEKEY_WHEEL_MAX : (unit == 0 ? 1 : unit)); }
if (mouse_report.v > 0) mouse_report.v = wheel_unit();
if (mouse_report.v < 0) mouse_report.v = wheel_unit() * -1;
if (mouse_report.h > 0) mouse_report.h = wheel_unit();
if (mouse_report.h < 0) mouse_report.h = wheel_unit() * -1;
mousekey_send();
} }
void mousekey_task(void) void mousekey_on(uint8_t code) {
{ if (code == KC_MS_UP) mouse_report.y = move_unit() * -1;
if (timer_elapsed(last_timer) < (mousekey_repeat ? mk_interval : mk_delay*10)) else if (code == KC_MS_DOWN) mouse_report.y = move_unit();
return; else if (code == KC_MS_LEFT) mouse_report.x = move_unit() * -1;
else if (code == KC_MS_RIGHT) mouse_report.x = move_unit();
if (mouse_report.x == 0 && mouse_report.y == 0 && mouse_report.v == 0 && mouse_report.h == 0) else if (code == KC_MS_WH_UP) mouse_report.v = wheel_unit();
return; else if (code == KC_MS_WH_DOWN) mouse_report.v = wheel_unit() * -1;
else if (code == KC_MS_WH_LEFT) mouse_report.h = wheel_unit() * -1;
if (mousekey_repeat != UINT8_MAX) else if (code == KC_MS_WH_RIGHT) mouse_report.h = wheel_unit();
mousekey_repeat++; else if (code == KC_MS_BTN1) mouse_report.buttons |= MOUSE_BTN1;
else if (code == KC_MS_BTN2) mouse_report.buttons |= MOUSE_BTN2;
else if (code == KC_MS_BTN3) mouse_report.buttons |= MOUSE_BTN3;
if (mouse_report.x > 0) mouse_report.x = move_unit(); else if (code == KC_MS_BTN4) mouse_report.buttons |= MOUSE_BTN4;
if (mouse_report.x < 0) mouse_report.x = move_unit() * -1; else if (code == KC_MS_BTN5) mouse_report.buttons |= MOUSE_BTN5;
if (mouse_report.y > 0) mouse_report.y = move_unit(); else if (code == KC_MS_ACCEL0) mousekey_accel |= (1<<0);
if (mouse_report.y < 0) mouse_report.y = move_unit() * -1; else if (code == KC_MS_ACCEL1) mousekey_accel |= (1<<1);
else if (code == KC_MS_ACCEL2) mousekey_accel |= (1<<2);
/* diagonal move [1/sqrt(2)] */
if (mouse_report.x && mouse_report.y) {
mouse_report.x = times_inv_sqrt2(mouse_report.x);
mouse_report.x = mouse_report.x == 0 ? 1 : mouse_report.x;
mouse_report.y = times_inv_sqrt2(mouse_report.y);
mouse_report.y = mouse_report.y == 0 ? 1 : mouse_report.y;
}
if (mouse_report.v > 0) mouse_report.v = wheel_unit();
if (mouse_report.v < 0) mouse_report.v = wheel_unit() * -1;
if (mouse_report.h > 0) mouse_report.h = wheel_unit();
if (mouse_report.h < 0) mouse_report.h = wheel_unit() * -1;
mousekey_send();
} }
void mousekey_on(uint8_t code) void mousekey_off(uint8_t code) {
{ if (code == KC_MS_UP && mouse_report.y < 0) mouse_report.y = 0;
if (code == KC_MS_UP) mouse_report.y = move_unit() * -1; else if (code == KC_MS_DOWN && mouse_report.y > 0) mouse_report.y = 0;
else if (code == KC_MS_DOWN) mouse_report.y = move_unit(); else if (code == KC_MS_LEFT && mouse_report.x < 0) mouse_report.x = 0;
else if (code == KC_MS_LEFT) mouse_report.x = move_unit() * -1; else if (code == KC_MS_RIGHT && mouse_report.x > 0) mouse_report.x = 0;
else if (code == KC_MS_RIGHT) mouse_report.x = move_unit(); else if (code == KC_MS_WH_UP && mouse_report.v > 0) mouse_report.v = 0;
else if (code == KC_MS_WH_UP) mouse_report.v = wheel_unit(); else if (code == KC_MS_WH_DOWN && mouse_report.v < 0) mouse_report.v = 0;
else if (code == KC_MS_WH_DOWN) mouse_report.v = wheel_unit() * -1; else if (code == KC_MS_WH_LEFT && mouse_report.h < 0) mouse_report.h = 0;
else if (code == KC_MS_WH_LEFT) mouse_report.h = wheel_unit() * -1; else if (code == KC_MS_WH_RIGHT && mouse_report.h > 0) mouse_report.h = 0;
else if (code == KC_MS_WH_RIGHT) mouse_report.h = wheel_unit(); else if (code == KC_MS_BTN1) mouse_report.buttons &= ~MOUSE_BTN1;
else if (code == KC_MS_BTN1) mouse_report.buttons |= MOUSE_BTN1; else if (code == KC_MS_BTN2) mouse_report.buttons &= ~MOUSE_BTN2;
else if (code == KC_MS_BTN2) mouse_report.buttons |= MOUSE_BTN2; else if (code == KC_MS_BTN3) mouse_report.buttons &= ~MOUSE_BTN3;
else if (code == KC_MS_BTN3) mouse_report.buttons |= MOUSE_BTN3; else if (code == KC_MS_BTN4) mouse_report.buttons &= ~MOUSE_BTN4;
else if (code == KC_MS_BTN4) mouse_report.buttons |= MOUSE_BTN4; else if (code == KC_MS_BTN5) mouse_report.buttons &= ~MOUSE_BTN5;
else if (code == KC_MS_BTN5) mouse_report.buttons |= MOUSE_BTN5; else if (code == KC_MS_ACCEL0) mousekey_accel &= ~(1<<0);
else if (code == KC_MS_ACCEL0) mousekey_accel |= (1<<0); else if (code == KC_MS_ACCEL1) mousekey_accel &= ~(1<<1);
else if (code == KC_MS_ACCEL1) mousekey_accel |= (1<<1); else if (code == KC_MS_ACCEL2) mousekey_accel &= ~(1<<2);
else if (code == KC_MS_ACCEL2) mousekey_accel |= (1<<2); if (mouse_report.x == 0 && mouse_report.y == 0 && mouse_report.v == 0 && mouse_report.h == 0)
}
void mousekey_off(uint8_t code)
{
if (code == KC_MS_UP && mouse_report.y < 0) mouse_report.y = 0;
else if (code == KC_MS_DOWN && mouse_report.y > 0) mouse_report.y = 0;
else if (code == KC_MS_LEFT && mouse_report.x < 0) mouse_report.x = 0;
else if (code == KC_MS_RIGHT && mouse_report.x > 0) mouse_report.x = 0;
else if (code == KC_MS_WH_UP && mouse_report.v > 0) mouse_report.v = 0;
else if (code == KC_MS_WH_DOWN && mouse_report.v < 0) mouse_report.v = 0;
else if (code == KC_MS_WH_LEFT && mouse_report.h < 0) mouse_report.h = 0;
else if (code == KC_MS_WH_RIGHT && mouse_report.h > 0) mouse_report.h = 0;
else if (code == KC_MS_BTN1) mouse_report.buttons &= ~MOUSE_BTN1;
else if (code == KC_MS_BTN2) mouse_report.buttons &= ~MOUSE_BTN2;
else if (code == KC_MS_BTN3) mouse_report.buttons &= ~MOUSE_BTN3;
else if (code == KC_MS_BTN4) mouse_report.buttons &= ~MOUSE_BTN4;
else if (code == KC_MS_BTN5) mouse_report.buttons &= ~MOUSE_BTN5;
else if (code == KC_MS_ACCEL0) mousekey_accel &= ~(1<<0);
else if (code == KC_MS_ACCEL1) mousekey_accel &= ~(1<<1);
else if (code == KC_MS_ACCEL2) mousekey_accel &= ~(1<<2);
if (mouse_report.x == 0 && mouse_report.y == 0 && mouse_report.v == 0 && mouse_report.h == 0)
mousekey_repeat = 0;
}
void mousekey_send(void)
{
mousekey_debug();
host_mouse_send(&mouse_report);
last_timer = timer_read();
}
void mousekey_clear(void)
{
mouse_report = (report_mouse_t){};
mousekey_repeat = 0; mousekey_repeat = 0;
mousekey_accel = 0;
} }
static void mousekey_debug(void)
{
if (!debug_mouse) return;
print("mousekey [btn|x y v h](rep/acl): ["); #else /* #ifndef MK_3_SPEED */
phex(mouse_report.buttons); print("|");
print_decs(mouse_report.x); print(" ");
print_decs(mouse_report.y); print(" ");
print_decs(mouse_report.v); print(" "); enum {
print_decs(mouse_report.h); print("]("); mkspd_slow,
print_dec(mousekey_repeat); print("/"); mkspd_med,
print_dec(mousekey_accel); print(")\n"); mkspd_fast,
mkspd_COUNT
};
static uint8_t mk_speed = mkspd_med;
#ifdef MK_MOMENTARY_ACCEL
static uint8_t mkspd_DEFAULT = mkspd_med;
#endif
static uint16_t last_timer_c = 0;
static uint16_t last_timer_w = 0;
uint16_t c_offsets[mkspd_COUNT] = {
MK_C_OFFSET_SLOW, MK_C_OFFSET_MED, MK_C_OFFSET_FAST
};
uint16_t c_intervals[mkspd_COUNT] = {
MK_C_INTERVAL_SLOW, MK_C_INTERVAL_MED, MK_C_INTERVAL_FAST
};
uint16_t w_offsets[mkspd_COUNT] = {
MK_W_OFFSET_SLOW, MK_W_OFFSET_MED, MK_W_OFFSET_FAST
};
uint16_t w_intervals[mkspd_COUNT] = {
MK_W_INTERVAL_SLOW, MK_W_INTERVAL_MED, MK_W_INTERVAL_FAST
};
void mousekey_task(void) {
// report cursor and scroll movement independently
report_mouse_t const tmpmr = mouse_report;
if ((mouse_report.x || mouse_report.y) && timer_elapsed(last_timer_c) > c_intervals[mk_speed]) {
mouse_report.h = 0;
mouse_report.v = 0;
mousekey_send();
last_timer_c = last_timer;
mouse_report = tmpmr;
}
if ((mouse_report.h || mouse_report.v) && timer_elapsed(last_timer_w) > w_intervals[mk_speed]) {
mouse_report.x = 0;
mouse_report.y = 0;
mousekey_send();
last_timer_w = last_timer;
mouse_report = tmpmr;
}
}
void adjust_speed(void) {
uint16_t const c_offset = c_offsets[mk_speed];
uint16_t const w_offset = w_offsets[mk_speed];
if (mouse_report.x > 0) mouse_report.x = c_offset;
if (mouse_report.x < 0) mouse_report.x = c_offset * -1;
if (mouse_report.y > 0) mouse_report.y = c_offset;
if (mouse_report.y < 0) mouse_report.y = c_offset * -1;
if (mouse_report.h > 0) mouse_report.h = w_offset;
if (mouse_report.h < 0) mouse_report.h = w_offset * -1;
if (mouse_report.v > 0) mouse_report.v = w_offset;
if (mouse_report.v < 0) mouse_report.v = w_offset * -1;
// adjust for diagonals
if (mouse_report.x && mouse_report.y) {
mouse_report.x = times_inv_sqrt2(mouse_report.x);
mouse_report.y = times_inv_sqrt2(mouse_report.y);
}
if (mouse_report.h && mouse_report.v) {
mouse_report.h = times_inv_sqrt2(mouse_report.h);
mouse_report.v = times_inv_sqrt2(mouse_report.v);
}
}
void mousekey_on(uint8_t code) {
uint16_t const c_offset = c_offsets[mk_speed];
uint16_t const w_offset = w_offsets[mk_speed];
uint8_t const old_speed = mk_speed;
if (code == KC_MS_UP) mouse_report.y = c_offset * -1;
else if (code == KC_MS_DOWN) mouse_report.y = c_offset;
else if (code == KC_MS_LEFT) mouse_report.x = c_offset * -1;
else if (code == KC_MS_RIGHT) mouse_report.x = c_offset;
else if (code == KC_MS_WH_UP) mouse_report.v = w_offset;
else if (code == KC_MS_WH_DOWN) mouse_report.v = w_offset * -1;
else if (code == KC_MS_WH_LEFT) mouse_report.h = w_offset * -1;
else if (code == KC_MS_WH_RIGHT) mouse_report.h = w_offset;
else if (code == KC_MS_BTN1) mouse_report.buttons |= MOUSE_BTN1;
else if (code == KC_MS_BTN2) mouse_report.buttons |= MOUSE_BTN2;
else if (code == KC_MS_BTN3) mouse_report.buttons |= MOUSE_BTN3;
else if (code == KC_MS_BTN4) mouse_report.buttons |= MOUSE_BTN4;
else if (code == KC_MS_BTN5) mouse_report.buttons |= MOUSE_BTN5;
else if (code == KC_MS_ACCEL0) mk_speed = mkspd_slow;
else if (code == KC_MS_ACCEL1) mk_speed = mkspd_med;
else if (code == KC_MS_ACCEL2) mk_speed = mkspd_fast;
if (mk_speed != old_speed) adjust_speed();
}
void mousekey_off(uint8_t code) {
#ifdef MK_MOMENTARY_ACCEL
uint8_t const old_speed = mk_speed;
#endif
if (code == KC_MS_UP && mouse_report.y < 0) mouse_report.y = 0;
else if (code == KC_MS_DOWN && mouse_report.y > 0) mouse_report.y = 0;
else if (code == KC_MS_LEFT && mouse_report.x < 0) mouse_report.x = 0;
else if (code == KC_MS_RIGHT && mouse_report.x > 0) mouse_report.x = 0;
else if (code == KC_MS_WH_UP && mouse_report.v > 0) mouse_report.v = 0;
else if (code == KC_MS_WH_DOWN && mouse_report.v < 0) mouse_report.v = 0;
else if (code == KC_MS_WH_LEFT && mouse_report.h < 0) mouse_report.h = 0;
else if (code == KC_MS_WH_RIGHT && mouse_report.h > 0) mouse_report.h = 0;
else if (code == KC_MS_BTN1) mouse_report.buttons &= ~MOUSE_BTN1;
else if (code == KC_MS_BTN2) mouse_report.buttons &= ~MOUSE_BTN2;
else if (code == KC_MS_BTN3) mouse_report.buttons &= ~MOUSE_BTN3;
else if (code == KC_MS_BTN4) mouse_report.buttons &= ~MOUSE_BTN4;
else if (code == KC_MS_BTN5) mouse_report.buttons &= ~MOUSE_BTN5;
#ifdef MK_MOMENTARY_ACCEL
else if (code == KC_MS_ACCEL0) mk_speed = mkspd_DEFAULT;
else if (code == KC_MS_ACCEL1) mk_speed = mkspd_DEFAULT;
else if (code == KC_MS_ACCEL2) mk_speed = mkspd_DEFAULT;
if (mk_speed != old_speed) adjust_speed();
#endif
}
#endif /* #ifndef MK_3_SPEED */
void mousekey_send(void) {
mousekey_debug();
host_mouse_send(&mouse_report);
last_timer = timer_read();
}
void mousekey_clear(void) {
mouse_report = (report_mouse_t){};
mousekey_repeat = 0;
mousekey_accel = 0;
}
static void mousekey_debug(void) {
if (!debug_mouse) return;
print("mousekey [btn|x y v h](rep/acl): [");
phex(mouse_report.buttons); print("|");
print_decs(mouse_report.x); print(" ");
print_decs(mouse_report.y); print(" ");
print_decs(mouse_report.v); print(" ");
print_decs(mouse_report.h); print("](");
print_dec(mousekey_repeat); print("/");
print_dec(mousekey_accel); print(")\n");
} }
+48 -8
View File
@@ -16,23 +16,25 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef MOUSEKEY_H #ifndef MOUSEKEY_H
#define MOUSEKEY_H #define MOUSEKEY_H
#endif
#include <stdbool.h> #include <stdbool.h>
#include "host.h" #include "host.h"
#ifndef MK_3_SPEED
/* max value on report descriptor */ /* max value on report descriptor */
#ifndef MOUSEKEY_MOVE_MAX #ifndef MOUSEKEY_MOVE_MAX
#define MOUSEKEY_MOVE_MAX 127 #define MOUSEKEY_MOVE_MAX 127
#elif MOUSEKEY_MOVE_MAX > 127 #elif MOUSEKEY_MOVE_MAX > 127
#error MOUSEKEY_MOVE_MAX needs to be smaller than 127 #error MOUSEKEY_MOVE_MAX needs to be smaller than 127
#endif #endif
#ifndef MOUSEKEY_WHEEL_MAX #ifndef MOUSEKEY_WHEEL_MAX
#define MOUSEKEY_WHEEL_MAX 127 #define MOUSEKEY_WHEEL_MAX 127
#elif MOUSEKEY_WHEEL_MAX > 127 #elif MOUSEKEY_WHEEL_MAX > 127
#error MOUSEKEY_WHEEL_MAX needs to be smaller than 127 #error MOUSEKEY_WHEEL_MAX needs to be smaller than 127
#endif #endif
#ifndef MOUSEKEY_MOVE_DELTA #ifndef MOUSEKEY_MOVE_DELTA
@@ -60,6 +62,47 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define MOUSEKEY_WHEEL_TIME_TO_MAX 40 #define MOUSEKEY_WHEEL_TIME_TO_MAX 40
#endif #endif
#else /* #ifndef MK_3_SPEED */
#ifndef MK_C_OFFSET_SLOW
#define MK_C_OFFSET_SLOW 1
#endif
#ifndef MK_C_INTERVAL_SLOW
#define MK_C_INTERVAL_SLOW 100
#endif
#ifndef MK_C_OFFSET_MED
#define MK_C_OFFSET_MED 4
#endif
#ifndef MK_C_INTERVAL_MED
#define MK_C_INTERVAL_MED 16
#endif
#ifndef MK_C_OFFSET_FAST
#define MK_C_OFFSET_FAST 12
#endif
#ifndef MK_C_INTERVAL_FAST
#define MK_C_INTERVAL_FAST 16
#endif
#ifndef MK_W_OFFSET_SLOW
#define MK_W_OFFSET_SLOW 1
#endif
#ifndef MK_W_INTERVAL_SLOW
#define MK_W_INTERVAL_SLOW 400
#endif
#ifndef MK_W_OFFSET_MED
#define MK_W_OFFSET_MED 1
#endif
#ifndef MK_W_INTERVAL_MED
#define MK_W_INTERVAL_MED 200
#endif
#ifndef MK_W_OFFSET_FAST
#define MK_W_OFFSET_FAST 1
#endif
#ifndef MK_W_INTERVAL_FAST
#define MK_W_INTERVAL_FAST 100
#endif
#endif /* #ifndef MK_3_SPEED */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
@@ -72,7 +115,6 @@ extern uint8_t mk_time_to_max;
extern uint8_t mk_wheel_max_speed; extern uint8_t mk_wheel_max_speed;
extern uint8_t mk_wheel_time_to_max; extern uint8_t mk_wheel_time_to_max;
void mousekey_task(void); void mousekey_task(void);
void mousekey_on(uint8_t code); void mousekey_on(uint8_t code);
void mousekey_off(uint8_t code); void mousekey_off(uint8_t code);
@@ -82,5 +124,3 @@ void mousekey_send(void);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif
+41 -1
View File
@@ -1,13 +1,53 @@
#include "stanrc85.h" #include "stanrc85.h"
static td_state_t td_state;
__attribute__ ((weak)) __attribute__ ((weak))
bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
return true; return true;
} }
// determine the tapdance state to return
int cur_dance (qk_tap_dance_state_t *state) {
if (state->count == 1) {
if (state->interrupted || !state->pressed) { return SINGLE_TAP; }
else { return SINGLE_HOLD; }
}
if (state->count == 2) { return DOUBLE_TAP; }
else { return 3; } // any number higher than the maximum state value you return above
}
// handle the possible states for each tapdance keycode you define:
void ctl_copy_finished (qk_tap_dance_state_t *state, void *user_data) {
td_state = cur_dance(state);
switch (td_state) {
case SINGLE_TAP:
SEND_STRING(SS_LCTRL("c"));
break;
case SINGLE_HOLD:
register_mods(MOD_BIT(KC_RCTL));
break;
case DOUBLE_TAP:
SEND_STRING(SS_LCTRL("v"));
}
}
void ctl_copy_reset (qk_tap_dance_state_t *state, void *user_data) {
switch (td_state) {
case SINGLE_TAP:
break;
case SINGLE_HOLD:
unregister_mods(MOD_BIT(KC_RCTL));
break;
case DOUBLE_TAP:
break;
}
}
qk_tap_dance_action_t tap_dance_actions[] = { qk_tap_dance_action_t tap_dance_actions[] = {
[TD_WIN] = ACTION_TAP_DANCE_DOUBLE(KC_CAD, KC_LOCK), [TD_WIN] = ACTION_TAP_DANCE_DOUBLE(KC_CAD, KC_LOCK),
[TD_ESC] = ACTION_TAP_DANCE_DOUBLE(KC_ESC, KC_GRV) [TD_ESC] = ACTION_TAP_DANCE_DOUBLE(KC_ESC, KC_GRV),
[TD_RCTL] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, ctl_copy_finished, ctl_copy_reset)
}; };
bool process_record_user(uint16_t keycode, keyrecord_t *record) { bool process_record_user(uint16_t keycode, keyrecord_t *record) {
+25 -11
View File
@@ -8,17 +8,6 @@
#define LAYER2 2 //Function keys, arrows, custom shortcuts, volume control #define LAYER2 2 //Function keys, arrows, custom shortcuts, volume control
#define LAYER3 3 //RGB Underglow controls and RESET #define LAYER3 3 //RGB Underglow controls and RESET
enum custom_keycodes {
KC_MAKE = SAFE_RANGE,
NEW_SAFE_RANGE //use "NEW_SAFE_RANGE" for keymap specific codes
};
//Tap Dance Declarations
enum {
TD_WIN = 0,
TD_ESC
};
//Aliases for longer keycodes //Aliases for longer keycodes
#define KC_CAD LALT(LCTL(KC_DEL)) #define KC_CAD LALT(LCTL(KC_DEL))
#define KC_LOCK LGUI(KC_L) #define KC_LOCK LGUI(KC_L)
@@ -28,3 +17,28 @@ enum {
#define LT_SPCF LT(2, KC_SPC) #define LT_SPCF LT(2, KC_SPC)
#define TD_TESC TD(TD_ESC) #define TD_TESC TD(TD_ESC)
#define TD_TWIN TD(TD_WIN) #define TD_TWIN TD(TD_WIN)
#define TD_TCTL TD(TD_RCTL)
enum cust_keys {
KC_MAKE = SAFE_RANGE
};
enum tap_dance {
TD_WIN,
TD_ESC,
TD_RCTL
};
// define a type containing as many tapdance states as you need
typedef enum {
SINGLE_TAP,
SINGLE_HOLD,
DOUBLE_TAP
} td_state_t;
// function to determine the current tapdance state
int cur_dance (qk_tap_dance_state_t *state);
// `finished` and `reset` functions for each tapdance keycode
void ctl_copy_finished (qk_tap_dance_state_t *state, void *user_data);
void ctl_copy_reset (qk_tap_dance_state_t *state, void *user_data);