Merge remote-tracking branch 'upstream/master'
commit
1920c290a4
@ -0,0 +1,5 @@
|
||||
# skullY's Clueboard Layout
|
||||
|
||||
This layout is what I (@skullydazed) use on my personal Clueboards. I mostly use it for programming, CAD, and general typing.
|
||||
|
||||
The most notable change from the default layout is putting Ctrl on the Capslock key. I also swap Alt and Cmd because I mostly use a Mac day to day.
|
@ -1,4 +1,97 @@
|
||||
Clueboard keyboard firmware
|
||||
======================
|
||||
|
||||
TODO: to be updated.
|
||||
DIY/Assembled compact 66% keyboard by [Clueboard](http://clueboard.co).
|
||||
|
||||
For the full Quantum Mechanical Keyboard feature list, see [the parent readme.md](/readme.md).
|
||||
|
||||
## First Time Setup
|
||||
|
||||
Download or clone the whole firmware and navigate to the keyboards/clueboard directory. Once your dev env is setup, you'll be able to generate the default .hex:
|
||||
|
||||
```
|
||||
$ make
|
||||
```
|
||||
|
||||
You will see a lot of output and if everything worked correctly you will see something similar to this:
|
||||
|
||||
```
|
||||
Size after:
|
||||
text data bss dec hex filename
|
||||
0 19992 0 19992 4e18 clueboard_rev2_default.hex
|
||||
```
|
||||
|
||||
At this point you can press RESET on your Clueboard and flash your keyboard with this command:
|
||||
|
||||
```
|
||||
$ make dfu
|
||||
```
|
||||
|
||||
If you would like to use one of the alternative keymaps, or create your own, see below.
|
||||
|
||||
## Clueboard 1.0
|
||||
|
||||
If you have a first generation Clueboard (one with a black PCB) you will need to use the revision 1 code. To do so add `SUBPROJECT=rev1` to your make command, like this:
|
||||
|
||||
```
|
||||
$ make SUBPROJECT=rev1
|
||||
```
|
||||
|
||||
And when flashing your keyboard:
|
||||
|
||||
```
|
||||
$ make SUBPROJECT=rev1 dfu
|
||||
```
|
||||
|
||||
If you are flashing an alternative layout to your rev1, include both `SUBPROJECT=rev1` and `KEYMAP=<keymap>` in your command, for example when flashing max:
|
||||
|
||||
```
|
||||
$ make SUBPROJECT=rev1 KEYMAP=max dfu
|
||||
```
|
||||
|
||||
## Alternate Keymaps
|
||||
|
||||
There are many alternative and user-contributed layouts available in the [keymaps/](keymaps/) directory. To compile and flash an alternative you will want to add `KEYMAP=<keymap>` to your command:
|
||||
|
||||
```
|
||||
$ make KEYMAP=skully
|
||||
```
|
||||
|
||||
And when flashing your keyboard, put `KEYMAP=<keymap>` between "make" and "dfu":
|
||||
|
||||
```
|
||||
$ make KEYMAP=skully dfu
|
||||
```
|
||||
|
||||
### Notable Layouts
|
||||
|
||||
These layouts are notable for one reason or another. If you are looking for ideas or inspiration you should look at these first:
|
||||
|
||||
* [keymaps/default](keymaps/default) - The default Clueboard layout
|
||||
* [keymaps/max](keymaps/max) - A maximised layout that makes use of every key and feature of the Clueboard 2.0 PCB.
|
||||
* [keymaps/skully](keymaps/skully) - The layout that @skullydazed uses on his own Clueboards.
|
||||
|
||||
## Create Your Own Keymap
|
||||
|
||||
There are a lot of possibilities when creating your own keymap, and the primary documentation for doing that is [Customizing Your Keymap](/readme.md##customizing-your-keymap) in the main readme.md. As a way to get started, here is the procedure I recommend:
|
||||
|
||||
* Copy `[keymaps/default](keymaps/default/)` to `keymaps/<your_layout>`.
|
||||
* Compile the firmware (`$ make KEYMAP=<your_layout>`)
|
||||
* Flash the firmware (`$ make KEYMAP=<your_layout> dfu`)
|
||||
* Make sure everything works like the default keyboard
|
||||
* Modify `keymaps/<your_layout>/readme.md` to tell others about your layout.
|
||||
* Modify `keymaps/<your_layout>/keymap.c` to reflect your desired layout.
|
||||
* Compile your new custom firmware (`$ make KEYMAP=<your_layout>`)
|
||||
** If you have warnings you may flash without fixing them, but something may not work right.
|
||||
** If you have any errors you must fix them before continuing.
|
||||
* Flash the firmware (`$ make KEYMAP=<your_layout> dfu`)
|
||||
|
||||
## Share Your Keymap
|
||||
|
||||
Got your layout dialed in? Please share it with the world so we can benefit from your work! Simply submit a pull request with your layout and we'll include it in the official repository. Please use the following guidelines when putting together your pull request:
|
||||
|
||||
* Include a readme.md that states what your primary keyboard use is, how your layout differs from the default, and highlights anything you think makes your layout particularly great.
|
||||
* If your layout requires certain features (EG, RGB underlight or backlighting) ensure you have a Makefile and config.h that reflects that
|
||||
* If your layout requires special hardware to be added, please describe that in the readme.md
|
||||
|
||||
TODO: Write up or link quick how-to on creating and submitting a PR. (Pull requests accepted. :)
|
||||
|
@ -1,63 +0,0 @@
|
||||
#include "clueboard2.h"
|
||||
|
||||
void matrix_init_kb(void) {
|
||||
// put your keyboard start-up code here
|
||||
// runs once when the firmware starts up
|
||||
matrix_init_user();
|
||||
led_init_ports();
|
||||
|
||||
// JTAG disable for PORT F. write JTD bit twice within four cycles.
|
||||
MCUCR |= (1<<JTD);
|
||||
MCUCR |= (1<<JTD);
|
||||
};
|
||||
|
||||
void led_init_ports() {
|
||||
// * Set our LED pins as output
|
||||
DDRB |= (1<<4);
|
||||
}
|
||||
|
||||
void led_set_kb(uint8_t usb_led) {
|
||||
if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
|
||||
// Turn capslock on
|
||||
PORTB |= (1<<4);
|
||||
} else {
|
||||
// Turn capslock off
|
||||
PORTB &= ~(1<<4);
|
||||
}
|
||||
}
|
||||
|
||||
/* Clueboard 2.0 LED locations:
|
||||
*
|
||||
* Capslock: B4, pull high to turn on
|
||||
* LCtrl: Shared with Capslock, DO NOT INSTALL LED'S IN BOTH
|
||||
* Page Up: B7, pull high to turn on
|
||||
* Escape: D6, pull high to turn on
|
||||
* Arrows: D4, pull high to turn on
|
||||
*/
|
||||
|
||||
void backlight_init_ports(void) {
|
||||
print("init_backlight_pin()\n");
|
||||
// Set our LED pins as output
|
||||
DDRD |= (1<<6); // Esc
|
||||
DDRB |= (1<<7); // Page Up
|
||||
DDRD |= (1<<4); // Arrows
|
||||
|
||||
// Set our LED pins low
|
||||
PORTD &= ~(1<<6); // Esc
|
||||
PORTB &= ~(1<<7); // Page Up
|
||||
PORTD &= ~(1<<4); // Arrows
|
||||
}
|
||||
|
||||
void backlight_set(uint8_t level) {
|
||||
if ( level == 0 ) {
|
||||
// Turn off light
|
||||
PORTD |= (1<<6); // Esc
|
||||
PORTB |= (1<<7); // Page Up
|
||||
PORTD |= (1<<4); // Arrows
|
||||
} else {
|
||||
// Turn on light
|
||||
PORTD &= ~(1<<6); // Esc
|
||||
PORTB &= ~(1<<7); // Page Up
|
||||
PORTD &= ~(1<<4); // Arrows
|
||||
}
|
||||
}
|
@ -0,0 +1,98 @@
|
||||
#include "cluecard.h"
|
||||
#define BL_RED OCR1B
|
||||
#define BL_GREEN OCR1A
|
||||
#define BL_BLUE OCR1C
|
||||
|
||||
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) {
|
||||
// put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
|
||||
|
||||
led_set_user(usb_led);
|
||||
}
|
||||
|
||||
void backlight_init_ports(void)
|
||||
{
|
||||
// Set B5, B6, and B7 as output
|
||||
DDRB |= (1<<7)|(1<<6)|(1<<5);
|
||||
|
||||
// Setup PWM
|
||||
ICR1 = 0xFFFF;
|
||||
TCCR1A = 0b10101010;
|
||||
TCCR1B = 0b00011001;
|
||||
|
||||
BL_RED = 0xFFFF;
|
||||
BL_GREEN = 0xFFFF;
|
||||
BL_BLUE = 0xFFFF;
|
||||
}
|
||||
|
||||
void backlight_set(uint8_t level)
|
||||
{
|
||||
// Set the RGB color
|
||||
switch (level)
|
||||
{
|
||||
case 0:
|
||||
// Off
|
||||
BL_RED = 0xFFFF;
|
||||
BL_GREEN = 0xFFFF;
|
||||
BL_BLUE = 0xFFFF;
|
||||
break;
|
||||
case 1:
|
||||
// Red
|
||||
BL_RED = 0x0000;
|
||||
BL_GREEN = 0xFFFF;
|
||||
BL_BLUE = 0xFFFF;
|
||||
break;
|
||||
case 2:
|
||||
// Green
|
||||
BL_RED = 0xFFFF;
|
||||
BL_GREEN = 0x0000;
|
||||
BL_BLUE = 0xFFFF;
|
||||
break;
|
||||
case 3:
|
||||
// Blue
|
||||
BL_RED = 0xFFFF;
|
||||
BL_GREEN = 0xFFFF;
|
||||
BL_BLUE = 0x0000;
|
||||
break;
|
||||
case 4:
|
||||
// Magenta
|
||||
BL_RED = 0x4000;
|
||||
BL_GREEN = 0x4000;
|
||||
BL_BLUE = 0x4000;
|
||||
break;
|
||||
case 5:
|
||||
// Purple
|
||||
BL_RED = 0x0000;
|
||||
BL_GREEN = 0xFFFF;
|
||||
BL_BLUE = 0x0000;
|
||||
break;
|
||||
case 6:
|
||||
// Yellow
|
||||
BL_RED = 0x0000;
|
||||
BL_GREEN = 0x0000;
|
||||
BL_BLUE = 0xFFFF;
|
||||
break;
|
||||
default:
|
||||
xprintf("Unknown level: %d\n", level);
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
#ifndef CLUECARD_H
|
||||
#define CLUECARD_H
|
||||
|
||||
#include "quantum.h"
|
||||
|
||||
// This a shortcut to help you visually see your layout.
|
||||
// The first section contains all of the arguements
|
||||
// The second converts the arguments into a two-dimensional array
|
||||
#define KEYMAP( \
|
||||
k00, k01, k02, \
|
||||
k10, k12, \
|
||||
k20, k21, k22, \
|
||||
k11, \
|
||||
k30, k31, k32 \
|
||||
) { \
|
||||
{ k00, k01, k02, }, \
|
||||
{ k10, k11, k12, }, \
|
||||
{ k20, k21, k22, }, \
|
||||
{ k30, k31, k32, } \
|
||||
}
|
||||
|
||||
#endif
|
@ -0,0 +1,167 @@
|
||||
/*
|
||||
Copyright 2012 Jun Wako <wakojun@gmail.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_H
|
||||
#define CONFIG_H
|
||||
|
||||
#include "config_common.h"
|
||||
|
||||
/* USB Device descriptor parameter */
|
||||
#define VENDOR_ID 0xC1ED
|
||||
#define PRODUCT_ID 0x2330
|
||||
#define DEVICE_VER 0x0001
|
||||
#define MANUFACTURER Clueboard
|
||||
#define PRODUCT ATMEGA32U4 Firmware Dev Kit
|
||||
#define DESCRIPTION A small board to help you hack on QMK.
|
||||
|
||||
/* key matrix size */
|
||||
#define MATRIX_ROWS 4
|
||||
#define MATRIX_COLS 3
|
||||
|
||||
/*
|
||||
* 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 { F0, F5, F4, B4 }
|
||||
#define MATRIX_COL_PINS { F1, F7, F6 }
|
||||
#define UNUSED_PINS
|
||||
|
||||
/* COL2ROW or ROW2COL */
|
||||
#define DIODE_DIRECTION ROW2COL
|
||||
|
||||
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
|
||||
#define DEBOUNCING_DELAY 20
|
||||
|
||||
/* define if matrix has ghost (lacks anti-ghosting diodes) */
|
||||
//#define MATRIX_HAS_GHOST
|
||||
|
||||
/* number of backlight levels */
|
||||
#define BACKLIGHT_LEVELS 6
|
||||
|
||||
/* 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
|
||||
|
||||
/*
|
||||
* Force NKRO
|
||||
*
|
||||
* Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
|
||||
* state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
|
||||
* makefile for this to work.)
|
||||
*
|
||||
* If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
|
||||
* until the next keyboard reset.
|
||||
*
|
||||
* NKRO may prevent your keystrokes from being detected in the BIOS, but it is
|
||||
* fully operational during normal computer usage.
|
||||
*
|
||||
* For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
|
||||
* or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
|
||||
* bootmagic, NKRO mode will always be enabled until it is toggled again during a
|
||||
* power-up.
|
||||
*
|
||||
*/
|
||||
//#define FORCE_NKRO
|
||||
|
||||
/*
|
||||
* Magic Key Options
|
||||
*
|
||||
* Magic keys are hotkey commands that allow control over firmware functions of
|
||||
* the keyboard. They are best used in combination with the HID Listen program,
|
||||
* found here: https://www.pjrc.com/teensy/hid_listen.html
|
||||
*
|
||||
* The options below allow the magic key functionality to be changed. This is
|
||||
* useful if your keyboard/keypad is missing keys and you want magic key support.
|
||||
*
|
||||
*/
|
||||
|
||||
/* key combination for magic key command */
|
||||
#define IS_COMMAND() ( \
|
||||
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
|
||||
)
|
||||
|
||||
/* control how magic key switches layers */
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false
|
||||
|
||||
/* override magic key keymap */
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM
|
||||
//#define MAGIC_KEY_HELP1 H
|
||||
//#define MAGIC_KEY_HELP2 SLASH
|
||||
//#define MAGIC_KEY_DEBUG D
|
||||
//#define MAGIC_KEY_DEBUG_MATRIX X
|
||||
//#define MAGIC_KEY_DEBUG_KBD K
|
||||
//#define MAGIC_KEY_DEBUG_MOUSE M
|
||||
//#define MAGIC_KEY_VERSION V
|
||||
//#define MAGIC_KEY_STATUS S
|
||||
//#define MAGIC_KEY_CONSOLE C
|
||||
//#define MAGIC_KEY_LAYER0_ALT1 ESC
|
||||
//#define MAGIC_KEY_LAYER0_ALT2 GRAVE
|
||||
//#define MAGIC_KEY_LAYER0 0
|
||||
//#define MAGIC_KEY_LAYER1 1
|
||||
//#define MAGIC_KEY_LAYER2 2
|
||||
//#define MAGIC_KEY_LAYER3 3
|
||||
//#define MAGIC_KEY_LAYER4 4
|
||||
//#define MAGIC_KEY_LAYER5 5
|
||||
//#define MAGIC_KEY_LAYER6 6
|
||||
//#define MAGIC_KEY_LAYER7 7
|
||||
//#define MAGIC_KEY_LAYER8 8
|
||||
//#define MAGIC_KEY_LAYER9 9
|
||||
//#define MAGIC_KEY_BOOTLOADER PAUSE
|
||||
//#define MAGIC_KEY_LOCK CAPS
|
||||
//#define MAGIC_KEY_EEPROM E
|
||||
//#define MAGIC_KEY_NKRO N
|
||||
//#define MAGIC_KEY_SLEEP_LED Z
|
||||
|
||||
/* Underlight configuration
|
||||
*/
|
||||
#define RGB_DI_PIN E6
|
||||
//#define RGBLIGHT_TIMER
|
||||
#define RGBLED_NUM 4 // Number of LEDs
|
||||
#define RGBLIGHT_HUE_STEP 10
|
||||
#define RGBLIGHT_SAT_STEP 17
|
||||
#define RGBLIGHT_VAL_STEP 17
|
||||
|
||||
/*
|
||||
* Feature disable options
|
||||
* These options are also useful to firmware size reduction.
|
||||
*/
|
||||
|
||||
/* disable debug print */
|
||||
//#define NO_DEBUG
|
||||
|
||||
/* disable print */
|
||||
//#define NO_PRINT
|
||||
|
||||
/* disable action features */
|
||||
//#define NO_ACTION_LAYER
|
||||
//#define NO_ACTION_TAPPING
|
||||
//#define NO_ACTION_ONESHOT
|
||||
//#define NO_ACTION_MACRO
|
||||
//#define NO_ACTION_FUNCTION
|
||||
|
||||
#endif
|
@ -0,0 +1,21 @@
|
||||
# Build Options
|
||||
# change to "no" to disable the options, or define them in the Makefile in
|
||||
# the appropriate keymap folder that will get included automatically
|
||||
#
|
||||
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE = no # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE = no # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE = yes # Console for debug(+400)
|
||||
COMMAND_ENABLE = yes # Commands for debug and configuration
|
||||
NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
|
||||
MIDI_ENABLE = no # MIDI controls
|
||||
AUDIO_ENABLE = yes # Audio output on port C6
|
||||
UNICODE_ENABLE = no # Unicode
|
||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight.
|
||||
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../../Makefile
|
||||
endif
|
@ -0,0 +1,8 @@
|
||||
#ifndef CONFIG_USER_H
|
||||
#define CONFIG_USER_H
|
||||
|
||||
#include "../../config.h"
|
||||
|
||||
// place overrides here
|
||||
|
||||
#endif
|
@ -0,0 +1,63 @@
|
||||
#include "cluecard.h"
|
||||
#ifdef AUDIO_ENABLE
|
||||
#include "audio.h"
|
||||
#endif
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[0] = KEYMAP(
|
||||
RGB_TOG, RGB_SAI, RGB_VAI, \
|
||||
RGB_HUD, RGB_HUI, \
|
||||
RGB_MOD, RGB_SAD, RGB_VAD, \
|
||||
BL_STEP, \
|
||||
F(0), F(1), F(2) \
|
||||
)
|
||||
};
|
||||
|
||||
#ifdef AUDIO_ENABLE
|
||||
|
||||
float tone_startup[][2] = SONG(STARTUP_SOUND);
|
||||
float tone_qwerty[][2] = SONG(QWERTY_SOUND);
|
||||
float tone_dvorak[][2] = SONG(DVORAK_SOUND);
|
||||
float tone_colemak[][2] = SONG(COLEMAK_SOUND);
|
||||
float tone_plover[][2] = SONG(PLOVER_SOUND);
|
||||
float tone_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND);
|
||||
float music_scale[][2] = SONG(MUSIC_SCALE_SOUND);
|
||||
|
||||
float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
|
||||
#endif
|
||||
|
||||
const uint16_t PROGMEM fn_actions[] = {
|
||||
[0] = ACTION_FUNCTION(0),
|
||||
[1] = ACTION_FUNCTION(1),
|
||||
[2] = ACTION_FUNCTION(2)
|
||||
};
|
||||
|
||||
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
|
||||
if (record->event.pressed) {
|
||||
switch (id) {
|
||||
case 0:
|
||||
PLAY_NOTE_ARRAY(tone_startup, false, 0);
|
||||
break;
|
||||
case 1:
|
||||
PLAY_NOTE_ARRAY(music_scale, false, 0);
|
||||
break;
|
||||
case 2:
|
||||
PLAY_NOTE_ARRAY(tone_goodbye, false, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
void matrix_init_user(void) {
|
||||
}
|
||||
|
||||
void matrix_scan_user(void) {
|
||||
|
||||
}
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
return true;
|
||||
}
|
||||
|
||||
void led_set_user(uint8_t usb_led) {
|
||||
}
|
@ -0,0 +1 @@
|
||||
# The default keymap for cluecard
|
@ -0,0 +1,28 @@
|
||||
cluecard keyboard firmware
|
||||
======================
|
||||
|
||||
## Quantum MK Firmware
|
||||
|
||||
For the full Quantum feature list, see [the parent readme.md](/doc/readme.md).
|
||||
|
||||
## Building
|
||||
|
||||
Download or clone the whole firmware and navigate to the keyboards/cluecard folder. Once your dev env is setup, you'll be able to type `make` to generate your .hex - you can then use the Teensy Loader to program your .hex file.
|
||||
|
||||
Depending on which keymap you would like to use, you will have to compile slightly differently.
|
||||
|
||||
### Default
|
||||
|
||||
To build with the default keymap, simply run `make`.
|
||||
|
||||
### Other Keymaps
|
||||
|
||||
Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create a folder with the name of your keymap in the keymaps folder, and see keymap documentation (you can find in top readme.md) and existant keymap files.
|
||||
|
||||
To build the firmware binary hex file with a keymap just do `make` with `keymap` option like:
|
||||
|
||||
```
|
||||
$ make keymap=[default|jack|<name>]
|
||||
```
|
||||
|
||||
Keymaps follow the format **__keymap.c__** and are stored in folders in the `keymaps` folder, eg `keymaps/my_keymap/`
|
Binary file not shown.
Before Width: | Height: | Size: 93 KiB After Width: | Height: | Size: 92 KiB |
Binary file not shown.
Before Width: | Height: | Size: 93 KiB After Width: | Height: | Size: 93 KiB |
Binary file not shown.
Before Width: | Height: | Size: 89 KiB |
@ -0,0 +1 @@
|
||||
SRC += action_pseudo_lut.c
|
@ -0,0 +1,142 @@
|
||||
#include "quantum.h"
|
||||
#include "action_pseudo_lut.h"
|
||||
|
||||
static uint8_t send_key_shift_bit[SHIFT_BIT_SIZE];
|
||||
|
||||
/*
|
||||
* Pseudo layout action.
|
||||
* This action converts a keycode in order to output the character according to the keymap you specified
|
||||
* still your keyboard layout recognized wrongly on your OS.
|
||||
* Memo: Using other layer keymap to get keycode
|
||||
*/
|
||||
void action_pseudo_lut(keyrecord_t *record, uint8_t base_keymap_id, const uint16_t (*keymap)[2]) {
|
||||
static uint8_t prev_shift;
|
||||
uint16_t keycode;
|
||||
uint16_t pseudo_keycode;
|
||||
|
||||
/* get keycode from keymap you specified */
|
||||
keycode = keymap_key_to_keycode(base_keymap_id, record->event.key);
|
||||
|
||||
prev_shift = keyboard_report->mods & (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT));
|
||||
|
||||
if (record->event.pressed) {
|
||||
/* when magic commands entered, keycode does not converted */
|
||||
if (IS_COMMAND()) {
|
||||
if (prev_shift) {
|
||||
add_shift_bit(keycode);
|
||||
}
|
||||
register_code(keycode);
|
||||
return;
|
||||
}
|
||||
|
||||
if (prev_shift) {
|
||||
pseudo_keycode = convert_keycode(keymap, keycode, true);
|
||||
dprintf("pressed: %02X, converted: %04X\n", keycode, pseudo_keycode);
|
||||
add_shift_bit(keycode);
|
||||
|
||||
if (IS_LSFT(pseudo_keycode)) {
|
||||
register_code(QK_LSFT ^ pseudo_keycode);
|
||||
} else {
|
||||
/* delete shift mod temporarily */
|
||||
del_mods(prev_shift);
|
||||
send_keyboard_report();
|
||||
register_code(pseudo_keycode);
|
||||
add_mods(prev_shift);
|
||||
send_keyboard_report();
|
||||
}
|
||||
} else {
|
||||
pseudo_keycode = convert_keycode(keymap, keycode, false);
|
||||
dprintf("pressed: %02X, converted: %04X\n", keycode, pseudo_keycode);
|
||||
|
||||
if (IS_LSFT(pseudo_keycode)) {
|
||||
add_weak_mods(MOD_BIT(KC_LSFT));
|
||||
send_keyboard_report();
|
||||
register_code(QK_LSFT ^ pseudo_keycode);
|
||||
/* on Windows, prevent key repeat to avoid unintended output */
|
||||
unregister_code(QK_LSFT ^ pseudo_keycode);
|
||||
del_weak_mods(MOD_BIT(KC_LSFT));
|
||||
send_keyboard_report();
|
||||
} else {
|
||||
register_code(pseudo_keycode);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (get_shift_bit(keycode)) {
|
||||
del_shift_bit(keycode);
|
||||
pseudo_keycode = convert_keycode(keymap, keycode, true);
|
||||
} else {
|
||||
pseudo_keycode = convert_keycode(keymap, keycode, false);
|
||||
}
|
||||
dprintf("released: %02X, converted: %04X\n", keycode, pseudo_keycode);
|
||||
|
||||
if (IS_LSFT(pseudo_keycode)) {
|
||||
unregister_code(QK_LSFT ^ pseudo_keycode);
|
||||
} else {
|
||||
unregister_code(pseudo_keycode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
uint16_t convert_keycode(const uint16_t (*keymap)[2], uint16_t keycode, bool shift_modded)
|
||||
{
|
||||
uint16_t pseudo_keycode;
|
||||
|
||||
switch (keycode) {
|
||||
case KC_A ... KC_CAPSLOCK:
|
||||
#if defined(__AVR__)
|
||||
if (shift_modded) {
|
||||
pseudo_keycode = pgm_read_word(&keymap[keycode][1]);
|
||||
} else {
|
||||
pseudo_keycode = pgm_read_word(&keymap[keycode][0]);
|
||||
}
|
||||
#else
|
||||
if (shift_modded) {
|
||||
pseudo_keycode = keymap[keycode][1];
|
||||
} else {
|
||||
pseudo_keycode = keymap[keycode][0];
|
||||
}
|
||||
#endif
|
||||
/* if undefined, use got keycode as it is */
|
||||
if (pseudo_keycode == 0x00) {
|
||||
if (shift_modded) {
|
||||
pseudo_keycode = S(keycode);
|
||||
} else {
|
||||
pseudo_keycode = keycode;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (shift_modded) {
|
||||
pseudo_keycode = S(keycode);
|
||||
} else {
|
||||
pseudo_keycode = keycode;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return pseudo_keycode;
|
||||
}
|
||||
|
||||
uint8_t get_shift_bit(uint16_t keycode) {
|
||||
if ((keycode >> 3) < SHIFT_BIT_SIZE) {
|
||||
return send_key_shift_bit[keycode >> 3] & (1 << (keycode & 7));
|
||||
} else {
|
||||
dprintf("get_shift_bit: Can't get shift bit. keycode: %02X\n", keycode);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
void add_shift_bit(uint16_t keycode) {
|
||||
if ((keycode >> 3) < SHIFT_BIT_SIZE) {
|
||||
send_key_shift_bit[keycode >> 3] |= (1 << (keycode & 7));
|
||||
} else {
|
||||
dprintf("add_shift_bit: Can't add shift bit. keycode: %02X\n", keycode);
|
||||
}
|
||||
}
|
||||
|
||||
void del_shift_bit(uint16_t keycode) {
|
||||
if ((keycode >> 3) < SHIFT_BIT_SIZE) {
|
||||
send_key_shift_bit[keycode >> 3] &= ~(1 << (keycode & 7));
|
||||
} else {
|
||||
dprintf("del_shift_bit: Can't delete shift bit. keycode: %02X\n", keycode);
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
#ifndef ACTION_PSEUDO_LUT_H
|
||||
#define ACTION_PSEUDO_LUT_H
|
||||
|
||||
#define SHIFT_BIT_SIZE (0xE7 / 8 + 1) // 1bit per 1key
|
||||
|
||||
#define IS_LSFT(kc) ((QK_LSFT & (kc)) == QK_LSFT)
|
||||
|
||||
void action_pseudo_lut(keyrecord_t *, uint8_t, const uint16_t (*)[2]);
|
||||
uint16_t convert_keycode(const uint16_t (*)[2], uint16_t, bool);
|
||||
|
||||
uint8_t get_shift_bit(uint16_t);
|
||||
void add_shift_bit(uint16_t);
|
||||
void del_shift_bit(uint16_t);
|
||||
|
||||
#endif
|
@ -0,0 +1,12 @@
|
||||
#ifndef CONFIG_SHELA_H
|
||||
#define CONFIG_SHELA_H
|
||||
|
||||
#include "../../config.h"
|
||||
|
||||
#undef TAPPING_TERM
|
||||
#define TAPPING_TERM 230
|
||||
|
||||
#define ONESHOT_TAP_TOGGLE 2
|
||||
#define ONESHOT_TIMEOUT 2000
|
||||
|
||||
#endif
|
@ -0,0 +1,179 @@
|
||||
/*
|
||||
* HHKB Pro 2 US Layout for shela
|
||||
*/
|
||||
#include "hhkb.h"
|
||||
#include "keymap_jis2us.h"
|
||||
#include "action_pseudo_lut.h"
|
||||
|
||||
enum keymap_layout {
|
||||
BASE = 0,
|
||||
PSEUDO_US,
|
||||
DVORAK,
|
||||
MOUSE,
|
||||
TENKEY,
|
||||
HHKB,
|
||||
SPACE_FN,
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
/* Layer 0: Default Layer
|
||||
* ,-----------------------------------------------------------------------------------------.
|
||||
* | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | ` | BSp |
|
||||
* |-----------------------------------------------------------------------------------------|
|
||||
* | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ |
|
||||
* |-----------------------------------------------------------------------------------------|
|
||||
* | Control | A | S | D | F | G | H | J | K | L | ; | ' | Enter |
|
||||
* |-----------------------------------------------------------------------------------------|
|
||||
* | Shift | Z | X | C | V | B | N | M | , | . | / | Shift | Fn0 |
|
||||
* `-----------------------------------------------------------------------------------------'
|
||||
* |LAlt | LGui | SpaceFN | RGui |RAlt |
|
||||
* `-----------------------------------------------------------------'
|
||||
*/
|
||||
[BASE] =
|
||||
KEYMAP(KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,KC_EQL, KC_GRV, KC_BSPC, \
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,KC_RBRC,KC_BSLS, \
|
||||
KC_LCTL,KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT,KC_ENT, \
|
||||
OSM(MOD_LSFT),KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,KC_RSFT,KC_FN0, \
|
||||
KC_LALT,KC_LGUI, KC_FN2, KC_RGUI,KC_RALT),
|
||||
|
||||
/* Layer 1: Pseudo US Layout Layer */
|
||||
[PSEUDO_US] =
|
||||
KEYMAP(KC_ESC, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_BSPC, \
|
||||
KC_TAB, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, \
|
||||
KC_LCTL,KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_ENT, \
|
||||
OSM(MOD_LSFT),KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_RSFT,KC_FN0, \
|
||||
KC_LGUI,KC_FN3, KC_FN2, KC_FN4 ,KC_RGUI),
|
||||
|
||||
/* Layer 2: Dvorak Layer
|
||||
* ,-----------------------------------------------------------------------------------------.
|
||||
* | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | [ | ] | ` | BSp |
|
||||
* |-----------------------------------------------------------------------------------------|
|
||||
* | Tab | ' | , | . | P | Y | F | G | C | R | L | / | = | \ |
|
||||
* |-----------------------------------------------------------------------------------------|
|
||||
* | Control | A | O | E | U | I | D | H | T | N | S | - | Enter |
|
||||
* |-----------------------------------------------------------------------------------------|
|
||||
* | Shift | ; | Q | J | K | X | B | M | W | V | Z | Shift | Fn0 |
|
||||
* `-----------------------------------------------------------------------------------------'
|
||||
* |LAlt | LGui | SpaceFN | RGui |RAlt |
|
||||
* `-----------------------------------------------------------------'
|
||||
*/
|
||||
[DVORAK] =
|
||||
KEYMAP(KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC,KC_RBRC,KC_GRV, KC_BSPC, \
|
||||
KC_TAB, KC_QUOT,KC_COMM,KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH,KC_EQL, KC_BSLS, \
|
||||
KC_LCTL,KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS,KC_ENT, \
|
||||
KC_LSFT,KC_SCLN,KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT,KC_FN0, \
|
||||
KC_LALT,KC_LGUI, KC_FN2, KC_RGUI,KC_RALT),
|
||||
|
||||
/* Layer 3: Mouse layer
|
||||
* ,-----------------------------------------------------------------------------------------.
|
||||
* | Esc | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | | |
|
||||
* |-----------------------------------------------------------------------------------------|
|
||||
* | | | | | | | MwL | MwD | MwU | MwR | | | | |
|
||||
* |-----------------------------------------------------------------------------------------|
|
||||
* | | | | | | | McL | McD | McU | McR | | | |
|
||||
* |-----------------------------------------------------------------------------------------|
|
||||
* | | | | | | | Mb1 | Mb2 | Mb3 | | | | Fn0 |
|
||||
* `-----------------------------------------------------------------------------------------'
|
||||
* | | | Mb1 | | |
|
||||
* `-----------------------------------------------------------------'
|
||||
*/
|
||||
[MOUSE] =
|
||||
KEYMAP(KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NO, KC_TRNS, \
|
||||
KC_TRNS,KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_WH_L,KC_WH_D,KC_WH_U,KC_WH_R,KC_NO, KC_NO, KC_NO, KC_NO, \
|
||||
KC_TRNS,KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_MS_L,KC_MS_D,KC_MS_U,KC_MS_R,KC_NO, KC_NO, KC_TRNS, \
|
||||
KC_TRNS,KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_BTN1,KC_BTN2,KC_BTN3,KC_NO, KC_NO, KC_TRNS,KC_FN0, \
|
||||
KC_TRNS,KC_TRNS, KC_BTN1, KC_TRNS,KC_TRNS),
|
||||
|
||||
/* Layer 4: Tenkey layer
|
||||
* ,-----------------------------------------------------------------------------------------.
|
||||
* | Esc | | | | | | | | | | / | * | - | | BSp |
|
||||
* |-----------------------------------------------------------------------------------------|
|
||||
* | | | | | | | | | | 7 | 8 | 9 | + | |
|
||||
* |-----------------------------------------------------------------------------------------|
|
||||
* | | | | | | | | | | 4 | 5 | 6 | Enter |
|
||||
* |-----------------------------------------------------------------------------------------|
|
||||
* | | | | | | | | | 1 | 2 | 3 | + | Fn0 |
|
||||
* `-----------------------------------------------------------------------------------------'
|
||||
* | | | SpaceFN | 0 | . |
|
||||
* `-----------------------------------------------------------------'
|
||||
*/
|
||||
[TENKEY] =
|
||||
KEYMAP(KC_ESC, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_PSLS,KC_PAST,KC_PMNS,KC_NO, KC_BSPC, \
|
||||
KC_TRNS,KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_KP_7,KC_KP_8,KC_KP_9,KC_PPLS,KC_NO, \
|
||||
KC_TRNS,KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_KP_4,KC_KP_5,KC_KP_6,KC_PENT, \
|
||||
KC_TRNS,KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_KP_1,KC_KP_2,KC_KP_3,KC_PPLS,KC_FN0, \
|
||||
KC_TRNS,KC_TRNS, KC_FN2, KC_KP_0,KC_PDOT),
|
||||
|
||||
/* Layer 5: HHKB mode (HHKB Fn)
|
||||
* ,-----------------------------------------------------------------------------------------.
|
||||
* | Pwr | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | Ins | Del |
|
||||
* |-----------------------------------------------------------------------------------------|
|
||||
* | Caps | Fn5 | Fn6 | Fn7 | Fn8 | Fn9 | | | Psc | Slk | Pus | Up | | BSp |
|
||||
* |-----------------------------------------------------------------------------------------|
|
||||
* | | VoD | VoU | Mut | | | * | / | Hom | PgU | Lef | Rig | Enter |
|
||||
* |-----------------------------------------------------------------------------------------|
|
||||
* | | | | | | | + | - | End | PgD | Dow | | |
|
||||
* `-----------------------------------------------------------------------------------------'
|
||||
* | | | | | |
|
||||
* `-----------------------------------------------------------------'
|
||||
*/
|
||||
[HHKB] =
|
||||
KEYMAP(KC_PWR, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, \
|
||||
KC_CAPS,KC_FN5, KC_FN6, KC_FN7, KC_FN8, KC_FN9, KC_TRNS,KC_TRNS,KC_PSCR,KC_SLCK,KC_PAUS,KC_UP, KC_TRNS,KC_BSPC, \
|
||||
KC_TRNS,KC_VOLD,KC_VOLU,KC_MUTE,KC_TRNS,KC_TRNS,KC_PAST,KC_PSLS,KC_HOME,KC_PGUP,KC_LEFT,KC_RGHT,KC_PENT, \
|
||||
KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_PPLS,KC_PMNS,KC_END, KC_PGDN,KC_DOWN,KC_TRNS,KC_TRNS, \
|
||||
KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS),
|
||||
|
||||
/* Layer 6: SpaceFN
|
||||
* ,-----------------------------------------------------------------------------------------.
|
||||
* | ` | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | | Del |
|
||||
* |-----------------------------------------------------------------------------------------|
|
||||
* | | End | Up | Hom | | | | Hom | Up | End | Psc | Slk | Pau | Ins |
|
||||
* |-----------------------------------------------------------------------------------------|
|
||||
* | | Lef | Dow | Rig | PgU | | PgU | Lef | Dow | Rig | | | |
|
||||
* |-----------------------------------------------------------------------------------------|
|
||||
* | | | | PgD | | Spc | PgD | ` | ~ | | | | |
|
||||
* `-----------------------------------------------------------------------------------------'
|
||||
* | | | | | |
|
||||
* `-----------------------------------------------------------------'
|
||||
*/
|
||||
[SPACE_FN] =
|
||||
KEYMAP(KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NO, KC_DEL, \
|
||||
KC_TRNS,KC_END, KC_UP, KC_HOME,KC_NO, KC_NO, KC_NO, KC_HOME,KC_UP, KC_END, KC_PSCR,KC_SLCK,KC_PAUS,KC_INS, \
|
||||
KC_TRNS,KC_LEFT,KC_DOWN,KC_RGHT,KC_PGUP,KC_NO, KC_PGUP,KC_LEFT,KC_DOWN,KC_RGHT,KC_NO, KC_NO, KC_TRNS, \
|
||||
KC_TRNS,KC_NO, KC_NO, KC_PGDN,KC_NO, KC_SPC, KC_PGDN,KC_GRV, KC_TILD,KC_NO, KC_NO, KC_TRNS,KC_NO, \
|
||||
KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS),
|
||||
};
|
||||
|
||||
/*
|
||||
* user defined action function
|
||||
*/
|
||||
enum function_id {
|
||||
PSEUDO_US_FUNCTION,
|
||||
};
|
||||
|
||||
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
|
||||
|
||||
switch (id) {
|
||||
case PSEUDO_US_FUNCTION:
|
||||
action_pseudo_lut(record, BASE, keymap_jis2us);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Fn action definition
|
||||
*/
|
||||
const uint16_t PROGMEM fn_actions[] = {
|
||||
[0] = ACTION_LAYER_MOMENTARY(HHKB),
|
||||
[1] = ACTION_FUNCTION(PSEUDO_US_FUNCTION),
|
||||
[2] = ACTION_LAYER_TAP_KEY(SPACE_FN, KC_SPACE),
|
||||
[3] = ACTION_MODS_TAP_KEY(MOD_LALT, KC_MHEN),
|
||||
[4] = ACTION_MODS_TAP_KEY(MOD_RALT, KC_KANA),
|
||||
[5] = ACTION_DEFAULT_LAYER_SET(BASE),
|
||||
[6] = ACTION_DEFAULT_LAYER_SET(PSEUDO_US),
|
||||
[7] = ACTION_DEFAULT_LAYER_SET(MOUSE),
|
||||
[8] = ACTION_DEFAULT_LAYER_SET(TENKEY),
|
||||
[9] = ACTION_DEFAULT_LAYER_SET(DVORAK),
|
||||
};
|
@ -0,0 +1,32 @@
|
||||
#ifndef KEYMAP_JIS2US_H
|
||||
#define KEYMAP_JIS2US_H
|
||||
|
||||
/* keymap for convert from JIS to US */
|
||||
const uint16_t PROGMEM keymap_jis2us[][2] = {
|
||||
[KC_A ... KC_CAPS] = { 0x00, 0x00 }, /* default value */
|
||||
|
||||
[KC_1] = { KC_1, KC_EXLM }, /* 1 and ! -> 1 and ! */
|
||||
[KC_2] = { KC_2, KC_LBRC }, /* 2 and " -> 2 and @ */
|
||||
[KC_3] = { KC_3, KC_HASH }, /* 3 and # -> 3 and # */
|
||||
[KC_4] = { KC_4, KC_DLR }, /* 4 and $ -> 4 and $ */
|
||||
[KC_5] = { KC_5, KC_PERC }, /* 5 and % -> 5 and % */
|
||||
[KC_6] = { KC_6, KC_EQL }, /* 6 and & -> 6 and ^ */
|
||||
[KC_7] = { KC_7, KC_CIRC }, /* 7 and ' -> 7 and & */
|
||||
[KC_8] = { KC_8, KC_DQT }, /* 8 and ( -> 8 and * */
|
||||
[KC_9] = { KC_9, KC_ASTR }, /* 9 and ) -> 9 and ( */
|
||||
[KC_0] = { KC_0, KC_LPRN }, /* 0 and (no assign) -> 0 and ) */
|
||||
[KC_MINS] = { KC_MINS, S(KC_RO) }, /* - and = -> - and _ */
|
||||
[KC_EQL] = { KC_UNDS, KC_COLN }, /* ^ and ~ -> = and + */
|
||||
[KC_LBRC] = { KC_RBRC, KC_RCBR }, /* @ and ` -> [ and { */
|
||||
[KC_RBRC] = { KC_BSLS, KC_PIPE }, /* [ and { -> ] and } */
|
||||
[KC_BSLS] = { KC_JYEN, S(KC_JYEN) }, /* ] and } -> / and | */
|
||||
[KC_NUHS] = { KC_NUHS, S(KC_NUHS) }, /* (no assign) */
|
||||
[KC_SCLN] = { KC_SCLN, KC_QUOT }, /* ; and + -> ; and : */
|
||||
[KC_QUOT] = { KC_AMPR, KC_AT }, /* : and * -> ' and " */
|
||||
[KC_GRV] = { KC_LCBR, KC_PLUS }, /* (no assign) -> ` and ~ */
|
||||
[KC_COMM] = { KC_COMM, KC_LT }, /* , and < -> , and < */
|
||||
[KC_DOT] = { KC_DOT, KC_GT }, /* . and > -> . and > */
|
||||
[KC_SLSH] = { KC_SLSH, KC_QUES }, /* / and ? -> / and ? */
|
||||
};
|
||||
|
||||
#endif
|
@ -0,0 +1,14 @@
|
||||
# Shela's HHKB Layout
|
||||
|
||||
Layer 0: US Layout
|
||||
Layer 1: Pseudo US Layout
|
||||
Layer 2: Dvorak Layout
|
||||
Layer 3: Mouse
|
||||
Layer 4: Tenkey
|
||||
Layer 5: HHKB Fn Key
|
||||
Layer 6: SpaceFN
|
||||
|
||||
## Pseudo US Layout
|
||||
|
||||
On japanese Windows, HHKB Professional 2 US layout model recognized wrongly as JIS layout without changing OS settings.
|
||||
But, you can use HHKB like a US layout keyboard as it is.
|
@ -0,0 +1,27 @@
|
||||
|
||||
|
||||
# Build Options
|
||||
# change to "no" to disable the options, or define them in the Makefile in
|
||||
# the appropriate keymap folder that will get included automatically
|
||||
#
|
||||
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE = no # Console for debug(+400)
|
||||
COMMAND_ENABLE = yes # Commands for debug and configuration
|
||||
NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
|
||||
MIDI_ENABLE = no # MIDI controls
|
||||
AUDIO_ENABLE = yes # Audio output on port C6
|
||||
UNICODE_ENABLE = no # Unicode
|
||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
|
||||
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||
|
||||
TAP_DANCE_ENABLE = yes
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../../Makefile
|
||||
endif
|
@ -0,0 +1,92 @@
|
||||
/*
|
||||
Copyright 2012 Jun Wako <wakojun@gmail.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_H
|
||||
#define CONFIG_H
|
||||
|
||||
#include "config_common.h"
|
||||
|
||||
/* USB Device descriptor parameter */
|
||||
#define VENDOR_ID 0xFEED
|
||||
#define PRODUCT_ID 0x6061
|
||||
#define DEVICE_VER 0x0001
|
||||
#define MANUFACTURER Ortholinear Keyboards
|
||||
#define PRODUCT The Preonic Keyboard
|
||||
#define DESCRIPTION A compact ortholinear keyboard
|
||||
|
||||
/* key matrix size */
|
||||
#define MATRIX_ROWS 5
|
||||
#define MATRIX_COLS 12
|
||||
|
||||
/* Planck PCB default pin-out */
|
||||
#define MATRIX_ROW_PINS { D2, D5, B5, B6, D3 }
|
||||
#define MATRIX_COL_PINS { F1, F0, B0, C7, F4, F5, F6, F7, D4, D6, B4, D7 }
|
||||
#define UNUSED_PINS
|
||||
|
||||
#define BACKLIGHT_PIN B7
|
||||
|
||||
/* COL2ROW or ROW2COL */
|
||||
#define DIODE_DIRECTION COL2ROW
|
||||
|
||||
/* define if matrix has ghost */
|
||||
//#define MATRIX_HAS_GHOST
|
||||
|
||||
/* number of backlight levels */
|
||||
#define BACKLIGHT_LEVELS 3
|
||||
|
||||
/* Set 0 if debouncing isn't needed */
|
||||
#define DEBOUNCING_DELAY 5
|
||||
|
||||
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
|
||||
#define LOCKING_SUPPORT_ENABLE
|
||||
/* Locking resynchronize hack */
|
||||
#define LOCKING_RESYNC_ENABLE
|
||||
|
||||
/* key combination for command */
|
||||
#define IS_COMMAND() ( \
|
||||
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
|
||||
)
|
||||
|
||||
/* ws2812 RGB LED */
|
||||
#define RGB_DI_PIN D1
|
||||
#define RGBLIGHT_TIMER
|
||||
#define RGBLED_NUM 28 // Number of LEDs
|
||||
#define RGBLIGHT_HUE_STEP 10
|
||||
#define RGBLIGHT_SAT_STEP 17
|
||||
#define RGBLIGHT_VAL_STEP 17
|
||||
|
||||
/*
|
||||
* Feature disable options
|
||||
* These options are also useful to firmware size reduction.
|
||||
*/
|
||||
|
||||
#define TAPPING_TERM 200
|
||||
|
||||
/* disable debug print */
|
||||
// #define NO_DEBUG
|
||||
|
||||
/* disable print */
|
||||
// #define NO_PRINT
|
||||
|
||||
/* disable action features */
|
||||
//#define NO_ACTION_LAYER
|
||||
//#define NO_ACTION_TAPPING
|
||||
//#define NO_ACTION_ONESHOT
|
||||
//#define NO_ACTION_MACRO
|
||||
//#define NO_ACTION_FUNCTION
|
||||
|
||||
#endif
|
@ -0,0 +1,144 @@
|
||||
#include "preonic.h"
|
||||
#include "action_layer.h"
|
||||
#include "eeconfig.h"
|
||||
#ifdef AUDIO_ENABLE
|
||||
#include "audio.h"
|
||||
#endif
|
||||
|
||||
// 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 _FN 1
|
||||
#define _ULCK 2
|
||||
|
||||
// Fillers to make layering more clear
|
||||
#define _______ KC_TRNS
|
||||
#define XXXXXXX KC_NO
|
||||
#define HYP_TIC ALL_T(KC_GRV)
|
||||
#define EQ_LOCK TD(TD_EQ_LOCK)
|
||||
#define MIN_ULK TD(TD_MIN_ULOCK)
|
||||
|
||||
//Tap Dance Declarations
|
||||
enum {
|
||||
TD_EQ_LOCK = 0,
|
||||
TD_MIN_ULOCK
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
/* Qwerty
|
||||
* ,-----------------------------------------------------------------------------------.
|
||||
* | = | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | Tab | Q | W | E | R | T | Y | U | I | O | P | \ |
|
||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* | Ctrl | A | S | D | F | G | H | J | K | L | ; | " |
|
||||
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
* | Shift| Z | X | C | V | B | N | M | , | . | / |Shift |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | FN | ` | Alt | LGUI | Back | ESC |ENTER | SPCE | RGUI | [ | ] | FN |
|
||||
* `-----------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_QWERTY] = {
|
||||
{EQ_LOCK, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, MIN_ULK },
|
||||
{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_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT },
|
||||
{KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC },
|
||||
{MO(_FN), HYP_TIC, KC_LALT, KC_LGUI, KC_BSPC, KC_ESC, KC_ENT, KC_SPC, KC_RGUI, KC_LBRC, KC_RBRC, MO(_FN) }
|
||||
},
|
||||
|
||||
/* Fn
|
||||
* ,-----------------------------------------------------------------------------------.
|
||||
* | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | |
|
||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* | | F11 | F12 | F13 | F14 | F15 | F16 | F17 | F18 | F19 | F20 | |
|
||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* | | VOL- | VOL+ | MUTE |BLtogg| | LEFT | DOWN | UP | RGHT | | |
|
||||
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
* | | BL- | BL+ |Aud on|AudOff|AGnorm|AGswap| | | | | |
|
||||
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
* | |Voice-|Voice+|Mus on|MusOff| | |PLY/PS| | PREV | NEXT | |
|
||||
* `-----------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_FN] = {
|
||||
{_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______ },
|
||||
{_______, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, _______ },
|
||||
{_______, KC_VOLD, KC_VOLU, KC_MUTE, BL_TOGG, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______ },
|
||||
{_______, BL_DEC, BL_INC, AU_ON, AU_OFF, AG_NORM, AG_SWAP, _______, _______, _______, _______, _______ },
|
||||
{_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, _______, _______, KC_MPLY, _______, KC_MPRV, KC_MNXT, _______ }
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
float tone_startup[][2] = {
|
||||
{NOTE_B5, 20},
|
||||
{NOTE_B6, 8},
|
||||
{NOTE_DS6, 20},
|
||||
{NOTE_B6, 8}
|
||||
};
|
||||
|
||||
float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
|
||||
float music_scale[][2] = SONG(MUSIC_SCALE_SOUND);
|
||||
|
||||
void persistant_default_layer_set(uint16_t default_layer) {
|
||||
eeconfig_update_default_layer(default_layer);
|
||||
default_layer_set(default_layer);
|
||||
}
|
||||
|
||||
/*bool process_record_user(uint16_t keycode, keyrecord_t *record) {*/
|
||||
/*return true;*/
|
||||
/*[>switch (keycode) {<]*/
|
||||
/*[>case QWERTY:<]*/
|
||||
/*[>return true;<]*/
|
||||
/*[>}<]*/
|
||||
/*};*/
|
||||
|
||||
void matrix_init_user(void) {
|
||||
startup_user();
|
||||
}
|
||||
|
||||
void startup_user()
|
||||
{
|
||||
_delay_ms(20); // gets rid of tick
|
||||
PLAY_NOTE_ARRAY(tone_startup, false, 0);
|
||||
}
|
||||
|
||||
void shutdown_user()
|
||||
{
|
||||
PLAY_NOTE_ARRAY(tone_goodbye, false, 0);
|
||||
_delay_ms(150);
|
||||
stop_all_notes();
|
||||
}
|
||||
|
||||
void music_on_user(void)
|
||||
{
|
||||
music_scale_user();
|
||||
}
|
||||
|
||||
void music_scale_user(void)
|
||||
{
|
||||
PLAY_NOTE_ARRAY(music_scale, false, 0);
|
||||
}
|
||||
|
||||
|
||||
const qk_tap_dance_action_t tap_dance_actions[] = {
|
||||
//Tap once for equal, twice for hyper + X (alfred lock)
|
||||
[TD_EQ_LOCK] = ACTION_TAP_DANCE_DOUBLE(KC_EQL, HYPR(KC_X)),
|
||||
//Tap once for minus, twice for time.heals.nothing
|
||||
[TD_MIN_ULOCK] = ACTION_TAP_DANCE_DOUBLE(KC_MINS, M(_ULCK))
|
||||
};
|
||||
|
||||
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
||||
{
|
||||
switch(id) {
|
||||
case _ULCK:
|
||||
if (record->event.pressed) {
|
||||
/* time.heals.nothing */
|
||||
return MACRO( I(220), T(T), T(I), T(M), T(E), T(DOT), T(H), T(E), T(A), T(L), T(S), T(DOT), T(N), T(O), T(T), T(H), T(I), T(N), T(G), END);
|
||||
}
|
||||
break;
|
||||
}
|
||||
return MACRO_NONE;
|
||||
};
|
@ -0,0 +1 @@
|
||||
# The default Preonic layout - largely based on the Planck's
|
@ -0,0 +1,20 @@
|
||||
|
||||
# Build Options
|
||||
# comment out to disable the options.
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= no # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= yes # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
RGBLIGHT_ENABLE ?= no # Enable keyboard underlight functionality (+4870)
|
||||
BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality (+1150)
|
||||
MIDI_ENABLE ?= no # MIDI controls
|
||||
AUDIO_ENABLE ?= no
|
||||
UNICODE_ENABLE ?= no # Unicode
|
||||
BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../../Makefile
|
||||
endif
|
@ -0,0 +1,12 @@
|
||||
# denolfe's Layout
|
||||
Customized Satan keymap
|
||||
|
||||
![Layout](keyboard-layout.png "Practical Keymap")
|
||||
|
||||
## Programming Instructions:
|
||||
`cd` into keymap directory, `make dfu`
|
||||
|
||||
## Features
|
||||
- Movement keys with <kbd>CapsLock</kbd> + <kbd>h</kbd>, <kbd>j</kbd>, <kbd>k</kbd>, <kbd>l</kbd>
|
||||
- Media Keys
|
||||
- Backlight control
|
Binary file not shown.
After Width: | Height: | Size: 31 KiB |
@ -0,0 +1,171 @@
|
||||
#include "satan.h"
|
||||
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
#include "rgblight.h"
|
||||
#endif
|
||||
|
||||
// Used for SHIFT_ESC
|
||||
#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT))
|
||||
|
||||
// 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 _BL 0
|
||||
#define _FL 1
|
||||
#define _SL 2
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/* Keymap _BL: (Base Layer) Default Layer
|
||||
* ,-----------------------------------------------------------.
|
||||
* |Esc~| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp |
|
||||
* |-----------------------------------------------------------|
|
||||
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ |
|
||||
* |-----------------------------------------------------------|
|
||||
* |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return |
|
||||
* |-----------------------------------------------------------|
|
||||
* |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift |
|
||||
* |-----------------------------------------------------------|
|
||||
* |Ctrl|Gui |Alt | Space |Alt |Gui |FN |Ctrl |
|
||||
* `-----------------------------------------------------------'
|
||||
*/
|
||||
[_BL] = KEYMAP(
|
||||
F(0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \
|
||||
MO(_FL), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \
|
||||
KC_LCTL, KC_LGUI,KC_LALT, KC_SPC, KC_RALT, MO(_FL), KC_RGUI, KC_RCTL),
|
||||
|
||||
/* Keymap _FL: Function Layer
|
||||
* ,-----------------------------------------------------------.
|
||||
* | | | | | | | | | | | | | | RESET|
|
||||
* |-----------------------------------------------------------|
|
||||
* | | | | | | | | | | | |BL-|BL+|BL |
|
||||
* |-----------------------------------------------------------|
|
||||
* | | | | | | | | | | | | |
|
||||
* |-----------------------------------------------------------|
|
||||
* | | F1|F2 | F3|F4 | F5| F6| F7| F8| | | |
|
||||
* |-----------------------------------------------------------|
|
||||
* | | | | | | | | |
|
||||
* `-----------------------------------------------------------'
|
||||
*/
|
||||
[_FL] = KEYMAP(
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
KC_GRV, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, \
|
||||
KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, BL_DEC, BL_INC, BL_TOGG, \
|
||||
KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
|
||||
KC_TRNS, F(1), F(2), F(3), F(4), F(5), F(6), F(7), F(8), KC_TRNS, KC_TRNS, KC_TRNS, \
|
||||
KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
|
||||
#else
|
||||
KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, \
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGDN, KC_PGUP, KC_TRNS, KC_END, KC_MPRV, KC_MNXT, KC_MPLY, \
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_TRNS, KC_TRNS, KC_TRNS, \
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, BL_DEC, BL_TOGG, BL_INC, KC_HOME, LCTL(KC_LEFT), LCTL(KC_END), LCTL(KC_RIGHT), KC_TRNS, RESET, \
|
||||
KC_TRNS, KC_TRNS, F(9), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
|
||||
#endif
|
||||
|
||||
[_SL] = KEYMAP(
|
||||
KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, \
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGDN, KC_PGUP, KC_TRNS, LSFT(KC_END), KC_MPRV, KC_MNXT, KC_MPLY, \
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, LSFT(KC_LEFT), LSFT(KC_DOWN), LSFT(KC_UP), LSFT(KC_RIGHT), KC_TRNS, KC_TRNS, KC_TRNS, \
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, BL_DEC, BL_TOGG, BL_INC, LSFT(KC_HOME), LCTL(LSFT(KC_LEFT)), LCTL(LSFT(KC_END)), LCTL(LSFT(KC_RIGHT)), KC_TRNS, RESET, \
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
|
||||
};
|
||||
|
||||
enum function_id {
|
||||
SHIFT_ESC,
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
RGBLED_TOGGLE,
|
||||
RGBLED_STEP_MODE,
|
||||
RGBLED_INCREASE_HUE,
|
||||
RGBLED_DECREASE_HUE,
|
||||
RGBLED_INCREASE_SAT,
|
||||
RGBLED_DECREASE_SAT,
|
||||
RGBLED_INCREASE_VAL,
|
||||
RGBLED_DECREASE_VAL
|
||||
#endif
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM fn_actions[] = {
|
||||
[0] = ACTION_FUNCTION(SHIFT_ESC),
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
[1] = ACTION_FUNCTION(RGBLED_TOGGLE),
|
||||
[2] = ACTION_FUNCTION(RGBLED_STEP_MODE),
|
||||
[3] = ACTION_FUNCTION(RGBLED_INCREASE_HUE),
|
||||
[4] = ACTION_FUNCTION(RGBLED_DECREASE_HUE),
|
||||
[5] = ACTION_FUNCTION(RGBLED_INCREASE_SAT),
|
||||
[6] = ACTION_FUNCTION(RGBLED_DECREASE_SAT),
|
||||
[7] = ACTION_FUNCTION(RGBLED_INCREASE_VAL),
|
||||
[8] = ACTION_FUNCTION(RGBLED_DECREASE_VAL),
|
||||
#endif
|
||||
[9] = ACTION_LAYER_MODS(2, MOD_LSFT)
|
||||
};
|
||||
|
||||
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
|
||||
static uint8_t shift_esc_shift_mask;
|
||||
switch (id) {
|
||||
case SHIFT_ESC:
|
||||
shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK;
|
||||
if (record->event.pressed) {
|
||||
if (shift_esc_shift_mask) {
|
||||
add_key(KC_GRV);
|
||||
send_keyboard_report();
|
||||
} else {
|
||||
add_key(KC_ESC);
|
||||
send_keyboard_report();
|
||||
}
|
||||
} else {
|
||||
if (shift_esc_shift_mask) {
|
||||
del_key(KC_GRV);
|
||||
send_keyboard_report();
|
||||
} else {
|
||||
del_key(KC_ESC);
|
||||
send_keyboard_report();
|
||||
}
|
||||
}
|
||||
break;
|
||||
//led operations
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
case RGBLED_TOGGLE:
|
||||
if (record->event.pressed) {
|
||||
rgblight_toggle();
|
||||
}
|
||||
break;
|
||||
case RGBLED_INCREASE_HUE:
|
||||
if (record->event.pressed) {
|
||||
rgblight_increase_hue();
|
||||
}
|
||||
break;
|
||||
case RGBLED_DECREASE_HUE:
|
||||
if (record->event.pressed) {
|
||||
rgblight_decrease_hue();
|
||||
}
|
||||
break;
|
||||
case RGBLED_INCREASE_SAT:
|
||||
if (record->event.pressed) {
|
||||
rgblight_increase_sat();
|
||||
}
|
||||
break;
|
||||
case RGBLED_DECREASE_SAT:
|
||||
if (record->event.pressed) {
|
||||
rgblight_decrease_sat();
|
||||
}
|
||||
break;
|
||||
case RGBLED_INCREASE_VAL:
|
||||
if (record->event.pressed) {
|
||||
rgblight_increase_val();
|
||||
}
|
||||
break;
|
||||
case RGBLED_DECREASE_VAL:
|
||||
if (record->event.pressed) {
|
||||
rgblight_decrease_val();
|
||||
}
|
||||
break;
|
||||
case RGBLED_STEP_MODE:
|
||||
if (record->event.pressed) {
|
||||
rgblight_step();
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue