Compare commits
95 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
94f8b758b3 | ||
|
f0db2c0512 | ||
|
8ea690a1b3 | ||
|
b07b4bb97b | ||
|
5b897ce223 | ||
|
da33dfec55 | ||
|
a4316ba486 | ||
|
da83f04a30 | ||
|
9987f9dcff | ||
|
ad73553aa9 | ||
|
00d8f0c082 | ||
|
a729d852fe | ||
|
da7aece043 | ||
|
ed56a6859f | ||
|
ba2ad57ca8 | ||
|
677b89768b | ||
|
7960302242 | ||
|
de315c54eb | ||
|
a6fe0320f5 | ||
|
78ab926cc8 | ||
|
b28982e329 | ||
|
0965e5203e | ||
|
8e1c3f410d | ||
|
2aedbf872b | ||
|
afd7bf5f09 | ||
|
402235eeb4 | ||
|
b2d033ffe8 | ||
|
ae91af95e2 | ||
|
4b0c6dc50d | ||
|
9a23fad36b | ||
|
718fddf44c | ||
|
d2ff66a985 | ||
|
7260fc3eef | ||
|
437c86c9c1 | ||
|
d54360b1d8 | ||
|
fe4549839e | ||
|
1d930ebe45 | ||
|
fcb60b1601 | ||
|
3aa7fbcd79 | ||
|
82f434a4d4 | ||
|
d8fd33dd5e | ||
|
bd484f18bd | ||
|
9f6362e4df | ||
|
57c93c13cc | ||
|
e719f5b0b5 | ||
|
9da308a0cd | ||
|
47cd5b5622 | ||
|
0e39f1faf4 | ||
|
dd8cedc361 | ||
|
51a2ce6145 | ||
|
11d27cec1e | ||
|
7a445d9167 | ||
|
ff32643641 | ||
|
dbd4ce19e9 | ||
|
9ff064ae50 | ||
|
c3c07eff51 | ||
|
69c4cfb238 | ||
|
36709d6a30 | ||
|
1ab9e5d1c9 | ||
|
f4b3b576a0 | ||
|
dc1d24a4fe | ||
|
0be483c762 | ||
|
cb719757c2 | ||
|
d172d6bec6 | ||
|
90b07a5be4 | ||
|
af21fa63e5 | ||
|
dde035b963 | ||
|
e7b3991b97 | ||
|
1ce3971c90 | ||
|
48e79cbe29 | ||
|
68dafc8382 | ||
|
e0d9cc945f | ||
|
7aa839915e | ||
|
78dc7bacfa | ||
|
fa6bcfd10c | ||
|
1254e76e29 | ||
|
166706a32c | ||
|
948d6efcfb | ||
|
fe60cbd928 | ||
|
f94963e6b7 | ||
|
4b74c9056b | ||
|
e74a95bf26 | ||
|
bae1144a9f | ||
|
eb5748e8bf | ||
|
bdc0880ca5 | ||
|
fc70c9ac9e | ||
|
937b86d030 | ||
|
cc9b0eb109 | ||
|
046595f521 | ||
|
8341068299 | ||
|
a553dcba5a | ||
|
5cab5e4a4e | ||
|
a6845036e2 | ||
|
4a9e16b394 | ||
|
84a8aabe5b |
6
.gitignore
vendored
6
.gitignore
vendored
@@ -44,4 +44,8 @@ util/Win_Check_Output.txt
|
||||
*.gif
|
||||
|
||||
# Do not ignore MiniDox left/right hand eeprom files
|
||||
!keyboards/minidox/*.eep
|
||||
!keyboards/minidox/*.eep
|
||||
|
||||
# things travis sees
|
||||
secrets.tar
|
||||
id_rsa_*
|
||||
|
@@ -29,6 +29,7 @@ addons:
|
||||
- binutils-arm-none-eabi
|
||||
- libnewlib-arm-none-eabi
|
||||
- diffutils
|
||||
- dos2unix
|
||||
after_success:
|
||||
bash util/travis_compiled_push.sh
|
||||
notifications:
|
||||
|
14
Makefile
14
Makefile
@@ -314,11 +314,21 @@ define PARSE_SUBPROJECT
|
||||
ifneq ($$(CURRENT_SP),allsp)
|
||||
# get a list of all keymaps
|
||||
KEYMAPS := $$(notdir $$(patsubst %/.,%,$$(wildcard $(ROOT_DIR)/keyboards/$$(CURRENT_KB)/keymaps/*/.)))
|
||||
LAYOUTS :=
|
||||
$$(eval -include $(ROOT_DIR)/keyboards/$$(CURRENT_KB)/rules.mk)
|
||||
KEYBOARD_LAYOUTS := $$(LAYOUTS)
|
||||
ifneq ($$(CURRENT_SP),)
|
||||
# if the subproject is defined, then also look for keymaps inside the subproject folder
|
||||
SP_KEYMAPS := $$(notdir $$(patsubst %/.,%,$$(wildcard $(ROOT_DIR)/keyboards/$$(CURRENT_KB)/$$(CURRENT_SP)/keymaps/*/.)))
|
||||
KEYMAPS := $$(sort $$(KEYMAPS) $$(SP_KEYMAPS))
|
||||
# $$(eval -include $(ROOT_DIR)/keyboards/$$(CURRENT_KB)/$$(CURRENT_SP)/rules.mk)
|
||||
# KEYBOARD_LAYOUTS := $$(sort $$(KEYBOARD_LAYOUTS) $$(LAYOUTS))
|
||||
endif
|
||||
|
||||
LAYOUT_KEYMAPS :=
|
||||
$$(foreach LAYOUT,$$(KEYBOARD_LAYOUTS),$$(eval LAYOUT_KEYMAPS += $$(notdir $$(patsubst %/.,%,$$(wildcard $(ROOT_DIR)/layouts/*/$$(LAYOUT)/*/.)))))
|
||||
|
||||
KEYMAPS := $$(sort $$(KEYMAPS) $$(LAYOUT_KEYMAPS))
|
||||
# if the rule after removing the start of it is empty (we haven't specified a kemap or target)
|
||||
# compile all the keymaps
|
||||
ifeq ($$(RULE),)
|
||||
@@ -541,6 +551,10 @@ test: test-all
|
||||
.PHONY: test-clean
|
||||
test-clean: test-all-clean
|
||||
|
||||
git-submodule:
|
||||
git submodule sync --recursive
|
||||
git submodule update --init --recursive
|
||||
|
||||
ifdef SKIP_VERSION
|
||||
SKIP_GIT := yes
|
||||
endif
|
||||
|
@@ -39,6 +39,7 @@ ifneq ("$(wildcard $(KEYBOARD_C))","")
|
||||
else
|
||||
$(error "$(KEYBOARD_C)" does not exist)
|
||||
endif
|
||||
OPT_DEFS += -DKEYBOARD_$(KEYBOARD)
|
||||
|
||||
ifneq ($(SUBPROJECT),)
|
||||
SUBPROJECT_PATH := keyboards/$(KEYBOARD)/$(SUBPROJECT)
|
||||
@@ -97,11 +98,13 @@ else ifneq ("$(wildcard $(MAIN_KEYMAP_C))","")
|
||||
-include $(MAIN_KEYMAP_PATH)/Makefile
|
||||
KEYMAP_C := $(MAIN_KEYMAP_C)
|
||||
KEYMAP_PATH := $(MAIN_KEYMAP_PATH)
|
||||
else ifneq ($(LAYOUTS),)
|
||||
include build_layout.mk
|
||||
else
|
||||
$(error "$(MAIN_KEYMAP_C)/keymap.c" does not exist)
|
||||
$(error Could not find keymap)
|
||||
# this state should never be reached
|
||||
endif
|
||||
|
||||
|
||||
# Object files directory
|
||||
# To put object files in current directory, use a dot (.), do NOT make
|
||||
# this an empty or blank macro!
|
||||
@@ -157,7 +160,10 @@ endif
|
||||
|
||||
OUTPUTS := $(KEYMAP_OUTPUT) $(KEYBOARD_OUTPUT)
|
||||
$(KEYMAP_OUTPUT)_SRC := $(SRC)
|
||||
$(KEYMAP_OUTPUT)_DEFS := $(OPT_DEFS) $(GFXDEFS) -DQMK_KEYBOARD=\"$(KEYBOARD)\" -DQMK_KEYMAP=\"$(KEYMAP)\"
|
||||
$(KEYMAP_OUTPUT)_DEFS := $(OPT_DEFS) $(GFXDEFS) \
|
||||
-DQMK_KEYBOARD=\"$(KEYBOARD)\" -DQMK_KEYBOARD_H=\"$(KEYBOARD).h\" -DQMK_KEYBOARD_CONFIG_H=\"$(KEYBOARD_PATH)/config.h\" \
|
||||
-DQMK_KEYMAP=\"$(KEYMAP)\" -DQMK_KEYMAP_H=\"$(KEYMAP).h\" -DQMK_KEYMAP_CONFIG_H=\"$(KEYMAP_PATH)/config.h\" \
|
||||
-DQMK_SUBPROJECT=\"$(SUBPROJECT)\" -DQMK_SUBPROJECT_H=\"$(SUBPROJECT).h\" -DQMK_SUBPROJECT_CONFIG_H=\"$(SUBPROJECT_PATH)/config.h\"
|
||||
$(KEYMAP_OUTPUT)_INC := $(VPATH) $(EXTRAINCDIRS)
|
||||
$(KEYMAP_OUTPUT)_CONFIG := $(CONFIG_H)
|
||||
$(KEYBOARD_OUTPUT)_SRC := $(CHIBISRC) $(GFXSRC)
|
||||
|
18
build_layout.mk
Normal file
18
build_layout.mk
Normal file
@@ -0,0 +1,18 @@
|
||||
LAYOUTS_PATH := layouts
|
||||
LAYOUTS_REPOS := $(patsubst %/,%,$(sort $(dir $(wildcard $(LAYOUTS_PATH)/*/))))
|
||||
|
||||
define SEARCH_LAYOUTS_REPO
|
||||
LAYOUT_KEYMAP_PATH := $$(LAYOUTS_REPO)/$$(LAYOUT)/$$(KEYMAP)
|
||||
LAYOUT_KEYMAP_C := $$(LAYOUT_KEYMAP_PATH)/keymap.c
|
||||
ifneq ("$$(wildcard $$(LAYOUT_KEYMAP_C))","")
|
||||
-include $$(LAYOUT_KEYMAP_PATH)/rules.mk
|
||||
KEYMAP_C := $$(LAYOUT_KEYMAP_C)
|
||||
KEYMAP_PATH := $$(LAYOUT_KEYMAP_PATH)
|
||||
endif
|
||||
endef
|
||||
|
||||
define SEARCH_LAYOUTS
|
||||
$$(foreach LAYOUTS_REPO,$$(LAYOUTS_REPOS),$$(eval $$(call SEARCH_LAYOUTS_REPO)))
|
||||
endef
|
||||
|
||||
$(foreach LAYOUT,$(LAYOUTS),$(eval $(call SEARCH_LAYOUTS)))
|
@@ -12,6 +12,7 @@
|
||||
* [Keymap](faq_keymap.md)
|
||||
|
||||
* [Features](features.md)
|
||||
* [Layouts](feature_layouts.md)
|
||||
* [Common Shortcuts](feature_common_shortcuts.md)
|
||||
* [Backlight](feature_backlight.md)
|
||||
* [Bootmagic](feature_bootmagic.md)
|
||||
|
77
docs/feature_layouts.md
Normal file
77
docs/feature_layouts.md
Normal file
@@ -0,0 +1,77 @@
|
||||
# Layouts: Using a keymap with multiple keyboards
|
||||
|
||||
The `layouts/` folder contains different physical key layouts that can apply to different keyboards.
|
||||
|
||||
```
|
||||
layouts/
|
||||
+ default/
|
||||
| + 60_ansi/
|
||||
| | + readme.md
|
||||
| | + layout.json
|
||||
| | + a_good_keymap/
|
||||
| | | + keymap.c
|
||||
| | | + readme.md
|
||||
| | | + config.h
|
||||
| | | + rules.mk
|
||||
| | + <keymap folder>/
|
||||
| | + ...
|
||||
| + <layout folder>/
|
||||
+ community/
|
||||
| + <layout folder>/
|
||||
| + ...
|
||||
```
|
||||
|
||||
The `layouts/default/` and `layouts/community/` are two examples of layout "repositories" - currently `default` will contain all of the information concerning the layout, and one default keymap named `default_<layout>`, for users to use as a reference. `community` contains all of the community keymaps, with the eventual goal of being split-off into a separate repo for users to clone into `layouts/`. QMK searches through all folders in `layouts/`, so it's possible to have multiple reposistories here.
|
||||
|
||||
Each layout folder is named (`[a-z0-9_]`) after the physical aspects of the layout, in the most generic way possible, and contains a `readme.md` with the layout to be defined by the keyboard:
|
||||
|
||||
```md
|
||||
# 60_ansi
|
||||
|
||||
LAYOUT_60_ansi
|
||||
```
|
||||
|
||||
New names should try to stick to the standards set by existing layouts, and can be discussed in the PR/Issue.
|
||||
|
||||
## Supporting a layout
|
||||
|
||||
For a keyboard to support a layout, the variable (`[a-z0-9_]`) must be defined in it's `<keyboard>.h`, and match the number of arguments/keys (and preferrably the physical layout):
|
||||
|
||||
#define LAYOUT_60_ansi KEYMAP_ANSI
|
||||
|
||||
The folder name must be added to the keyboard's `rules.mk`:
|
||||
|
||||
LAYOUTS = 60_ansi
|
||||
|
||||
`LAYOUTS` can be appended in the subproject's `rules.mk`:
|
||||
|
||||
LAYOUTS += 60_iso
|
||||
|
||||
but the `LAYOUT_<layout>` variable must be defined in `<subproject>.h` as well.
|
||||
|
||||
## Tips for making layouts keyboard-agnostic
|
||||
|
||||
Instead of using `#include "planck.h"`, you can use this line to include whatever `<keyboard>.h` (`<subproject>.h` should not be included here) file that is being compiled:
|
||||
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
In your config.h, you can also use this variable to include the keyboard's `config.h`:
|
||||
|
||||
#include QMK_KEYBOARD_CONFIG_H
|
||||
|
||||
If you want to keep some keyboard-specific code, you can use these variables to escape it with an `#ifdef` statement:
|
||||
|
||||
* `KEYBOARD_<keyboard>`
|
||||
* `SUBPROJECT_<subproject>`
|
||||
|
||||
For example:
|
||||
|
||||
```c
|
||||
#ifdef KEYBOARD_planck
|
||||
#ifdef SUBPROJECT_rev4
|
||||
planck_rev4_function();
|
||||
#endif
|
||||
#endif
|
||||
```
|
||||
|
||||
Note that the names are lowercase and match the folder/file names for the keyboard/subproject exactly.
|
@@ -7,6 +7,6 @@
|
||||
{
|
||||
"from": "make_instructions.html",
|
||||
"to": "getting_started_make_guide.html"
|
||||
},
|
||||
}
|
||||
]
|
||||
}
|
@@ -30,7 +30,7 @@ GeminiPR encodes 42 keys into a 6-byte packet. While TX Bolt contains everything
|
||||
|
||||
## Configuring QMK for Steno
|
||||
|
||||
Firstly, enable steno in your keymap's Makefile. You should also diable mousekeys to prevent conflicts.
|
||||
Firstly, enable steno in your keymap's Makefile. You may also need disable mousekeys, extra keys, or another USB endpoint to prevent conflicts. The builtin USB stack for some processors only supports a certain number of USB endpoints and the virtual serial port needed for steno fills 3 of them.
|
||||
|
||||
```Makefile
|
||||
STENO_ENABLE = yes
|
||||
|
@@ -24,6 +24,7 @@ sort of like macro. Unfortunately, each OS has different ideas on how Unicode is
|
||||
This is the current list of Unicode input method in QMK:
|
||||
|
||||
* UC_OSX: MacOS Unicode Hex Input support. Works only up to 0xFFFF. Disabled by default. To enable: go to System Preferences -> Keyboard -> Input Sources, and enable Unicode Hex.
|
||||
* UC_OSX_RALT: Same as UC_OSX, but sends the Rigt Alt key for unicode input
|
||||
* UC_LNX: Unicode input method under Linux. Works up to 0xFFFFF. Should work almost anywhere on ibus enabled distros. Without ibus, this works under GTK apps, but rarely anywhere else.
|
||||
* UC_WIN: (not recommended) Windows built-in Unicode input. To enable: create registry key under `HKEY_CURRENT_USER\Control Panel\Input Method\EnableHexNumpad` of type `REG_SZ` called `EnableHexNumpad`, set its value to 1, and reboot. This method is not recommended because of reliability and compatibility issue, use WinCompose method below instead.
|
||||
* UC_WINC: Windows Unicode input using WinCompose. Requires [WinCompose](https://github.com/samhocevar/wincompose). Works reliably under many (all?) variations of Windows.
|
||||
|
5
keyboards/9key/9key.c
Normal file
5
keyboards/9key/9key.c
Normal file
@@ -0,0 +1,5 @@
|
||||
#include "9key.h"
|
||||
|
||||
void matrix_init_kb(void) {
|
||||
matrix_init_user();
|
||||
}
|
17
keyboards/9key/9key.h
Normal file
17
keyboards/9key/9key.h
Normal file
@@ -0,0 +1,17 @@
|
||||
#ifndef NINEKEY_H
|
||||
#define NINEKEY_H
|
||||
|
||||
#include "quantum.h"
|
||||
|
||||
#define KEYMAP( \
|
||||
k00, k01, k02, \
|
||||
k10, k11, k12, \
|
||||
k20, k21, k22 \
|
||||
) \
|
||||
{ \
|
||||
{ k00, k01, k02 }, \
|
||||
{ k10, k11, k12 }, \
|
||||
{ k20, k21, k22 } \
|
||||
}
|
||||
|
||||
#endif
|
@@ -1,5 +1,3 @@
|
||||
SUBPROJECT_DEFAULT = ez
|
||||
|
||||
ifndef MAKEFILE_INCLUDED
|
||||
include ../../Makefile
|
||||
endif
|
52
keyboards/9key/config.h
Normal file
52
keyboards/9key/config.h
Normal file
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
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 0x0007
|
||||
#define DEVICE_VER 0x0001
|
||||
#define MANUFACTURER Bishop Keyboards
|
||||
#define PRODUCT 9Key
|
||||
#define DESCRIPTION Bishop Keyboards 9Key // Charleston, SC Meetup Handout
|
||||
|
||||
/* key matrix size */
|
||||
#define MATRIX_ROWS 3
|
||||
#define MATRIX_COLS 3
|
||||
|
||||
/* 9Key PCB default pin-out */
|
||||
#define MATRIX_ROW_PINS { D1, D0, D4 }
|
||||
#define MATRIX_COL_PINS { F4, F5, F6 }
|
||||
#define UNUSED_PINS
|
||||
|
||||
/* ws2812 RGB LED */
|
||||
#define RGB_DI_PIN F7
|
||||
#define RGBLIGHT_TIMER
|
||||
#define RGBLED_NUM 1 // Number of LEDs
|
||||
#define ws2812_PORTREG PORTD
|
||||
#define ws2812_DDRREG DDRD
|
||||
|
||||
/* COL2ROW or ROW2COL */
|
||||
#define DIODE_DIRECTION COL2ROW
|
||||
|
||||
#define TAPPING_TERM 200
|
||||
|
||||
#endif
|
65
keyboards/9key/keymaps/default/keymap.c
Normal file
65
keyboards/9key/keymaps/default/keymap.c
Normal file
@@ -0,0 +1,65 @@
|
||||
#include "9key.h"
|
||||
|
||||
// Tap Dance Declarations
|
||||
enum {
|
||||
ENT_5 = 0,
|
||||
ZERO_7
|
||||
};
|
||||
|
||||
// Macro Declarations
|
||||
enum {
|
||||
DBL_0 = 0
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
/* LAYER 0
|
||||
* ,-----------------------.
|
||||
* | 1 | 2 | 3 |
|
||||
* |-------+-------+-------|
|
||||
* | 4 | 5/ENT | 6 | Dbl Tap 5 for Enter
|
||||
* |-------+-------+-------|
|
||||
* | 7/0 | 8 | 9/FN | 7/0 = Dbl Tap 7 for 0 - 9/FN = Hold 9 for FN
|
||||
* `-----------------------'
|
||||
*/
|
||||
[0] = KEYMAP( \
|
||||
KC_1, KC_2, KC_3, \
|
||||
KC_4, TD(ENT_5), KC_6, \
|
||||
TD(ZERO_7), KC_8, LT(1, KC_9) \
|
||||
),
|
||||
|
||||
/* LAYER 1
|
||||
* ,-----------------------.
|
||||
* | ESC | + | - |
|
||||
* |-------+-------+-------|
|
||||
* | BSPC | * | / |
|
||||
* |-------+-------+-------|
|
||||
* | 00 | . | |
|
||||
* `-----------------------'
|
||||
*/
|
||||
[1] = KEYMAP( \
|
||||
KC_ESC, KC_PLUS, KC_MINS, \
|
||||
KC_BSPC, KC_ASTR, KC_SLSH, \
|
||||
M(DBL_0), KC_DOT, KC_TRNS \
|
||||
)
|
||||
|
||||
};
|
||||
|
||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
||||
[ENT_5] = ACTION_TAP_DANCE_DOUBLE(KC_5, KC_ENT),
|
||||
[ZERO_7] = ACTION_TAP_DANCE_DOUBLE(KC_7, KC_0)
|
||||
};
|
||||
|
||||
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
|
||||
if (record->event.pressed) {
|
||||
switch(id) {
|
||||
case DBL_0:
|
||||
SEND_STRING("00");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return MACRO_NONE;
|
||||
};
|
||||
|
||||
void matrix_init_user(void) {
|
||||
}
|
17
keyboards/9key/readme.md
Normal file
17
keyboards/9key/readme.md
Normal file
@@ -0,0 +1,17 @@
|
||||
9key
|
||||
===
|
||||
|
||||

|
||||

|
||||
|
||||
A compact minipad (3x3) keyboard made and sold by Bishop Keyboards.
|
||||
|
||||
Keyboard Maintainer: QMK Community
|
||||
Hardware Supported: 9key PCB, Pro Micro ATmega32U4
|
||||
Hardware Availability: [BishopKeyboards.com](http://bishopkeyboards.com/)
|
||||
|
||||
Make example for this keyboard (after setting up your build environment):
|
||||
|
||||
make 9key-default
|
||||
|
||||
See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information.
|
69
keyboards/9key/rules.mk
Normal file
69
keyboards/9key/rules.mk
Normal file
@@ -0,0 +1,69 @@
|
||||
# MCU name
|
||||
#MCU = at90usb1287
|
||||
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
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
|
||||
# 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 = no # Commands for debug and configuration
|
||||
NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
|
||||
MIDI_ENABLE = no # MIDI controls
|
||||
AUDIO_ENABLE = no # Audio output on port C6
|
||||
UNICODE_ENABLE = yes # Unicode
|
||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
|
||||
API_SYSEX_ENABLE = yes
|
||||
TAP_DANCE_ENABLE = yes
|
||||
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
@@ -20,12 +20,30 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#include "quantum.h"
|
||||
|
||||
/* Alps64 keymap definition macro */
|
||||
|
||||
#define KEYMAP( \
|
||||
K36, K37, K46, K47, K56, K57, K66, K67, K76, K77, K06, K07, K17, K26, K27, \
|
||||
K34, K35, K44, K45, K54, K55, K64, K65, K75, K05, K15, K16, K25, K24, \
|
||||
K32, K33, K43, K52, K53, K63, K73, K74, K03, K04, K13, K14, K23, \
|
||||
K31, K41, K42, K51, K61, K62, K71, K72, K01, K02, K11, K12, K21, K22, \
|
||||
K30, K40, K50, K60, K70, K00, K10, K20 \
|
||||
) { \
|
||||
{ K00, K01, K02, K03, K04, K05, K06, K07 }, \
|
||||
{ K10, K11, K12, K13, K14, K15, K16, K17 }, \
|
||||
{ K20, K21, K22, K23, K24, K25, K26, K27 }, \
|
||||
{ K30, K31, K32, K33, K34, K35, K36, K37 }, \
|
||||
{ K40, K41, K42, K43, K44, K45, K46, K47 }, \
|
||||
{ K50, K51, K52, K53, K54, K55, K56, K57 }, \
|
||||
{ K60, K61, K62, K63, K64, K65, K66, K67 }, \
|
||||
{ K70, K71, K72, K73, K74, K75, K76, K77 } \
|
||||
}
|
||||
|
||||
#define KC_KEYMAP( \
|
||||
K36, K37, K46, K47, K56, K57, K66, K67, K76, K77, K06, K07, K17, K26, K27, \
|
||||
K34, K35, K44, K45, K54, K55, K64, K65, K75, K05, K15, K16, K25, K24, \
|
||||
K32, K33, K43, K52, K53, K63, K73, K74, K03, K04, K13, K14, K23, \
|
||||
K31, K41, K42, K51, K61, K62, K71, K72, K01, K02, K11, K12, K21, K22, \
|
||||
K30, K40, K50, K60, K70, K00, K10, K20 \
|
||||
) { \
|
||||
{ KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07 }, \
|
||||
{ KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17 }, \
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/* 0: qwerty */
|
||||
KEYMAP( \
|
||||
KC_KEYMAP( \
|
||||
GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, NUHS, BSPC, \
|
||||
TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, \
|
||||
CAPS,A, S, D, F, G, H, J, K, L, SCLN,QUOT,ENT, \
|
||||
|
@@ -179,7 +179,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
case QWERTY:
|
||||
if (record->event.pressed) {
|
||||
#ifdef AUDIO_ENABLE
|
||||
PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
|
||||
PLAY_SONG(tone_qwerty);
|
||||
#endif
|
||||
persistent_default_layer_set(1UL<<_QWERTY);
|
||||
}
|
||||
@@ -188,7 +188,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
case COLEMAK:
|
||||
if (record->event.pressed) {
|
||||
#ifdef AUDIO_ENABLE
|
||||
PLAY_NOTE_ARRAY(tone_colemak, false, 0);
|
||||
PLAY_SONG(tone_colemak);
|
||||
#endif
|
||||
persistent_default_layer_set(1UL<<_COLEMAK);
|
||||
}
|
||||
@@ -197,7 +197,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
case DVORAK:
|
||||
if (record->event.pressed) {
|
||||
#ifdef AUDIO_ENABLE
|
||||
PLAY_NOTE_ARRAY(tone_dvorak, false, 0);
|
||||
PLAY_SONG(tone_dvorak);
|
||||
#endif
|
||||
persistent_default_layer_set(1UL<<_DVORAK);
|
||||
}
|
||||
|
@@ -63,6 +63,8 @@
|
||||
{k40, k41, k42, XXX, XXX, k45, XXX, XXX, XXX, XXX, k4a, k4b, k4c, k4d} \
|
||||
}
|
||||
|
||||
#define LAYOUT_60_ansi KEYMAP_ANSI
|
||||
|
||||
/* AMJ60 HHKB matrix layout
|
||||
* ,------------------------------------------------------------.
|
||||
* | 00 |01| 02| 03| 04| 05| 06| 07| 08| 09| 0a| 0b| 0c| 0d| 49 |
|
||||
@@ -119,6 +121,7 @@
|
||||
{k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, XXX}, \
|
||||
{k40, k41, k42, XXX, XXX, k45, XXX, XXX, XXX, XXX, k4a, k4b, k4c, k4d} \
|
||||
}
|
||||
|
||||
/* ISO w/ split right shift key matrix layout
|
||||
* ,-----------------------------------------------------------.
|
||||
* | 00 |01| 02| 03| 04| 05| 06| 07| 08| 09| 0a| 0b| 0c| 0d |
|
||||
|
@@ -64,3 +64,5 @@ MIDI_ENABLE = no # MIDI controls
|
||||
AUDIO_ENABLE = no
|
||||
UNICODE_ENABLE = no # Unicode
|
||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
|
||||
LAYOUTS = 60_ansi
|
@@ -24,4 +24,20 @@
|
||||
{ K40, K41, KC_NO, K43, KC_NO, KC_NO, K46, KC_NO, KC_NO, KC_NO, K4A, K4B, K4C, K4D, K4E } \
|
||||
}
|
||||
|
||||
#define KEYMAP_GRID( \
|
||||
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E,\
|
||||
K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E,\
|
||||
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E,\
|
||||
K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E,\
|
||||
K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, K4D, K4E \
|
||||
) { \
|
||||
{ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E }, \
|
||||
{ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E }, \
|
||||
{ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E }, \
|
||||
{ K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E }, \
|
||||
{ K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, K4D, K4E } \
|
||||
}
|
||||
|
||||
#define LAYOUT_ortho_5x15 KEYMAP_GRID
|
||||
|
||||
#endif
|
@@ -471,7 +471,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
||||
else
|
||||
{
|
||||
audio_on();
|
||||
PLAY_NOTE_ARRAY(tone_audio_on, false, STACCATO);
|
||||
PLAY_SONG(tone_audio_on);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -486,7 +486,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
||||
}
|
||||
else
|
||||
{
|
||||
PLAY_NOTE_ARRAY(tone_music_on, false, STACCATO);
|
||||
PLAY_SONG(tone_music_on);
|
||||
layer_on(LAYER_MUSIC);
|
||||
}
|
||||
}
|
||||
@@ -496,7 +496,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
||||
{
|
||||
#ifdef AUDIO_ENABLE
|
||||
voice_iterate();
|
||||
PLAY_NOTE_ARRAY(music_scale, false, STACCATO);
|
||||
PLAY_SONG(music_scale);
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
@@ -506,7 +506,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
||||
{
|
||||
#ifdef AUDIO_ENABLE
|
||||
voice_deiterate();
|
||||
PLAY_NOTE_ARRAY(music_scale, false, STACCATO);
|
||||
PLAY_SONG(music_scale);
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
@@ -550,32 +550,32 @@ void led_set_user(uint8_t usb_led)
|
||||
if ((usb_led & (1<<USB_LED_CAPS_LOCK)) && !(old_usb_led & (1<<USB_LED_CAPS_LOCK)))
|
||||
{
|
||||
// If CAPS LK LED is turning on...
|
||||
PLAY_NOTE_ARRAY(tone_caps_on, false, LEGATO);
|
||||
PLAY_SONG(tone_caps_on);
|
||||
}
|
||||
else if (!(usb_led & (1<<USB_LED_CAPS_LOCK)) && (old_usb_led & (1<<USB_LED_CAPS_LOCK)))
|
||||
{
|
||||
// If CAPS LK LED is turning off...
|
||||
PLAY_NOTE_ARRAY(tone_caps_off, false, LEGATO);
|
||||
PLAY_SONG(tone_caps_off);
|
||||
}
|
||||
else if ((usb_led & (1<<USB_LED_NUM_LOCK)) && !(old_usb_led & (1<<USB_LED_NUM_LOCK)))
|
||||
{
|
||||
// If NUM LK LED is turning on...
|
||||
PLAY_NOTE_ARRAY(tone_numlk_on, false, LEGATO);
|
||||
PLAY_SONG(tone_numlk_on);
|
||||
}
|
||||
else if (!(usb_led & (1<<USB_LED_NUM_LOCK)) && (old_usb_led & (1<<USB_LED_NUM_LOCK)))
|
||||
{
|
||||
// If NUM LED is turning off...
|
||||
PLAY_NOTE_ARRAY(tone_numlk_off, false, LEGATO);
|
||||
PLAY_SONG(tone_numlk_off);
|
||||
}
|
||||
else if ((usb_led & (1<<USB_LED_SCROLL_LOCK)) && !(old_usb_led & (1<<USB_LED_SCROLL_LOCK)))
|
||||
{
|
||||
// If SCROLL LK LED is turning on...
|
||||
PLAY_NOTE_ARRAY(tone_scroll_on, false, LEGATO);
|
||||
PLAY_SONG(tone_scroll_on);
|
||||
}
|
||||
else if (!(usb_led & (1<<USB_LED_SCROLL_LOCK)) && (old_usb_led & (1<<USB_LED_SCROLL_LOCK)))
|
||||
{
|
||||
// If SCROLL LED is turning off...
|
||||
PLAY_NOTE_ARRAY(tone_scroll_off, false, LEGATO);
|
||||
PLAY_SONG(tone_scroll_off);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -586,29 +586,29 @@ void led_set_user(uint8_t usb_led)
|
||||
void startup_user()
|
||||
{
|
||||
_delay_ms(10); // gets rid of tick
|
||||
PLAY_NOTE_ARRAY(tone_my_startup, false, STACCATO);
|
||||
PLAY_SONG(tone_my_startup);
|
||||
}
|
||||
|
||||
void shutdown_user()
|
||||
{
|
||||
PLAY_NOTE_ARRAY(tone_my_goodbye, false, STACCATO);
|
||||
PLAY_SONG(tone_my_goodbye);
|
||||
_delay_ms(2000);
|
||||
stop_all_notes();
|
||||
}
|
||||
|
||||
void audio_on_user(void)
|
||||
{
|
||||
PLAY_NOTE_ARRAY(tone_audio_on, false, STACCATO);
|
||||
PLAY_SONG(tone_audio_on);
|
||||
}
|
||||
|
||||
void music_on_user(void)
|
||||
{
|
||||
PLAY_NOTE_ARRAY(tone_music_on, false, STACCATO);
|
||||
PLAY_SONG(tone_music_on);
|
||||
}
|
||||
|
||||
void music_scale_user(void)
|
||||
{
|
||||
PLAY_NOTE_ARRAY(music_scale, false, STACCATO);
|
||||
PLAY_SONG(music_scale);
|
||||
}
|
||||
|
||||
#endif /* AUDIO_ENABLE */
|
@@ -66,4 +66,6 @@ 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
|
||||
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||
|
||||
LAYOUTS = ortho_5x15
|
@@ -78,5 +78,5 @@ UNICODE_ENABLE = YES # Unicode
|
||||
|
||||
USB = /dev/cu.usbmodem1411
|
||||
|
||||
upload: build
|
||||
$(ATREUS_UPLOAD_COMMAND)
|
||||
# upload: build
|
||||
# $(ATREUS_UPLOAD_COMMAND)
|
||||
|
53
keyboards/bananasplit/keymaps/rask/README.md
Normal file
53
keyboards/bananasplit/keymaps/rask/README.md
Normal file
@@ -0,0 +1,53 @@
|
||||
# rask's BananaSplit60
|
||||
|
||||

|
||||
|
||||
## Notes
|
||||
|
||||
### Layers
|
||||
|
||||
Base layer is a regular HHKBish ANSI layer. Toggling the
|
||||
alternate base layer (Fn3) makes it simpler to play games with
|
||||
the left space being set to be an actual Space.
|
||||
|
||||
Layer 1 (Fn1) contains usual 60% functionalities such as the
|
||||
F-row, while Layer 2 (Fn2) contains media controls.
|
||||
|
||||
The final layer (Fn4) is a special layer that acts as a lock
|
||||
layer, meaning the keyboard is locked while the layer
|
||||
is active. This firmware assumes a lock switch (read below).
|
||||
|
||||
### Lock switches
|
||||
|
||||
1.25u between the split space halves and the 1u key right
|
||||
left of LeftArrow are to be operated with a lock switch.
|
||||
If you don't have lock switches you should swap the `MO()`
|
||||
calls with `TG()` calls to make the layer toggles work
|
||||
with regular non/locking switches.
|
||||
|
||||
## How to make and flash
|
||||
|
||||
(These instructions are for Linux-based operating systems
|
||||
with `dfu-programmer` available.)
|
||||
|
||||
`cd` into the `bananasplit` keyboard's directory and run
|
||||
|
||||
make rask
|
||||
|
||||
which should result in a file called `bananasplit_rask.hex` appearing
|
||||
in your QMK root directory.
|
||||
|
||||
Now plug in your BananaSplit60 keyboard via USB. Verify
|
||||
with `lsusb` that it appears. At least my PCB did not have
|
||||
anything preflashed so you should see `atmega32u4` or similar
|
||||
in the `lsusb` output.
|
||||
|
||||
Now you can flash the firmware by
|
||||
|
||||
$ sudo dfu-programmer atmega32u4 erase
|
||||
$ cd /qmk_firmware/root/directory
|
||||
$ sudo dfu-programmer atmega32u4 flash bananasplit_rask.hex
|
||||
|
||||
_If_ you happen to have some other `atmega32u4` based device
|
||||
I suggest you plug it out before flashing your BS60 just to
|
||||
prevent accidentally flashing your old device.
|
72
keyboards/bananasplit/keymaps/rask/keymap.c
Normal file
72
keyboards/bananasplit/keymaps/rask/keymap.c
Normal file
@@ -0,0 +1,72 @@
|
||||
#include "bananasplit.h"
|
||||
|
||||
// rask's BananaSplit60 layout
|
||||
|
||||
#define L_BASE 0
|
||||
#define L_BASE_ALT 1
|
||||
#define L_ONE 2
|
||||
#define L_TWO 3
|
||||
#define L_LOCK 4
|
||||
|
||||
#define ______ KC_TRNS
|
||||
#define XXXXXX KC_NO
|
||||
|
||||
// L_BASE
|
||||
// Initial layer with default keymap
|
||||
//
|
||||
// L_BASE_ALT
|
||||
// Layer with some standardisation e.g. make
|
||||
// space key "full" to make gaming less of a
|
||||
// chore
|
||||
//
|
||||
// L_ONE
|
||||
// General things like F-row and navigation
|
||||
//
|
||||
// L_TWO
|
||||
// Media controls and more exotic keybinds
|
||||
//
|
||||
// L_LOCK
|
||||
// Lock the keyboard, release to unlock
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[L_BASE] = KEYMAP_HHKB_ARROW( \
|
||||
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_DEL, \
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, \
|
||||
MO(L_ONE), 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, MT(MOD_RSFT, KC_SLSH), KC_UP, MO(L_TWO), \
|
||||
KC_LCTRL, KC_LGUI, KC_LALT, KC_BSPC, MO(L_BASE_ALT), KC_SPACE, KC_RALT, MO(L_LOCK), KC_LEFT, KC_DOWN, KC_RIGHT \
|
||||
),
|
||||
|
||||
[L_BASE_ALT] = KEYMAP_HHKB_ARROW( \
|
||||
______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \
|
||||
______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \
|
||||
______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \
|
||||
______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \
|
||||
______, ______, ______, KC_SPACE, ______, ______, ______, ______, ______, ______, ______ \
|
||||
),
|
||||
|
||||
[L_ONE] = KEYMAP_HHKB_ARROW( \
|
||||
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_INS, \
|
||||
______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \
|
||||
______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \
|
||||
______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, KC_PGUP, ______, \
|
||||
______, ______, ______, ______, ______, ______, ______, ______, KC_HOME, KC_PGDN, KC_END \
|
||||
|
||||
),
|
||||
|
||||
[L_TWO] = KEYMAP_HHKB_ARROW( \
|
||||
______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \
|
||||
______, ______, ______, ______, ______, ______, ______, ______, ______, KC_MPRV, KC_MPLY, KC_MNXT, ______, ______, \
|
||||
KC_CAPS, ______, ______, ______, ______, ______, ______, ______, ______, KC_VOLD, KC_VOLU, KC_MUTE, ______, \
|
||||
______, ______, ______, ______, ______, ______, ______, ______, KC_MSTP, ______, ______, ______, ______, \
|
||||
______, KC_APP, ______, ______, ______, ______, ______, ______, ______, ______, ______ \
|
||||
),
|
||||
|
||||
[L_LOCK] = KEYMAP_HHKB_ARROW( \
|
||||
XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, \
|
||||
XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, \
|
||||
XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, \
|
||||
XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, \
|
||||
XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, ______, XXXXXX, XXXXXX, XXXXXX \
|
||||
),
|
||||
};
|
@@ -35,7 +35,4 @@ ARMV = 6
|
||||
|
||||
# Build Options
|
||||
# comment out to disable the options.
|
||||
#
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../Makefile
|
||||
endif
|
||||
#
|
@@ -44,9 +44,4 @@ ARMV = 7
|
||||
# http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf
|
||||
# This also requires a patch to chibios:
|
||||
# <tmk_dir>/tmk_core/tool/chibios/ch-bootloader-jump.patch
|
||||
#STM32_BOOTLOADER_ADDRESS = 0x1FFFC800
|
||||
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../Makefile
|
||||
endif
|
||||
#STM32_BOOTLOADER_ADDRESS = 0x1FFFC800
|
@@ -2,9 +2,24 @@
|
||||
|
||||
These ARM Teensies are now supported through [ChibiOS](http://chibios.org).
|
||||
|
||||
You'll need to install an ARM toolchain, for instance from [gcc ARM embedded](https://launchpad.net/gcc-arm-embedded) website, or using your favourite package manager. After installing, you should be able to run `arm-none-eabi-gcc -v` in the command prompt and get sensible output. This toolchain is used instead of `avr-gcc`, which is only for AVR chips. Naturally you'll also need the usual development tools (e.g. `make`), just as in the AVR setting.
|
||||
## Installing the ARM toolchain
|
||||
|
||||
Next, you'll need ChibiOS. For Teensies, you'll need code from two repositories: [chibios-main](https://github.com/ChibiOS/ChibiOS) and [chibios-contrib](https://github.com/ChibiOS/ChibiOS). If you're not using git, you can just download a [zip of chibios from here](https://github.com/ChibiOS/ChibiOS/archive/a7df9a891067621e8e1a5c2a2c0ceada82403afe.zip), unpack the zip, and rename/move the unpacked directory (named `ChibiOS-<long_hash_here>`) to `tmk_core/tool/chibios/chibios` (so that the file `tmk_core/tool/chibios/chibios/license.txt` exists). Now the same procedure with a [zip of chibios-contrib from here](https://github.com/ChibiOS/ChibiOS-Contrib/archive/e1311c4db6cd366cf760673f769e925741ac0ad3.zip): unpack and move `ChibiOS-Contrib-<long_hash_here>` to `tmk_core/tool/chibios/chibios-contrib`.
|
||||
You'll need to install an ARM toolchain, there is now a nice documentation about the two AVR/ARM toolchain : https://docs.qmk.fm/getting_started_build_tools.html and you can just run `sudo util/install_dependencies.sh`.
|
||||
This toolchain is used instead of `avr-gcc`, which is only for AVR chips. Naturally you'll also need the usual development tools (e.g. `make`), just as in the AVR setting.
|
||||
|
||||
You can find others way with the [gcc ARM embedded](https://launchpad.net/gcc-arm-embedded) website, or using your favourite package manager. After installing, you should be able to run `arm-none-eabi-gcc -v` in the command prompt and get sensible output.
|
||||
|
||||
## Installing ChibiOS
|
||||
|
||||
Next, you'll need ChibiOS. For Teensies, you'll need code from two repositories: [chibios-main](https://github.com/ChibiOS/ChibiOS) and [chibios-contrib](https://github.com/ChibiOS/ChibiOS).
|
||||
|
||||
### If you’re using git
|
||||
|
||||
Run `git submodule sync —recursive && git submodule update --init —recursive`. This will install ChibiOS and ChibiOS-Contrib in the `/lib/` directory.
|
||||
|
||||
### If you’re not using Git
|
||||
|
||||
If you're not using git, you can just download a [zip of chibios from here](https://github.com/ChibiOS/ChibiOS/archive/a7df9a891067621e8e1a5c2a2c0ceada82403afe.zip), unpack the zip, and rename/move the unpacked directory (named `ChibiOS-<long_hash_here>`) to `lib/chibios/chibios` (so that the file `lib/chibios/chibios/license.txt` exists). Now the same procedure with a [zip of chibios-contrib from here](https://github.com/ChibiOS/ChibiOS-Contrib/archive/e1311c4db6cd366cf760673f769e925741ac0ad3.zip): unpack and move `ChibiOS-Contrib-<long_hash_here>` to `lib/chibios/chibios-contrib`.
|
||||
|
||||
(If you're using git, you can just clone the two repos: [chibios](https://github.com/ChibiOS/ChibiOS) and [chibios-contrib](https://github.com/ChibiOS/ChibiOS-Contrib). However - be warned that things may be somewhat out-of-sync (updates at different rates), so you may need to hunt a bit for the right commits.)
|
||||
|
||||
|
@@ -42,8 +42,4 @@ MCU = cortex-m0plus
|
||||
|
||||
# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
|
||||
# I.e. 6 for Teensy LC; 7 for Teensy 3.x
|
||||
ARMV = 6
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../Makefile
|
||||
endif
|
||||
ARMV = 6
|
1
keyboards/clueboard/keymaps/tetris/Makefile
Normal file
1
keyboards/clueboard/keymaps/tetris/Makefile
Normal file
@@ -0,0 +1 @@
|
||||
SRC = tetris_text.c
|
209
keyboards/clueboard/keymaps/tetris/keymap.c
Normal file
209
keyboards/clueboard/keymaps/tetris/keymap.c
Normal file
@@ -0,0 +1,209 @@
|
||||
#include "clueboard.h"
|
||||
#include "tetris_text.h"
|
||||
|
||||
// Helpful defines
|
||||
#define GRAVE_MODS (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)|MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)|MOD_BIT(KC_LALT)|MOD_BIT(KC_RALT))
|
||||
#define _______ KC_TRNS
|
||||
|
||||
// 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 _CL 2
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/* Keymap _BL: Base Layer (Default Layer)
|
||||
*/
|
||||
[_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_GRV, KC_BSPC, KC_PGUP, \
|
||||
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_PGDN, \
|
||||
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_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RO, KC_RSFT, KC_UP, \
|
||||
KC_LCTL, KC_LGUI, KC_LALT, KC_MHEN, KC_SPC,KC_SPC, KC_HENK, KC_RALT, KC_RCTL, MO(_FL), KC_LEFT, KC_DOWN, KC_RGHT),
|
||||
|
||||
/* Keymap _FL: Function Layer
|
||||
*/
|
||||
[_FL] = 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, BL_STEP, \
|
||||
_______, _______, _______,_______,_______,F(1) ,_______,_______,KC_PSCR,KC_SLCK, KC_PAUS, _______, _______, _______, _______, \
|
||||
_______, _______, MO(_CL),_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, \
|
||||
_______, _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, KC_PGUP, \
|
||||
_______, _______, _______, _______, _______,_______, _______, _______, _______, MO(_FL), KC_HOME, KC_PGDN, KC_END),
|
||||
|
||||
/* Keymap _CL: Control layer
|
||||
*/
|
||||
[_CL] = KEYMAP(
|
||||
_______, _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, RGB_TOG, RGB_VAI, \
|
||||
_______, _______, _______,_______,RESET, _______,_______,_______,_______,_______, _______, _______, _______, _______, RGB_VAD, \
|
||||
_______, _______, MO(_CL),_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, \
|
||||
MO(_FL), _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, MO(_FL), RGB_SAI, \
|
||||
_______, _______, _______,_______, RGB_MOD, RGB_MOD, _______, _______, _______, _______, RGB_HUD, RGB_SAD, RGB_HUI),
|
||||
};
|
||||
|
||||
/* This is a list of user defined functions. F(N) corresponds to item N
|
||||
of this list.
|
||||
*/
|
||||
const uint16_t PROGMEM fn_actions[] = {
|
||||
[0] = ACTION_FUNCTION(0), // Calls action_function()
|
||||
[1] = ACTION_FUNCTION(1)
|
||||
};
|
||||
|
||||
static uint8_t tetris_key_presses = 0;
|
||||
static uint16_t tetris_timer = 0;
|
||||
static uint8_t tetris_running = 0;
|
||||
static int tetris_keypress = 0;
|
||||
|
||||
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
|
||||
static uint8_t mods_pressed;
|
||||
static bool mod_flag;
|
||||
|
||||
switch (id) {
|
||||
case 0:
|
||||
// clueboard specific hook to make escape quite tetris
|
||||
if (tetris_running) {
|
||||
tetris_running = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
/* Handle the combined Grave/Esc key
|
||||
*/
|
||||
mods_pressed = get_mods()&GRAVE_MODS; // Check to see what mods are pressed
|
||||
|
||||
if (record->event.pressed) {
|
||||
/* The key is being pressed.
|
||||
*/
|
||||
if (mods_pressed) {
|
||||
mod_flag = true;
|
||||
add_key(KC_GRV);
|
||||
send_keyboard_report();
|
||||
} else {
|
||||
add_key(KC_ESC);
|
||||
send_keyboard_report();
|
||||
}
|
||||
} else {
|
||||
/* The key is being released.
|
||||
*/
|
||||
if (mod_flag) {
|
||||
mod_flag = false;
|
||||
del_key(KC_GRV);
|
||||
send_keyboard_report();
|
||||
} else {
|
||||
del_key(KC_ESC);
|
||||
send_keyboard_report();
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (record->event.pressed) {
|
||||
tetris_running = 1;
|
||||
tetris_timer = 0;
|
||||
tetris_keypress = 0;
|
||||
// set randomness using total number of key presses
|
||||
tetris_start(tetris_key_presses);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Set up tetris
|
||||
*/
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
if (record->event.pressed) {
|
||||
tetris_key_presses++;
|
||||
}
|
||||
|
||||
if (tetris_running && record->event.pressed) {
|
||||
tetris_keypress = 0;
|
||||
switch (keycode) {
|
||||
case KC_UP: tetris_keypress = 1; break;
|
||||
case KC_LEFT: tetris_keypress = 2; break;
|
||||
case KC_DOWN: tetris_keypress = 3; break;
|
||||
case KC_RIGHT: tetris_keypress = 4; break;
|
||||
// Make ESC stop tetris (on keyboards other than clueboard)
|
||||
// case KC_ESC: tetris_running = 0; return false;
|
||||
}
|
||||
if (tetris_keypress != 0) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Runs constantly in the background, in a loop.
|
||||
void matrix_scan_user(void) {
|
||||
if (tetris_running) {
|
||||
tetris_timer++;
|
||||
if (tetris_timer > 1000) {
|
||||
// every 1000 times this is run is about 100 ms.
|
||||
if (!tetris_tick(100)) {
|
||||
// game over
|
||||
tetris_running = 0;
|
||||
}
|
||||
tetris_timer = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void send_keycode(uint16_t keycode) {
|
||||
register_code(keycode);
|
||||
unregister_code(keycode);
|
||||
}
|
||||
|
||||
void send_keycode_shift(uint16_t keycode) {
|
||||
register_code(KC_LSFT);
|
||||
register_code(keycode);
|
||||
unregister_code(keycode);
|
||||
unregister_code(KC_LSFT);
|
||||
}
|
||||
|
||||
void tetris_send_up(void) {
|
||||
send_keycode(KC_UP);
|
||||
}
|
||||
void tetris_send_left(void) {
|
||||
send_keycode(KC_LEFT);
|
||||
}
|
||||
void tetris_send_down(void) {
|
||||
send_keycode(KC_DOWN);
|
||||
}
|
||||
void tetris_send_right(void) {
|
||||
send_keycode(KC_RGHT);
|
||||
}
|
||||
void tetris_send_backspace(void) {
|
||||
send_keycode(KC_BSPC);
|
||||
}
|
||||
void tetris_send_delete(void) {
|
||||
send_keycode(KC_DEL);
|
||||
}
|
||||
|
||||
void tetris_send_string(const char *s) {
|
||||
for (int i = 0; s[i] != 0; i++) {
|
||||
if (s[i] >= 'a' && s[i] <= 'z') {
|
||||
send_keycode(KC_A + (s[i] - 'a'));
|
||||
} else if (s[i] >= 'A' && s[i] <= 'Z') {
|
||||
send_keycode_shift(KC_A + (s[i] - 'A'));
|
||||
} else if (s[i] >= '1' && s[i] <= '9') {
|
||||
send_keycode(KC_1 + (s[i] - '1'));
|
||||
} else {
|
||||
switch (s[i]) {
|
||||
case ' ': send_keycode(KC_SPACE); break;
|
||||
case '.': send_keycode(KC_DOT); break;
|
||||
case '0': send_keycode(KC_0); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void tetris_send_newline(void) {
|
||||
send_keycode(KC_ENT);
|
||||
}
|
||||
|
||||
int tetris_get_keypress(void) {
|
||||
int out = tetris_keypress;
|
||||
tetris_keypress = 0;
|
||||
return out;
|
||||
}
|
33
keyboards/clueboard/keymaps/tetris/readme.md
Normal file
33
keyboards/clueboard/keymaps/tetris/readme.md
Normal file
@@ -0,0 +1,33 @@
|
||||
Default layout but with a tetris game
|
||||
=====================================
|
||||
Tetris works by outputting key-presses to make ascii-art in a regular text editor.
|
||||
It reads key presses to rotate and move the bricks like a regular tetris game.
|
||||
|
||||
Example
|
||||
=======
|
||||

|
||||
|
||||
Usage
|
||||
=====
|
||||
1) Open a default text editor
|
||||
2) Press the tetris button (Fn + t)
|
||||
3) Play tetris
|
||||
|
||||
It makes ascii-art by sending keycodes: left, right, up, down, qwerty characters, and numbers.
|
||||
|
||||
Problems
|
||||
========
|
||||
Drawing ascii-art is too slow to make a pleasant playing experience.
|
||||
While drawing ascii-art, the keyboard does not record key-presses, so its pretty unresponsive.
|
||||
|
||||
Adds 5000 bytes to the hex file.
|
||||
|
||||
Implement in other keyboards
|
||||
============================
|
||||
- Copy-paste the files tetris_text.c and tetrix_text.h to your keymap folder.
|
||||
- Add/update your-keyboard/your-keymap/Makefile to include ``SRC = tetris_text.c``
|
||||
- Copy-paste the tetris-related code from this keymap.c to yours.
|
||||
- Set a key to trigger F(1) to start tetris mode.
|
||||
- Its also a good idea to set a key to stop tetris, here its escape.
|
||||
|
||||
You can find a simple tetris keyboard definition at <https://github.com/danamlund/meckb_tetris/>
|
505
keyboards/clueboard/keymaps/tetris/tetris_text.c
Normal file
505
keyboards/clueboard/keymaps/tetris/tetris_text.c
Normal file
@@ -0,0 +1,505 @@
|
||||
/* Copyright 2017 Dan Amlund Thomsen
|
||||
*
|
||||
* 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 <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "tetris_text.h"
|
||||
|
||||
static char empty_piece[7][7] = { { 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0, 0, 0, 0 } };
|
||||
|
||||
static char temp_piece[7][7];
|
||||
|
||||
static int curx = 0;
|
||||
static int cury = 0;
|
||||
|
||||
static void clear_piece(char piece[7][7]) {
|
||||
for (int y = 0; y < 7; y++) {
|
||||
for (int x = 0; x < 7; x++) {
|
||||
piece[x][y] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void copy_piece_from_to(char from[7][7], char to[7][7]) {
|
||||
for (int y = 0; y < 7; y++) {
|
||||
for (int x = 0; x < 7; x++) {
|
||||
to[x][y] = from[x][y];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void rotate_piece(char piece[7][7]) {
|
||||
// transpose
|
||||
for (int y = 0; y < 7; y++) {
|
||||
for (int x = y + 1; x < 7; x++) {
|
||||
char tmp = piece[y][x];
|
||||
piece[y][x] = piece[x][y];
|
||||
piece[x][y] = tmp;
|
||||
}
|
||||
}
|
||||
|
||||
// reverse rows
|
||||
for (int y = 0; y < 7; y++) {
|
||||
for (int x = 0; x < 3; x++) {
|
||||
char tmp = piece[y][6 - x];
|
||||
piece[y][6 - x] = piece[y][x];
|
||||
piece[y][x] = tmp;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static char get_shape_char(int shape) {
|
||||
switch (shape) {
|
||||
case 0: return 'I';
|
||||
case 1: return 'J';
|
||||
case 2: return 'L';
|
||||
case 3: return 'O';
|
||||
case 4: return 'S';
|
||||
case 5: return 'T';
|
||||
case 6: return 'Z';
|
||||
}
|
||||
return 'Q';
|
||||
}
|
||||
|
||||
static void set_piece(char piece[7][7], int shape, int rotation) {
|
||||
clear_piece(piece);
|
||||
switch (shape) {
|
||||
case 0:
|
||||
if (rotation % 2 == 0) {
|
||||
// xxXx
|
||||
piece[3][1] = 1;
|
||||
piece[3][2] = 1;
|
||||
piece[3][3] = 1;
|
||||
piece[3][4] = 1;
|
||||
} else {
|
||||
// x
|
||||
// x
|
||||
// X
|
||||
// x
|
||||
piece[1][3] = 1;
|
||||
piece[2][3] = 1;
|
||||
piece[3][3] = 1;
|
||||
piece[4][3] = 1;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
// xXx
|
||||
// x
|
||||
piece[3][2] = 1;
|
||||
piece[3][3] = 1;
|
||||
piece[3][4] = 1;
|
||||
piece[4][4] = 1;
|
||||
for (int i = 0; i < rotation; i++) {
|
||||
rotate_piece(piece);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
// xXx
|
||||
// x
|
||||
piece[3][2] = 1;
|
||||
piece[3][3] = 1;
|
||||
piece[3][4] = 1;
|
||||
piece[4][2] = 1;
|
||||
for (int i = 0; i < rotation; i++) {
|
||||
rotate_piece(piece);
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
// xX
|
||||
// xx
|
||||
piece[3][2] = 1;
|
||||
piece[3][3] = 1;
|
||||
piece[4][2] = 1;
|
||||
piece[4][3] = 1;
|
||||
break;
|
||||
case 4:
|
||||
if (rotation % 2 == 0) {
|
||||
// xX
|
||||
// xx
|
||||
piece[3][2] = 1;
|
||||
piece[3][3] = 1;
|
||||
piece[4][3] = 1;
|
||||
piece[4][4] = 1;
|
||||
} else {
|
||||
// x
|
||||
// xX
|
||||
// x
|
||||
piece[2][3] = 1;
|
||||
piece[3][2] = 1;
|
||||
piece[3][3] = 1;
|
||||
piece[4][2] = 1;
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
// xXx
|
||||
// x
|
||||
piece[3][2] = 1;
|
||||
piece[3][3] = 1;
|
||||
piece[3][4] = 1;
|
||||
piece[4][3] = 1;
|
||||
for (int i = 0; i < rotation; i++) {
|
||||
rotate_piece(piece);
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
if (rotation % 2 == 0) {
|
||||
// Xx
|
||||
// xx
|
||||
piece[3][3] = 1;
|
||||
piece[3][4] = 1;
|
||||
piece[4][2] = 1;
|
||||
piece[4][3] = 1;
|
||||
} else {
|
||||
// x
|
||||
// Xx
|
||||
// x
|
||||
piece[2][3] = 1;
|
||||
piece[3][3] = 1;
|
||||
piece[3][4] = 1;
|
||||
piece[4][4] = 1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void send_deletes(int deletes) {
|
||||
for (int i = 0; i < deletes; i++) {
|
||||
tetris_send_delete();
|
||||
}
|
||||
}
|
||||
|
||||
static void send_backspaces(int backspaces) {
|
||||
for (int i = 0; i < backspaces; i++) {
|
||||
tetris_send_backspace();
|
||||
curx--;
|
||||
}
|
||||
}
|
||||
|
||||
static void send_goto_xy(int x, int y) {
|
||||
while (curx < x) {
|
||||
tetris_send_right();
|
||||
curx++;
|
||||
}
|
||||
while (curx > x) {
|
||||
tetris_send_left();
|
||||
curx--;
|
||||
}
|
||||
while (cury < y) {
|
||||
tetris_send_down();
|
||||
cury++;
|
||||
}
|
||||
while (cury > y) {
|
||||
tetris_send_up();
|
||||
cury--;
|
||||
}
|
||||
}
|
||||
|
||||
static void draw_row(char c, const char oldrow[7], const char newrow[7], int x, int y) {
|
||||
char str[2] = { c, 0 };
|
||||
char row_is_del[7] = { 0 };
|
||||
int first = -1;
|
||||
int last = -1;
|
||||
for (int px = 0; px < 7; px++) {
|
||||
if (oldrow[px] && !newrow[px]) {
|
||||
row_is_del[px] = 1;
|
||||
}
|
||||
if (newrow[px] || oldrow[px]) {
|
||||
if (first == -1) first = px;
|
||||
last = px;
|
||||
}
|
||||
}
|
||||
|
||||
if (first >= 0) {
|
||||
if (curx > x + last + 1) {
|
||||
send_goto_xy(x + last + 1, cury);
|
||||
}
|
||||
if (curx < x + first) {
|
||||
send_goto_xy(x + first, cury);
|
||||
}
|
||||
send_goto_xy(curx, y);
|
||||
send_deletes((x + last + 1) - curx);
|
||||
send_backspaces(curx - (x + first));
|
||||
for (int i = first; i <= last; i++) {
|
||||
if (row_is_del[i]) {
|
||||
tetris_send_string(".");
|
||||
} else {
|
||||
tetris_send_string(str);
|
||||
}
|
||||
curx++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void move_piece_from_to(char from[7][7], char to[7][7], int xadd, int yadd) {
|
||||
for (int y = 0; y < 7; y++) {
|
||||
for (int x = 0; x < 7; x++) {
|
||||
if (x + xadd >= 0 && x + xadd < 7 && y + yadd >= 0 && y + yadd < 7) {
|
||||
to[y][x] = from[y + yadd][x + xadd];
|
||||
} else {
|
||||
to[y][x] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void draw_piece(char c, int x, int y, char oldpiece[7][7], char piece[7][7]) {
|
||||
for (int py = 0; py < 7; py++) {
|
||||
draw_row(c, oldpiece[py], piece[py], x, y + py);
|
||||
}
|
||||
}
|
||||
|
||||
static void draw_piece_moved(char c, int x, int y, char piece[7][7], int oldxadd, int oldyadd) {
|
||||
move_piece_from_to(piece, temp_piece, oldxadd, oldyadd);
|
||||
draw_piece(c, x, y, temp_piece, piece);
|
||||
}
|
||||
|
||||
static int is_piece_hitting(char board[20][10], char piece[7][7], int x, int y) {
|
||||
for (int py = 0; py < 7; py++) {
|
||||
for (int px = 0; px < 7; px++) {
|
||||
if (piece[py][px] &&
|
||||
(px + x >= 10 || px + x < 0
|
||||
|| py + y >= 20 || py + y < 0
|
||||
|| board[py + y][px + x])) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void add_piece_to_board(char piece[7][7], char board[20][10], int x, int y) {
|
||||
for (int py = 0; py < 7; py++) {
|
||||
for (int px = 0; px < 7; px++) {
|
||||
if (piece[py][px]) {
|
||||
board[py + y][px + x] = piece[py][px];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void draw_board_line(void) {
|
||||
//send_string("l l");
|
||||
tetris_send_string("l..........l");
|
||||
tetris_send_newline();
|
||||
}
|
||||
static void init(void) {
|
||||
for (int i = 0; i < 20; i++) {
|
||||
draw_board_line();
|
||||
}
|
||||
tetris_send_string("doooooooooob");
|
||||
curx = 12;
|
||||
cury = 20;
|
||||
}
|
||||
|
||||
static int get_piece_min_y(char piece[7][7]) {
|
||||
for (int y = 0; y < 7; y++) {
|
||||
for (int x = 0; x < 7; x++) {
|
||||
if (piece[y][x])
|
||||
return y;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int clear_lines(char board[20][10]) {
|
||||
int cleared_lines = 0;
|
||||
for (int y = 19; y >= 0; y--) {
|
||||
char isfull = 1;
|
||||
for (int x = 0; x < 10; x++) {
|
||||
if (!board[y][x]) {
|
||||
isfull = 0;
|
||||
}
|
||||
}
|
||||
if (isfull) {
|
||||
// delete clear line
|
||||
send_goto_xy(12, y);
|
||||
send_backspaces(12); // delete line contents
|
||||
// delete newline
|
||||
tetris_send_backspace();
|
||||
cury--;
|
||||
curx = 12;
|
||||
cleared_lines++;
|
||||
} else {
|
||||
if (cleared_lines > 0) {
|
||||
// move cleared lines down on board
|
||||
for (int x = 0; x < 10; x++) {
|
||||
board[y + cleared_lines][x] = board[y][x];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// clear cleared top lines
|
||||
for (int y = 0; y < cleared_lines; y++) {
|
||||
for (int x = 0; x < 10; x++) {
|
||||
board[y][x] = 0;
|
||||
}
|
||||
}
|
||||
if (cleared_lines > 0) {
|
||||
send_goto_xy(0, 0);
|
||||
for (int i = 0; i < cleared_lines; i++) {
|
||||
draw_board_line();
|
||||
curx = 0;
|
||||
cury++;
|
||||
}
|
||||
}
|
||||
return cleared_lines;
|
||||
}
|
||||
|
||||
static uint8_t myrandom(uint8_t seed) {
|
||||
uint8_t out = seed >> 1;
|
||||
if (seed & 1) {
|
||||
out = out ^ 0xB8;
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
static char piece[7][7];
|
||||
static char board[20][10];
|
||||
static uint8_t r;
|
||||
static int score;
|
||||
static int x;
|
||||
static int y;
|
||||
static int shape;
|
||||
static int rotation;
|
||||
static int time;
|
||||
static int next_down;
|
||||
static int down_delay;
|
||||
static int first_run;
|
||||
static int game_over;
|
||||
|
||||
void tetris_start(uint8_t seed) {
|
||||
for (int y = 0; y < 20; y++) {
|
||||
for (int x = 0; x < 10; x++) {
|
||||
board[y][x] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
clear_piece(piece);
|
||||
|
||||
init();
|
||||
|
||||
game_over = 0;
|
||||
|
||||
r = seed;
|
||||
score = 0;
|
||||
|
||||
copy_piece_from_to(empty_piece, piece);
|
||||
x = 0;
|
||||
y = 0;
|
||||
shape = 0;
|
||||
rotation = 0;
|
||||
time = 0;
|
||||
next_down = 0;
|
||||
down_delay = -1;
|
||||
first_run = 1;
|
||||
}
|
||||
|
||||
int tetris_tick(int ms_since_previous_tick) {
|
||||
if (game_over) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
time += ms_since_previous_tick;
|
||||
|
||||
if (first_run || time > next_down) {
|
||||
if (first_run || is_piece_hitting(board, piece, x, y + 1)) {
|
||||
first_run = 0;
|
||||
add_piece_to_board(piece, board, x, y);
|
||||
|
||||
score += clear_lines(board);
|
||||
|
||||
down_delay = 500 - score * 10;
|
||||
if (down_delay < 100) {
|
||||
down_delay = 100;
|
||||
}
|
||||
|
||||
rotation = 0;
|
||||
shape = r % 7;
|
||||
r = myrandom(r);
|
||||
set_piece(piece, shape, rotation);
|
||||
|
||||
x = 1;
|
||||
y = - get_piece_min_y(piece);
|
||||
draw_piece_moved(get_shape_char(shape), 1 + x, y, piece, 0, 0);
|
||||
|
||||
if (is_piece_hitting(board, piece, x, y)) {
|
||||
game_over = 1;
|
||||
send_goto_xy(12, 10);
|
||||
tetris_send_string(" game over");
|
||||
tetris_send_down();
|
||||
tetris_send_string(" score ");
|
||||
char tmp[10];
|
||||
sprintf(tmp, "%d", score);
|
||||
tetris_send_string(tmp);
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
y++;
|
||||
draw_piece_moved(get_shape_char(shape), 1 + x, y, piece, 0, +1);
|
||||
}
|
||||
next_down = time + down_delay;
|
||||
} else {
|
||||
|
||||
switch (tetris_get_keypress()) {
|
||||
case 1: { // up
|
||||
int oldrotation = rotation;
|
||||
rotation = (rotation + 1) % 4;
|
||||
copy_piece_from_to(piece, temp_piece);
|
||||
set_piece(piece, shape, rotation);
|
||||
if (is_piece_hitting(board, piece, x, y)) {
|
||||
rotation = oldrotation;
|
||||
set_piece(piece, shape, rotation);
|
||||
} else {
|
||||
draw_piece(get_shape_char(shape), 1 + x, y, temp_piece, piece);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 2: // left
|
||||
if (!is_piece_hitting(board, piece, x - 1, y)) {
|
||||
x--;
|
||||
draw_piece_moved(get_shape_char(shape), 1 + x, y, piece, -1, 0);
|
||||
}
|
||||
break;
|
||||
case 3: {// down
|
||||
int starty = y;
|
||||
while (!is_piece_hitting(board, piece, x, y + 1)) {
|
||||
y++;
|
||||
}
|
||||
|
||||
draw_piece(get_shape_char(shape), x + 1, starty, piece, empty_piece);
|
||||
draw_piece(get_shape_char(shape), x + 1, y, empty_piece, piece);
|
||||
|
||||
next_down = time + down_delay;
|
||||
break;
|
||||
}
|
||||
case 4: // right
|
||||
if (!is_piece_hitting(board, piece, x + 1, y)) {
|
||||
x++;
|
||||
draw_piece_moved(get_shape_char(shape), 1 + x, y, piece, 1, 0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
45
keyboards/clueboard/keymaps/tetris/tetris_text.h
Normal file
45
keyboards/clueboard/keymaps/tetris/tetris_text.h
Normal file
@@ -0,0 +1,45 @@
|
||||
/* Copyright 2017 Dan Amlund Thomsen
|
||||
*
|
||||
* 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 TETRIS_TEXT_H
|
||||
#define TETRIS_TEXT_H
|
||||
|
||||
//// to implement
|
||||
void tetris_send_up(void);
|
||||
void tetris_send_left(void);
|
||||
void tetris_send_down(void);
|
||||
void tetris_send_right(void);
|
||||
|
||||
void tetris_send_backspace(void);
|
||||
void tetris_send_delete(void);
|
||||
|
||||
void tetris_send_string(const char *s);
|
||||
|
||||
void tetris_send_newline(void);
|
||||
|
||||
// return = meaning
|
||||
// 0 = no keys pressed
|
||||
// 1 = up
|
||||
// 2 = left
|
||||
// 3 = down
|
||||
// 4 = right
|
||||
int tetris_get_keypress(void);
|
||||
|
||||
//// to call
|
||||
void tetris_start(uint8_t seed);
|
||||
// returns 0 when game is over
|
||||
int tetris_tick(int ms_since_previous_tick);
|
||||
|
||||
#endif
|
@@ -1,5 +1 @@
|
||||
BACKLIGHT_ENABLE = no
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../Makefile
|
||||
endif
|
||||
BACKLIGHT_ENABLE = no
|
@@ -1,5 +1 @@
|
||||
BACKLIGHT_ENABLE = yes
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../Makefile
|
||||
endif
|
||||
BACKLIGHT_ENABLE = yes
|
@@ -36,13 +36,13 @@ 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);
|
||||
PLAY_SONG(tone_startup);
|
||||
break;
|
||||
case 1:
|
||||
PLAY_NOTE_ARRAY(music_scale, false, 0);
|
||||
PLAY_SONG(music_scale);
|
||||
break;
|
||||
case 2:
|
||||
PLAY_NOTE_ARRAY(tone_goodbye, false, 0);
|
||||
PLAY_SONG(tone_goodbye);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@@ -29,3 +29,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#ifdef SUBPROJECT_protosplit
|
||||
#include "../../protosplit/config.h"
|
||||
#endif
|
||||
|
||||
#undef RGBLED_NUM
|
||||
#define RGBLIGHT_ANIMATIONS
|
||||
#define RGBLED_NUM 20
|
||||
#define RGBLIGHT_HUE_STEP 8
|
||||
#define RGBLIGHT_SAT_STEP 8
|
||||
#define RGBLIGHT_VAL_STEP 8
|
||||
|
@@ -24,16 +24,16 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
* |----------------------------------------------------------------------|
|
||||
* |Shif| | Z| X| C| V| B| N| M| ,| .| /|Shift | Up| End|
|
||||
* |----------------------------------------------------------------------|
|
||||
* |CapsLo|Gui |Alt |Sp |Mod | Sp| Alt| Gui| Ctrl| | Lef| Dow| Rig|
|
||||
* |CapsLo|Gui |Alt |Mod|Sp | Sp| Alt| Gui| Ctrl| | Lef| Dow| Rig|
|
||||
* `----------------------------------------------------------------------'
|
||||
*/
|
||||
KEYMAP_V2(
|
||||
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_INS, KC_DEL,
|
||||
KC_GRV, 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_TRNS, KC_HOME, // KC_TRNS is the unneeded key in the split backspace.
|
||||
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_PGUP,
|
||||
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_TRNS, KC_ENT, KC_PGDN, // KC_TRNS is unneeded ISO enter key.
|
||||
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_TRNS, KC_ENT, KC_PGDN, // KC_TRNS is uneeded ISO enter key.
|
||||
KC_LSFT, KC_TRNS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, // KC_TRNS is uneeded ISO layout key.
|
||||
KC_CAPS, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_SPC, KC_RALT, KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT),
|
||||
KC_CAPS, KC_LGUI, KC_LALT, MO(1), KC_SPC, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT),
|
||||
|
||||
KEYMAP_V2(
|
||||
RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET,
|
||||
|
@@ -21,9 +21,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <avr/io.h>
|
||||
#include <avr/wdt.h>
|
||||
#include <avr/interrupt.h>
|
||||
#include <util/delay.h>
|
||||
#include "wait.h"
|
||||
#include "print.h"
|
||||
#include "debug.h"
|
||||
#include "util.h"
|
||||
@@ -31,6 +29,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#include "split_util.h"
|
||||
#include "pro_micro.h"
|
||||
#include "config.h"
|
||||
#include "timer.h"
|
||||
|
||||
#ifdef USE_I2C
|
||||
# include "i2c.h"
|
||||
@@ -38,14 +37,29 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
# include "serial.h"
|
||||
#endif
|
||||
|
||||
#ifndef DEBOUNCE
|
||||
# define DEBOUNCE 5
|
||||
#ifndef DEBOUNCING_DELAY
|
||||
# define DEBOUNCING_DELAY 5
|
||||
#endif
|
||||
|
||||
#if (DEBOUNCING_DELAY > 0)
|
||||
static uint16_t debouncing_time;
|
||||
static bool debouncing = false;
|
||||
#endif
|
||||
|
||||
#if (MATRIX_COLS <= 8)
|
||||
# define print_matrix_header() print("\nr/c 01234567\n")
|
||||
# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row))
|
||||
# define matrix_bitpop(i) bitpop(matrix[i])
|
||||
# define ROW_SHIFTER ((uint8_t)1)
|
||||
#else
|
||||
# error "Currently only supports 8 COLS"
|
||||
#endif
|
||||
static matrix_row_t matrix_debouncing[MATRIX_ROWS];
|
||||
|
||||
#define ERROR_DISCONNECT_COUNT 5
|
||||
|
||||
static uint8_t debouncing = DEBOUNCE;
|
||||
static const int ROWS_PER_HAND = MATRIX_ROWS/2;
|
||||
#define ROWS_PER_HAND (MATRIX_ROWS/2)
|
||||
|
||||
static uint8_t error_count = 0;
|
||||
|
||||
static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS;
|
||||
@@ -55,11 +69,19 @@ static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
|
||||
static matrix_row_t matrix[MATRIX_ROWS];
|
||||
static matrix_row_t matrix_debouncing[MATRIX_ROWS];
|
||||
|
||||
static matrix_row_t read_cols(void);
|
||||
static void init_cols(void);
|
||||
static void unselect_rows(void);
|
||||
static void select_row(uint8_t row);
|
||||
|
||||
#if (DIODE_DIRECTION == COL2ROW)
|
||||
static void init_cols(void);
|
||||
static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row);
|
||||
static void unselect_rows(void);
|
||||
static void select_row(uint8_t row);
|
||||
static void unselect_row(uint8_t row);
|
||||
#elif (DIODE_DIRECTION == ROW2COL)
|
||||
static void init_rows(void);
|
||||
static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col);
|
||||
static void unselect_cols(void);
|
||||
static void unselect_col(uint8_t col);
|
||||
static void select_col(uint8_t col);
|
||||
#endif
|
||||
__attribute__ ((weak))
|
||||
void matrix_init_quantum(void) {
|
||||
matrix_init_kb();
|
||||
@@ -118,33 +140,54 @@ void matrix_init(void)
|
||||
}
|
||||
|
||||
matrix_init_quantum();
|
||||
|
||||
}
|
||||
|
||||
uint8_t _matrix_scan(void)
|
||||
{
|
||||
// Right hand is stored after the left in the matirx so, we need to offset it
|
||||
int offset = isLeftHand ? 0 : (ROWS_PER_HAND);
|
||||
#if (DIODE_DIRECTION == COL2ROW)
|
||||
// Set row, read cols
|
||||
for (uint8_t current_row = 0; current_row < ROWS_PER_HAND; current_row++) {
|
||||
# if (DEBOUNCING_DELAY > 0)
|
||||
bool matrix_changed = read_cols_on_row(matrix_debouncing+offset, current_row);
|
||||
|
||||
if (matrix_changed) {
|
||||
debouncing = true;
|
||||
debouncing_time = timer_read();
|
||||
PORTD ^= (1 << 2);
|
||||
}
|
||||
|
||||
# else
|
||||
read_cols_on_row(matrix+offset, current_row);
|
||||
# endif
|
||||
|
||||
for (uint8_t i = 0; i < ROWS_PER_HAND; i++) {
|
||||
select_row(i);
|
||||
_delay_us(30); // without this wait read unstable value.
|
||||
matrix_row_t cols = read_cols();
|
||||
if (matrix_debouncing[i+offset] != cols) {
|
||||
matrix_debouncing[i+offset] = cols;
|
||||
debouncing = DEBOUNCE;
|
||||
}
|
||||
unselect_rows();
|
||||
}
|
||||
|
||||
if (debouncing) {
|
||||
if (--debouncing) {
|
||||
_delay_ms(1);
|
||||
} else {
|
||||
#elif (DIODE_DIRECTION == ROW2COL)
|
||||
// Set col, read rows
|
||||
for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) {
|
||||
# if (DEBOUNCING_DELAY > 0)
|
||||
bool matrix_changed = read_rows_on_col(matrix_debouncing+offset, current_col);
|
||||
if (matrix_changed) {
|
||||
debouncing = true;
|
||||
debouncing_time = timer_read();
|
||||
}
|
||||
# else
|
||||
read_rows_on_col(matrix+offset, current_col);
|
||||
# endif
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
# if (DEBOUNCING_DELAY > 0)
|
||||
if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) {
|
||||
for (uint8_t i = 0; i < ROWS_PER_HAND; i++) {
|
||||
matrix[i+offset] = matrix_debouncing[i+offset];
|
||||
}
|
||||
debouncing = false;
|
||||
}
|
||||
}
|
||||
# endif
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -200,9 +243,7 @@ int serial_transaction(void) {
|
||||
|
||||
uint8_t matrix_scan(void)
|
||||
{
|
||||
int ret = _matrix_scan();
|
||||
|
||||
|
||||
uint8_t ret = _matrix_scan();
|
||||
|
||||
#ifdef USE_I2C
|
||||
if( i2c_transaction() ) {
|
||||
@@ -226,20 +267,17 @@ uint8_t matrix_scan(void)
|
||||
TXLED0;
|
||||
error_count = 0;
|
||||
}
|
||||
|
||||
matrix_scan_quantum();
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void matrix_slave_scan(void) {
|
||||
_matrix_scan();
|
||||
|
||||
int offset = (isLeftHand) ? 0 : (MATRIX_ROWS / 2);
|
||||
int offset = (isLeftHand) ? 0 : ROWS_PER_HAND;
|
||||
|
||||
#ifdef USE_I2C
|
||||
for (int i = 0; i < ROWS_PER_HAND; ++i) {
|
||||
/* i2c_slave_buffer[i] = matrix[offset+i]; */
|
||||
i2c_slave_buffer[i] = matrix[offset+i];
|
||||
}
|
||||
#else // USE_SERIAL
|
||||
@@ -286,33 +324,141 @@ uint8_t matrix_key_count(void)
|
||||
return count;
|
||||
}
|
||||
|
||||
static void init_cols(void)
|
||||
#if (DIODE_DIRECTION == COL2ROW)
|
||||
|
||||
static void init_cols(void)
|
||||
{
|
||||
for(int x = 0; x < MATRIX_COLS; x++) {
|
||||
_SFR_IO8((col_pins[x] >> 4) + 1) &= ~_BV(col_pins[x] & 0xF);
|
||||
_SFR_IO8((col_pins[x] >> 4) + 2) |= _BV(col_pins[x] & 0xF);
|
||||
for(uint8_t x = 0; x < MATRIX_COLS; x++) {
|
||||
uint8_t pin = col_pins[x];
|
||||
_SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
|
||||
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
|
||||
}
|
||||
}
|
||||
|
||||
static matrix_row_t read_cols(void)
|
||||
static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
|
||||
{
|
||||
matrix_row_t result = 0;
|
||||
for(int x = 0; x < MATRIX_COLS; x++) {
|
||||
result |= (_SFR_IO8(col_pins[x] >> 4) & _BV(col_pins[x] & 0xF)) ? 0 : (1 << x);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
// Store last value of row prior to reading
|
||||
matrix_row_t last_row_value = current_matrix[current_row];
|
||||
|
||||
static void unselect_rows(void)
|
||||
{
|
||||
for(int x = 0; x < ROWS_PER_HAND; x++) {
|
||||
_SFR_IO8((row_pins[x] >> 4) + 1) &= ~_BV(row_pins[x] & 0xF);
|
||||
_SFR_IO8((row_pins[x] >> 4) + 2) |= _BV(row_pins[x] & 0xF);
|
||||
// Clear data in matrix row
|
||||
current_matrix[current_row] = 0;
|
||||
|
||||
// Select row and wait for row selecton to stabilize
|
||||
select_row(current_row);
|
||||
wait_us(30);
|
||||
|
||||
// For each col...
|
||||
for(uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) {
|
||||
|
||||
// Select the col pin to read (active low)
|
||||
uint8_t pin = col_pins[col_index];
|
||||
uint8_t pin_state = (_SFR_IO8(pin >> 4) & _BV(pin & 0xF));
|
||||
|
||||
// Populate the matrix row with the state of the col pin
|
||||
current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << col_index);
|
||||
}
|
||||
|
||||
// Unselect row
|
||||
unselect_row(current_row);
|
||||
|
||||
return (last_row_value != current_matrix[current_row]);
|
||||
}
|
||||
|
||||
static void select_row(uint8_t row)
|
||||
{
|
||||
_SFR_IO8((row_pins[row] >> 4) + 1) |= _BV(row_pins[row] & 0xF);
|
||||
_SFR_IO8((row_pins[row] >> 4) + 2) &= ~_BV(row_pins[row] & 0xF);
|
||||
uint8_t pin = row_pins[row];
|
||||
_SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT
|
||||
_SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW
|
||||
}
|
||||
|
||||
static void unselect_row(uint8_t row)
|
||||
{
|
||||
uint8_t pin = row_pins[row];
|
||||
_SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
|
||||
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
|
||||
}
|
||||
|
||||
static void unselect_rows(void)
|
||||
{
|
||||
for(uint8_t x = 0; x < ROWS_PER_HAND; x++) {
|
||||
uint8_t pin = row_pins[x];
|
||||
_SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
|
||||
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
|
||||
}
|
||||
}
|
||||
|
||||
#elif (DIODE_DIRECTION == ROW2COL)
|
||||
|
||||
static void init_rows(void)
|
||||
{
|
||||
for(uint8_t x = 0; x < ROWS_PER_HAND; x++) {
|
||||
uint8_t pin = row_pins[x];
|
||||
_SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
|
||||
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
|
||||
}
|
||||
}
|
||||
|
||||
static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col)
|
||||
{
|
||||
bool matrix_changed = false;
|
||||
|
||||
// Select col and wait for col selecton to stabilize
|
||||
select_col(current_col);
|
||||
wait_us(30);
|
||||
|
||||
// For each row...
|
||||
for(uint8_t row_index = 0; row_index < ROWS_PER_HAND; row_index++)
|
||||
{
|
||||
|
||||
// Store last value of row prior to reading
|
||||
matrix_row_t last_row_value = current_matrix[row_index];
|
||||
|
||||
// Check row pin state
|
||||
if ((_SFR_IO8(row_pins[row_index] >> 4) & _BV(row_pins[row_index] & 0xF)) == 0)
|
||||
{
|
||||
// Pin LO, set col bit
|
||||
current_matrix[row_index] |= (ROW_SHIFTER << current_col);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Pin HI, clear col bit
|
||||
current_matrix[row_index] &= ~(ROW_SHIFTER << current_col);
|
||||
}
|
||||
|
||||
// Determine if the matrix changed state
|
||||
if ((last_row_value != current_matrix[row_index]) && !(matrix_changed))
|
||||
{
|
||||
matrix_changed = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Unselect col
|
||||
unselect_col(current_col);
|
||||
|
||||
return matrix_changed;
|
||||
}
|
||||
|
||||
static void select_col(uint8_t col)
|
||||
{
|
||||
uint8_t pin = col_pins[col];
|
||||
_SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT
|
||||
_SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW
|
||||
}
|
||||
|
||||
static void unselect_col(uint8_t col)
|
||||
{
|
||||
uint8_t pin = col_pins[col];
|
||||
_SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
|
||||
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
|
||||
}
|
||||
|
||||
static void unselect_cols(void)
|
||||
{
|
||||
for(uint8_t x = 0; x < MATRIX_COLS; x++) {
|
||||
uint8_t pin = col_pins[x];
|
||||
_SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
|
||||
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@@ -1,137 +1,18 @@
|
||||
DeltaSplit75
|
||||
======
|
||||
|
||||
This readme and most of the code are from https://github.com/ahtn/tmk_keyboard/ and https://github.com/qmk/qmk_firmware/tree/master/keyboards/lets_split
|
||||
A split 75% keyboard made by xyxjj. [More info on qmk.fm](http://qmk.fm/deltasplit75/)
|
||||
|
||||
Credit to ahtn and wootpatoot for work on the split keyboard firmware
|
||||
Keyboard Maintainer: [xyxjj](https://github.com/xyxjj)
|
||||
Hardware Supported: Pro Micro
|
||||
Hardware Availability: Group Buy
|
||||
|
||||
Split keyboard firmware for Arduino Pro Micro or other ATmega32u4
|
||||
based boards.
|
||||
Make example for this keyboard (after setting up your build environment):
|
||||
|
||||
## Case Files
|
||||
Files are available here: https://github.com/xyxjj/DeltaSplit75-Case-files
|
||||
make deltasplit75-v2-default
|
||||
|
||||
## Build Guide
|
||||
The build guide should be found at https://qmk.fm/deltasplit75
|
||||
See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information.
|
||||
|
||||
Files are available here: [DeltaSplit75 Case Files](https://github.com/xyxjj/DeltaSplit75-Case-files)
|
||||
|
||||
## First Time Setup
|
||||
|
||||
Download or clone the whole firmware and navigate to the keyboards/deltasplit75 directory. Once your dev env is setup, you'll be able to generate the .hex using:
|
||||
|
||||
```
|
||||
make v2
|
||||
|
||||
or
|
||||
|
||||
make v2-YOUR_KEYMAP_NAME (if you make a folder for your keymap)
|
||||
|
||||
or
|
||||
|
||||
make protosplit (if you have one of the prototype PCBs)
|
||||
```
|
||||
|
||||
You will see a lot of output and if everything worked correctly you will see the built hex files:
|
||||
|
||||
```
|
||||
deltasplit75_v2_protosplit.hex
|
||||
|
||||
or
|
||||
|
||||
deltasplit74_v2_YOUR_KEYMAP_NAME.hex
|
||||
|
||||
or
|
||||
|
||||
deltasplit75_v2_default.hex
|
||||
|
||||
```
|
||||
|
||||
|
||||
For more information on customizing keymaps, take a look at the primary documentation for [Customizing Your Keymap](/readme.md##customizing-your-keymap) in the main readme.md.
|
||||
|
||||
### DeltaSplit75 V2
|
||||
The PCBs available in groupbuy are all v2, if you've bought one of my prototype PCBs (it says DeltaSplit65 on the silkscreen instead of 75), use the code make protosplit instead
|
||||
|
||||
Features
|
||||
--------
|
||||
|
||||
For the full Quantum Mechanical Keyboard feature list, see [the parent readme.md](/readme.md).
|
||||
|
||||
Some features supported by the firmware:
|
||||
|
||||
* Either half can connect to the computer via USB, or both halves can be used
|
||||
independently.
|
||||
* 75% formfactor
|
||||
* Support for multiple Bottom Rows
|
||||
* RGB underglow support
|
||||
* Split Backspace and ISO support
|
||||
|
||||
|
||||
Flashing
|
||||
-------
|
||||
I personally use xLoader to upload my hex files to the keyboard, though any other working software is fine too
|
||||
|
||||
|
||||
Choosing which board to plug the USB cable into (choosing Master)
|
||||
--------
|
||||
Because the two boards are identical, the firmware has logic to differentiate the left and right board.
|
||||
|
||||
It uses two strategies to figure things out: look at the EEPROM (memory on the chip) or looks if the current board has the usb cable.
|
||||
|
||||
The EEPROM approach requires additional setup (flashing the eeeprom) but allows you to swap the usb cable to either side.
|
||||
|
||||
The USB cable approach is easier to setup and if you just want the usb cable on the left board, you do not need to do anything extra.
|
||||
|
||||
### Setting the left hand as master
|
||||
If you always plug the usb cable into the left board, nothing extra is needed as this is the default. Comment out `EE_HANDS` and comment out `I2C_MASTER_RIGHT` or `MASTER_RIGHT` if for some reason it was set.
|
||||
|
||||
### Setting the right hand as master
|
||||
If you always plug the usb cable into the right board, add an extra flag to your `config.h`
|
||||
```
|
||||
#define MASTER_RIGHT
|
||||
```
|
||||
|
||||
### Setting EE_hands to use either hands as master
|
||||
If you define `EE_HANDS` in your `config.h`, you will need to set the
|
||||
EEPROM for the left and right halves.
|
||||
|
||||
The EEPROM is used to store whether the
|
||||
half is left handed or right handed. This makes it so that the same firmware
|
||||
file will run on both hands instead of having to flash left and right handed
|
||||
versions of the firmware to each half. To flash the EEPROM file for the left
|
||||
half run:
|
||||
```
|
||||
avrdude -p atmega32u4 -P $(COM_PORT) -c avr109 -U eeprom:w:eeprom-lefthand.eep
|
||||
// or the equivalent in dfu-programmer
|
||||
|
||||
```
|
||||
and similarly for right half
|
||||
```
|
||||
avrdude -p atmega32u4 -P $(COM_PORT) -c avr109 -U eeprom:w:eeprom-righhand.eep
|
||||
// or the equivalent in dfu-programmer
|
||||
```
|
||||
|
||||
NOTE: replace `$(COM_PORT)` with the port of your device (e.g. `/dev/ttyACM0`)
|
||||
|
||||
After you have flashed the EEPROM, you then need to set `EE_HANDS` in your config.h, rebuild the hex files and reflash.
|
||||
|
||||
Note that you need to program both halves, but you have the option of using
|
||||
different keymaps for each half. You could program the left half with a QWERTY
|
||||
layout and the right half with a Colemak layout using bootmagic's default layout option.
|
||||
Then if you connect the left half to a computer by USB the keyboard will use QWERTY and Colemak when the
|
||||
right half is connected.
|
||||
|
||||
|
||||
Notes on Using Pro Micro 3.3V
|
||||
-----------------------------
|
||||
|
||||
Do update the `F_CPU` parameter in `rules.mk` to `8000000` which reflects
|
||||
the frequency on the 3.3V board.
|
||||
|
||||
Also, if the slave board is producing weird characters in certain columns,
|
||||
update the following line in `matrix.c` to the following:
|
||||
|
||||
```
|
||||
// _delay_us(30); // without this wait read unstable value.
|
||||
_delay_us(300); // without this wait read unstable value.
|
||||
```
|
||||
The build guide should be found here: [DeltaSplit75 Build Guide](http://qmk.fm/deltasplit75/)
|
||||
|
@@ -8,6 +8,7 @@
|
||||
#include "matrix.h"
|
||||
#include "keyboard.h"
|
||||
#include "config.h"
|
||||
#include "timer.h"
|
||||
|
||||
#ifdef USE_I2C
|
||||
# include "i2c.h"
|
||||
@@ -21,7 +22,7 @@ static void setup_handedness(void) {
|
||||
#ifdef EE_HANDS
|
||||
isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS);
|
||||
#else
|
||||
// I2C_MASTER_RIGHT is deprecated use MASTER_RIGHT instead since this works for both serial and i2c
|
||||
// I2C_MASTER_RIGHT is deprecated, use MASTER_RIGHT instead, since this works for both serial and i2c
|
||||
#if defined(I2C_MASTER_RIGHT) || defined(MASTER_RIGHT)
|
||||
isLeftHand = !has_usb();
|
||||
#else
|
||||
@@ -33,12 +34,16 @@ static void setup_handedness(void) {
|
||||
static void keyboard_master_setup(void) {
|
||||
#ifdef USE_I2C
|
||||
i2c_master_init();
|
||||
#ifdef SSD1306OLED
|
||||
matrix_master_OLED_init ();
|
||||
#endif
|
||||
#else
|
||||
serial_master_init();
|
||||
#endif
|
||||
}
|
||||
|
||||
static void keyboard_slave_setup(void) {
|
||||
timer_init();
|
||||
#ifdef USE_I2C
|
||||
i2c_slave_init(SLAVE_I2C_ADDRESS);
|
||||
#else
|
||||
|
25
keyboards/eco/keymaps/default/Makefile
Normal file
25
keyboards/eco/keymaps/default/Makefile
Normal file
@@ -0,0 +1,25 @@
|
||||
|
||||
|
||||
# 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 = no # Commands for debug and configuration
|
||||
NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
|
||||
MIDI_ENABLE = no # MIDI controls
|
||||
AUDIO_ENABLE = no # Audio output on port C6
|
||||
UNICODE_ENABLE = no # Unicode
|
||||
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
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../../Makefile
|
||||
endif
|
107
keyboards/eco/keymaps/default/keymap.c
Normal file
107
keyboards/eco/keymaps/default/keymap.c
Normal file
@@ -0,0 +1,107 @@
|
||||
// This is the canonical layout file for the Quantum project. If you want to add another keyboard,
|
||||
// this is the style you want to emulate.
|
||||
|
||||
// Default ECO Layout
|
||||
// KLE here : http://www.keyboard-layout-editor.com/#/gists/0733eca6b4cb88ff9d7de746803f4039
|
||||
|
||||
#include "eco.h"
|
||||
#include "action_layer.h"
|
||||
#include "eeconfig.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 _FN1 2
|
||||
#define _FN2 3
|
||||
|
||||
enum eco_keycodes {
|
||||
QWERTY = SAFE_RANGE
|
||||
};
|
||||
|
||||
// Fillers to make layering more clear
|
||||
#define _______ KC_TRNS
|
||||
#define XXXXXXX KC_NO
|
||||
|
||||
// Defines for task manager and such
|
||||
#define CALTDEL LCTL(LALT(KC_DEL))
|
||||
#define TSKMGR LCTL(LSFT(KC_ESC))
|
||||
|
||||
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 | , | . | / | Shift| Up | Del |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | Ctrl | GUI | Alt | Del | FN1 | FN1 | Space| Space| FN2 | FN2 | Ctrl | Left | Down | Right|
|
||||
* `-------------------------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_QWERTY] = KEYMAP(
|
||||
KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC,
|
||||
KC_TAB, 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_BSLS,
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_DEL,
|
||||
KC_LCTL, KC_LGUI,KC_LALT, KC_DEL, MO(_FN1), MO(_FN1), KC_SPC, KC_SPC, MO(_FN2), MO(_FN2), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
|
||||
),
|
||||
|
||||
/* FN1
|
||||
* ,-------------------------------------------------------------------------------------------------.
|
||||
* | | ! | @ | # | $ | % | ^ | & | * | ( | ) | _ | + | |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* |caltde| F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | | | | | | | | | | | | | | |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | | | | | | | | | | | | | | RESET|
|
||||
* `-------------------------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_FN1] = KEYMAP(
|
||||
_______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_UNDS, KC_PLUS, _______,
|
||||
CALTDEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET
|
||||
),
|
||||
|
||||
/* Raise
|
||||
* ,-------------------------------------------------------------------------------------------------.
|
||||
* | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* |Taskmg| F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | | | | | | | | | | | | | | |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | | | | | | | | | | | | | | |
|
||||
* `-------------------------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_FN2] = KEYMAP(
|
||||
_______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, _______,
|
||||
TSKMGR, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
)
|
||||
|
||||
};
|
||||
|
||||
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) {
|
||||
switch (keycode) {
|
||||
case QWERTY:
|
||||
if (record->event.pressed) {
|
||||
persistant_default_layer_set(1UL<<_QWERTY);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
3
keyboards/eco/keymaps/default/readme.md
Normal file
3
keyboards/eco/keymaps/default/readme.md
Normal file
@@ -0,0 +1,3 @@
|
||||
# ECO Default Layout by u/That-Canadian
|
||||
|
||||
KLE here : http://www.keyboard-layout-editor.com/#/gists/0733eca6b4cb88ff9d7de746803f4039
|
@@ -153,7 +153,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
case QWERTY:
|
||||
if (record->event.pressed) {
|
||||
#ifdef AUDIO_ENABLE
|
||||
PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
|
||||
PLAY_SONG(tone_qwerty);
|
||||
#endif
|
||||
persistant_default_layer_set(1UL<<_QWERTY);
|
||||
}
|
||||
@@ -194,12 +194,12 @@ void matrix_init_user(void) {
|
||||
void startup_user()
|
||||
{
|
||||
_delay_ms(20); // gets rid of tick
|
||||
PLAY_NOTE_ARRAY(tone_startup, false, 0);
|
||||
PLAY_SONG(tone_startup);
|
||||
}
|
||||
|
||||
void shutdown_user()
|
||||
{
|
||||
PLAY_NOTE_ARRAY(tone_goodbye, false, 0);
|
||||
PLAY_SONG(tone_goodbye);
|
||||
_delay_ms(150);
|
||||
stop_all_notes();
|
||||
}
|
||||
@@ -211,7 +211,7 @@ void music_on_user(void)
|
||||
|
||||
void music_scale_user(void)
|
||||
{
|
||||
PLAY_NOTE_ARRAY(music_scale, false, 0);
|
||||
PLAY_SONG(music_scale);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@@ -1,5 +1 @@
|
||||
BACKLIGHT_ENABLE = no
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../Makefile
|
||||
endif
|
||||
BACKLIGHT_ENABLE = no
|
@@ -1,5 +1 @@
|
||||
BACKLIGHT_ENABLE = no
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../Makefile
|
||||
endif
|
||||
BACKLIGHT_ENABLE = no
|
@@ -1,8 +1,6 @@
|
||||
#ifndef ERGODOX_ERGODONE_CONFIG_H
|
||||
#define ERGODOX_ERGODONE_CONFIG_H
|
||||
|
||||
#include "../config.h"
|
||||
|
||||
#include "config_common.h"
|
||||
|
||||
/* USB Device descriptor parameter */
|
||||
@@ -17,6 +15,31 @@
|
||||
#define MATRIX_ROWS 6
|
||||
#define MATRIX_COLS 14
|
||||
|
||||
#define MOUSEKEY_INTERVAL 20
|
||||
#define MOUSEKEY_DELAY 0
|
||||
#define MOUSEKEY_TIME_TO_MAX 60
|
||||
#define MOUSEKEY_MAX_SPEED 7
|
||||
#define MOUSEKEY_WHEEL_DELAY 0
|
||||
|
||||
#define TAPPING_TOGGLE 1
|
||||
|
||||
/* define if matrix has ghost */
|
||||
//#define MATRIX_HAS_GHOST
|
||||
|
||||
#define TAPPING_TERM 200
|
||||
#define IGNORE_MOD_TAP_INTERRUPT // this makes it possible to do rolling combos (zx) with keys that convert to other keys on hold (z becomes ctrl when you hold it, and when this option isn't enabled, z rapidly followed by x actually sends Ctrl-x. That's bad.)
|
||||
|
||||
/* 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_LCTL) | MOD_BIT(KC_RCTL)) || \
|
||||
keyboard_report->mods == (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)) \
|
||||
)
|
||||
|
||||
/* number of backlight levels */
|
||||
#define BACKLIGHT_LEVELS 3
|
||||
|
52
keyboards/ergodone/ergodone.c
Normal file
52
keyboards/ergodone/ergodone.c
Normal file
@@ -0,0 +1,52 @@
|
||||
#include "ergodone.h"
|
||||
|
||||
extern inline void ergodox_board_led_on(void);
|
||||
extern inline void ergodox_right_led_1_on(void);
|
||||
extern inline void ergodox_right_led_2_on(void);
|
||||
extern inline void ergodox_right_led_3_on(void);
|
||||
extern inline void ergodox_right_led_on(uint8_t led);
|
||||
|
||||
extern inline void ergodox_board_led_off(void);
|
||||
extern inline void ergodox_right_led_1_off(void);
|
||||
extern inline void ergodox_right_led_2_off(void);
|
||||
extern inline void ergodox_right_led_3_off(void);
|
||||
extern inline void ergodox_right_led_off(uint8_t led);
|
||||
|
||||
void ergodox_led_init(void);
|
||||
void ergodox_blink_all_leds(void);
|
||||
|
||||
void matrix_init_kb(void) {
|
||||
ergodox_led_init();
|
||||
ergodox_blink_all_leds();
|
||||
matrix_init_user();
|
||||
}
|
||||
|
||||
void ergodox_led_init(void)
|
||||
{
|
||||
DDRB |= (1<<PB5 | 1<<PB6 | 1<<PB3);
|
||||
PORTB &= ~(1<<PB5 | 1<<PB6 | 1<<PB3);
|
||||
DDRB |= (1<<PB0);
|
||||
PORTB |= (1<<PB0);
|
||||
DDRD |= (1<<PB5);
|
||||
PORTD |= (1<<PB5);
|
||||
}
|
||||
|
||||
void ergodox_blink_all_leds(void)
|
||||
{
|
||||
ergodox_led_all_off();
|
||||
ergodox_led_all_set(LED_BRIGHTNESS_HI);
|
||||
ergodox_right_led_1_on();
|
||||
_delay_ms(50);
|
||||
ergodox_right_led_2_on();
|
||||
_delay_ms(50);
|
||||
ergodox_right_led_3_on();
|
||||
_delay_ms(50);
|
||||
ergodox_right_led_1_off();
|
||||
_delay_ms(50);
|
||||
ergodox_right_led_2_off();
|
||||
_delay_ms(50);
|
||||
ergodox_right_led_3_off();
|
||||
//ergodox_led_all_on();
|
||||
//_delay_ms(333);
|
||||
ergodox_led_all_off();
|
||||
}
|
@@ -10,18 +10,57 @@
|
||||
|
||||
void init_ergodox(void);
|
||||
|
||||
inline void ergodox_right_led_1_off(void) {}
|
||||
inline void ergodox_right_led_1_on(void) {}
|
||||
inline void ergodox_right_led_2_off(void) {}
|
||||
inline void ergodox_right_led_2_on(void) {}
|
||||
inline void ergodox_right_led_3_off(void) {}
|
||||
inline void ergodox_right_led_3_on(void) {}
|
||||
inline void ergodox_right_led_on(uint8_t l) {}
|
||||
inline void ergodox_right_led_off(uint8_t l) {}
|
||||
inline void ergodox_board_led_off(void) {}
|
||||
inline void ergodox_board_led_on(void) {}
|
||||
inline void ergodox_led_all_on(void) {}
|
||||
inline void ergodox_led_all_off(void) {}
|
||||
inline void ergodox_right_led_1_off(void) { DDRB &= ~(1<<PB5); PORTB &= ~(1<<PB5); }
|
||||
inline void ergodox_right_led_1_on(void) { DDRB |= (1<<PB5); PORTB |= (1<<PB5); }
|
||||
inline void ergodox_right_led_2_off(void) { DDRB &= ~(1<<PB6); PORTB &= ~(1<<PB6); }
|
||||
inline void ergodox_right_led_2_on(void) { DDRB |= (1<<PB6); PORTB |= (1<<PB6); }
|
||||
inline void ergodox_right_led_3_off(void) { DDRB &= ~(1<<PB3); PORTB &= ~(1<<PB3); }
|
||||
inline void ergodox_right_led_3_on(void) { DDRB |= (1<<PB3); PORTB |= (1<<PB3); }
|
||||
inline void ergodox_right_led_on(uint8_t l) {
|
||||
switch (l) {
|
||||
case 1:
|
||||
ergodox_right_led_1_on();
|
||||
break;
|
||||
case 2:
|
||||
ergodox_right_led_2_on();
|
||||
break;
|
||||
case 3:
|
||||
ergodox_right_led_3_on();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
inline void ergodox_right_led_off(uint8_t l) {
|
||||
switch (l) {
|
||||
case 1:
|
||||
ergodox_right_led_1_off();
|
||||
break;
|
||||
case 2:
|
||||
ergodox_right_led_2_off();
|
||||
break;
|
||||
case 3:
|
||||
ergodox_right_led_3_off();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
inline void ergodox_board_led_off(void) { DDRB &= ~(1<<PB0); PORTB |= (1<<PB0); }
|
||||
inline void ergodox_board_led_on(void) { DDRB |= (1<<PB0); PORTB &= ~(1<<PB0); }
|
||||
inline void ergodox_led_all_on(void) {
|
||||
ergodox_right_led_1_on();
|
||||
ergodox_right_led_2_on();
|
||||
ergodox_right_led_3_on();
|
||||
ergodox_board_led_on();
|
||||
}
|
||||
inline void ergodox_led_all_off(void) {
|
||||
ergodox_right_led_1_off();
|
||||
ergodox_right_led_2_off();
|
||||
ergodox_right_led_3_off();
|
||||
ergodox_board_led_off();
|
||||
}
|
||||
inline void ergodox_right_led_1_set(uint8_t n) {}
|
||||
inline void ergodox_right_led_2_set(uint8_t n) {}
|
||||
inline void ergodox_right_led_3_set(uint8_t n) {}
|
||||
@@ -60,4 +99,6 @@ inline void ergodox_led_all_set(uint8_t n) {}
|
||||
{ KC_NO, k51, k52, k53, k54, k55, k56, k57, k58, k59, k5A, k5B, k5C, KC_NO } \
|
||||
}
|
||||
|
||||
#define LAYOUT_ergodox KEYMAP
|
||||
|
||||
#endif
|
@@ -1,4 +1,4 @@
|
||||
#include "ergodox.h"
|
||||
#include QMK_KEYBOARD_H
|
||||
#include "debug.h"
|
||||
#include "action_layer.h"
|
||||
#include "version.h"
|
||||
@@ -38,7 +38,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
*/
|
||||
// If it accepts an argument (i.e, is a function), it doesn't need KC_.
|
||||
// Otherwise, it needs KC_*
|
||||
[BASE] = KEYMAP( // layer 0 : default
|
||||
[BASE] = LAYOUT_ergodox( // layer 0 : default
|
||||
// left hand
|
||||
KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT,
|
||||
KC_DELT, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB),
|
||||
@@ -80,7 +80,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
* `--------------------' `--------------------'
|
||||
*/
|
||||
// SYMBOLS
|
||||
[SYMB] = KEYMAP(
|
||||
[SYMB] = LAYOUT_ergodox(
|
||||
// left hand
|
||||
VRSN, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS,
|
||||
KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS,
|
||||
@@ -122,7 +122,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
* `--------------------' `--------------------'
|
||||
*/
|
||||
// MEDIA AND MOUSE
|
||||
[MDIA] = KEYMAP(
|
||||
[MDIA] = LAYOUT_ergodox(
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS,
|
@@ -70,6 +70,8 @@ OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
# Build Options
|
||||
# comment out to disable the options.
|
||||
#
|
||||
CUSTOM_MATRIX = yes # Custom matrix file for the ErgoDone
|
||||
UNICODE_ENABLE = yes # Unicode
|
||||
BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
|
||||
@@ -89,3 +91,5 @@ LEDMAP_IN_EEPROM_ENABLE = no # Read LED mapping from eeprom
|
||||
ONEHAND_ENABLE = no # Disable Onehand
|
||||
RGBLIGHT_ENABLE = no
|
||||
MIDI_ENABLE = no
|
||||
|
||||
LAYOUTS = ergodox ergodox_80
|
@@ -1,40 +0,0 @@
|
||||
#ifndef KEYBOARDS_ERGODOX_CONFIG_H_
|
||||
#define KEYBOARDS_ERGODOX_CONFIG_H_
|
||||
|
||||
#define MOUSEKEY_INTERVAL 20
|
||||
#define MOUSEKEY_DELAY 0
|
||||
#define MOUSEKEY_TIME_TO_MAX 60
|
||||
#define MOUSEKEY_MAX_SPEED 7
|
||||
#define MOUSEKEY_WHEEL_DELAY 0
|
||||
|
||||
#define TAPPING_TOGGLE 1
|
||||
|
||||
/* define if matrix has ghost */
|
||||
//#define MATRIX_HAS_GHOST
|
||||
|
||||
#define TAPPING_TERM 200
|
||||
#define IGNORE_MOD_TAP_INTERRUPT // this makes it possible to do rolling combos (zx) with keys that convert to other keys on hold (z becomes ctrl when you hold it, and when this option isn't enabled, z rapidly followed by x actually sends Ctrl-x. That's bad.)
|
||||
|
||||
/* 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_LCTL) | MOD_BIT(KC_RCTL)) || \
|
||||
keyboard_report->mods == (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)) \
|
||||
)
|
||||
|
||||
#ifdef SUBPROJECT_ez
|
||||
#include "ez/config.h"
|
||||
#endif
|
||||
#ifdef SUBPROJECT_infinity
|
||||
#include "infinity/config.h"
|
||||
#endif
|
||||
#ifdef SUBPROJECT_ergodone
|
||||
#include "ergodone/config.h"
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* KEYBOARDS_ERGODOX_CONFIG_H_ */
|
@@ -1,5 +0,0 @@
|
||||
#include "ergodone.h"
|
||||
|
||||
void matrix_init_kb(void) {
|
||||
matrix_init_user();
|
||||
}
|
@@ -1,4 +0,0 @@
|
||||
#include "ergodox.h"
|
||||
#include "debug.h"
|
||||
#include "action_layer.h"
|
||||
|
@@ -1,13 +0,0 @@
|
||||
#ifndef KEYBOARDS_ERGODOX_ERGODOX_H_
|
||||
#define KEYBOARDS_ERGODOX_ERGODOX_H_
|
||||
#ifdef SUBPROJECT_ez
|
||||
#include "ez.h"
|
||||
#endif
|
||||
#ifdef SUBPROJECT_infinity
|
||||
#include "infinity.h"
|
||||
#endif
|
||||
#ifdef SUBPROJECT_ergodone
|
||||
#include "ergodone.h"
|
||||
#endif
|
||||
|
||||
#endif /* KEYBOARDS_ERGODOX_ERGODOX_H_ */
|
@@ -1,6 +0,0 @@
|
||||
TAP_DANCE_ENABLE=yes
|
||||
UNICODE_ENABLE=yes
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../../Makefile
|
||||
endif
|
@@ -1,42 +0,0 @@
|
||||
/*
|
||||
Copyright 2017 Fred Sundvik
|
||||
|
||||
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 "simple_visualizer.h"
|
||||
|
||||
// This function should be implemented by the keymap visualizer
|
||||
// Don't change anything else than state->target_lcd_color and state->layer_text as that's the only thing
|
||||
// that the simple_visualizer assumes that you are updating
|
||||
// Also make sure that the buffer passed to state->layer_text remains valid until the previous animation is
|
||||
// stopped. This can be done by either double buffering it or by using constant strings
|
||||
static void get_visualizer_layer_and_color(visualizer_state_t* state) {
|
||||
uint8_t saturation = 60;
|
||||
if (state->status.leds & (1u << USB_LED_CAPS_LOCK)) {
|
||||
saturation = 255;
|
||||
}
|
||||
if (state->status.layer & 0x4) {
|
||||
state->target_lcd_color = LCD_COLOR(0, saturation, 0xFF);
|
||||
state->layer_text = "Media & Mouse";
|
||||
}
|
||||
else if (state->status.layer & 0x2) {
|
||||
state->target_lcd_color = LCD_COLOR(168, saturation, 0xFF);
|
||||
state->layer_text = "Symbol";
|
||||
}
|
||||
else {
|
||||
state->target_lcd_color = LCD_COLOR(84, saturation, 0xFF);
|
||||
state->layer_text = "Default";
|
||||
}
|
||||
}
|
@@ -1,79 +0,0 @@
|
||||
#include "ergodox.h"
|
||||
#include "debug.h"
|
||||
#include "action_layer.h"
|
||||
#include "version.h"
|
||||
#include "keymap_fr_ch.h"
|
||||
#include "keymap_french.h"
|
||||
#include "keymap_german.h"
|
||||
#include "keymap_german_ch.h"
|
||||
#include "keymap_nordic.h"
|
||||
#include "keymap_norwegian.h"
|
||||
#include "keymap_spanish.h"
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
|
||||
[0] = KEYMAP(NO_LESS,KC_1,KC_2,KC_3,KC_4,KC_5,KC_BSPACE,KC_TAB,KC_Q,KC_W,KC_E,KC_R,KC_T,TG(1),KC_BSPACE,KC_A,KC_S,KC_D,KC_F,KC_G,SFT_T(NO_APOS),CTL_T(KC_Z),KC_X,KC_C,KC_V,KC_B,SFT_T(KC_EQUAL),MO(1),CTL_T(KC_GRAVE),KC_LGUI,KC_LEFT,KC_RIGHT,KC_ESCAPE,KC_CAPSLOCK,KC_HOME,KC_SPACE,KC_LGUI,KC_LALT,KC_DELETE,KC_6,KC_7,KC_8,KC_9,KC_0,NO_PLUS,TG(1),KC_Y,KC_U,KC_I,KC_O,KC_P,NO_AM,KC_H,KC_J,KC_K,KC_L,LT(2,NO_OSLH),NO_AE,SFT_T(KC_RBRC),KC_N,KC_M,KC_COMMA,KC_DOT,CTL_T(KC_SLASH),SFT_T(NO_APOS),KC_DOWN,KC_UP,NO_LPRN,NO_RPRN,MO(1),NO_QUOT,CTL_T(KC_ESCAPE),NO_APOS,KC_LALT,KC_LGUI,KC_ENTER),
|
||||
|
||||
[1] = KEYMAP(M(0),KC_F1,KC_F2,KC_F3,KC_F4,KC_F5,KC_BSPACE,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_BSPACE,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_LSHIFT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_LCTL,KC_LGUI,KC_LEFT,KC_RIGHT,KC_ESCAPE,KC_TRANSPARENT,KC_HOME,KC_SPACE,KC_LGUI,KC_LALT,KC_DELETE,KC_F6,KC_F7,KC_F8,KC_F9,KC_F10,KC_F11,KC_TRANSPARENT,KC_7,KC_8,KC_9,KC_TRANSPARENT,KC_TRANSPARENT,KC_F12,KC_4,KC_5,KC_6,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_0,KC_1,KC_2,KC_3,NO_LBRC,NO_RBRC,KC_LSHIFT,KC_COMMA,KC_DOT,LSFT(NO_LBRC),LSFT(NO_RBRC),KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_LALT,KC_LGUI,KC_ENTER),
|
||||
|
||||
[2] = KEYMAP(KC_ESCAPE,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_MS_UP,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_MS_LEFT,KC_MS_DOWN,KC_MS_RIGHT,KC_TRANSPARENT,KC_LSHIFT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_LCTL,KC_LALT,KC_LGUI,KC_MS_BTN1,KC_MS_BTN2,KC_ESCAPE,KC_TRANSPARENT,KC_TRANSPARENT,KC_SPACE,KC_LGUI,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_MEDIA_PREV_TRACK,KC_MEDIA_PLAY_PAUSE,KC_MEDIA_NEXT_TRACK,KC_TRANSPARENT,KC_TRANSPARENT,KC_AUDIO_VOL_UP,KC_AUDIO_VOL_DOWN,KC_AUDIO_MUTE,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_ESCAPE,KC_MS_WH_UP,KC_MS_WH_DOWN,KC_MS_ACCEL0,KC_MS_ACCEL1),
|
||||
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM fn_actions[] = {
|
||||
[1] = ACTION_LAYER_TAP_TOGGLE(1)
|
||||
};
|
||||
|
||||
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
||||
{
|
||||
switch(id) {
|
||||
case 0:
|
||||
if (record->event.pressed) {
|
||||
SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
|
||||
}
|
||||
break;
|
||||
}
|
||||
return MACRO_NONE;
|
||||
};
|
||||
|
||||
void matrix_scan_user(void) {
|
||||
|
||||
uint8_t layer = biton32(layer_state);
|
||||
|
||||
ergodox_board_led_off();
|
||||
ergodox_right_led_1_off();
|
||||
ergodox_right_led_2_off();
|
||||
ergodox_right_led_3_off();
|
||||
switch (layer) {
|
||||
case 1:
|
||||
ergodox_right_led_1_on();
|
||||
break;
|
||||
case 2:
|
||||
ergodox_right_led_2_on();
|
||||
break;
|
||||
case 3:
|
||||
ergodox_right_led_3_on();
|
||||
break;
|
||||
case 4:
|
||||
ergodox_right_led_1_on();
|
||||
ergodox_right_led_2_on();
|
||||
break;
|
||||
case 5:
|
||||
ergodox_right_led_1_on();
|
||||
ergodox_right_led_3_on();
|
||||
break;
|
||||
case 6:
|
||||
ergodox_right_led_2_on();
|
||||
ergodox_right_led_3_on();
|
||||
break;
|
||||
case 7:
|
||||
ergodox_right_led_1_on();
|
||||
ergodox_right_led_2_on();
|
||||
ergodox_right_led_3_on();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
};
|
@@ -1,13 +0,0 @@
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../../Makefile
|
||||
endif
|
||||
|
||||
install-xorg-configuration:
|
||||
install -m 0664 90-$(KEYBOARD)-$(KEYMAP).conf \
|
||||
/etc/X11/xorg.conf.d/90-$(KEYBOARD)-$(KEYMAP).conf
|
||||
install -m 0644 $(KEYBOARD)_$(KEYMAP) \
|
||||
/usr/share/X11/xkb/symbols/$(KEYBOARD)_$(KEYMAP)
|
||||
|
||||
uninstall-xorg-configuration:
|
||||
-rm -f /etc/X11/xorg.conf.d/90-$(KEYBOARD)-$(KEYMAP).conf
|
||||
-rm -f /usr/share/X11/xkb/symbols/$(KEYBOARD)_$(KEYMAP)
|
@@ -1,111 +0,0 @@
|
||||
ErgoDox
|
||||
==
|
||||
|
||||
The ErgoDox is a split ergonomic keyboard originally developed by Dominic "Dox" Beauchamp.
|
||||
|
||||
* The **ErgoDox EZ** is a Teensy-based split mechanical keyboard, sold assembled and with warranty at [ErgoDox-EZ.com](https://ergodox-ez.com).
|
||||
* The **ErgoDox Infinity** is an ARM-based split mechanical keyboard, sold from time to time in kit form at [MassDrop.com](https://www.massdrop.com/buy/infinity-ergodox)
|
||||
|
||||
The ErgoDox EZ code is maintained by Erez Zukerman and is officially supported by the EZ -- the keyboard ships running QMK from the factory.
|
||||
|
||||
The ErgoDox Infinity code is maintained by Fredizzimo, as a community contribution.
|
||||
|
||||
## Standard Build Instructions
|
||||
|
||||
To build QMK for the ErgoDox, see the official [build guide](/docs/build_guide.md).
|
||||
|
||||
## Additional resources
|
||||
|
||||
A graphical configurator for the ErgoDox EZ is available at [configure.ergodox-ez.com](http://configure.ergodox-ez.com). It outputs QMK-compiled binaries, as well as source code for your layout, which you can use as a jumping-off point to further customize in QMK.
|
||||
|
||||
# Flashing Firmware
|
||||
|
||||
## ErgoDox EZ
|
||||
|
||||
The Ez uses the [Teensy Loader](https://www.pjrc.com/teensy/loader.html).
|
||||
|
||||
Linux users need to modify udev rules as described on the [Teensy
|
||||
Linux page]. Some distributions provide a binary, maybe called
|
||||
`teensy-loader-cli`.
|
||||
|
||||
[Teensy Linux page]: https://www.pjrc.com/teensy/loader_linux.html
|
||||
|
||||
To flash the firmware:
|
||||
|
||||
- Build the firmware with `make keymapname`, for example `make default`
|
||||
- This will result in a hex file called `ergodox_ez_keymapname.hex`, e.g.
|
||||
`ergodox_ez_default.hex`
|
||||
|
||||
- Start the teensy loader.
|
||||
|
||||
- Load the .hex file into it.
|
||||
|
||||
- Press the Reset button by inserting a paperclip gently into the reset hole
|
||||
in the top right corder.
|
||||
|
||||
- Click the button in the Teensy app to download the firmware.
|
||||
|
||||
To flash with ´teensy-loader-cli´:
|
||||
|
||||
- Build the firmware with `make keymapname`, for example `make default`
|
||||
|
||||
- Run ´<path/to/>teensy_loader_cli -mmcu=atmega32u4 -w ergodox_ez_<keymap>.hex´
|
||||
|
||||
- Press the Reset button by inserting a paperclip gently into the reset hole
|
||||
in the top right corder.
|
||||
|
||||
## ErgoDox Infinity
|
||||
|
||||
The Infinity is two completely independent keyboards, and needs to be flashed
|
||||
for the left and right halves seperately. To flash them:
|
||||
|
||||
- Build the firmware with `make infinity-keymapname`
|
||||
|
||||
- Plug in the left hand keyboard only.
|
||||
|
||||
- Press the program button (back of keyboard, above thumb pad).
|
||||
|
||||
- Install the firmware with `sudo make infinity-keymapname-dfu-util`
|
||||
|
||||
- Build right hand firmware with `make infinity-keymapname MASTER=right`
|
||||
|
||||
- Plug in the right hand keyboard only.
|
||||
|
||||
- Press the program button (back of keyboard, above thumb pad).
|
||||
|
||||
- Install the firmware with `sudo make infinity-keymapname-dfu-util MASTER=right`
|
||||
|
||||
More information on the Infinity firmware is available in the [TMK/chibios for
|
||||
Input Club Infinity Ergodox](https://github.com/fredizzimo/infinity_ergodox/blob/master/README.md)
|
||||
|
||||
### Infinity Master/Two Halves
|
||||
|
||||
The Infinity is two completely independent keyboards, that can connect together.
|
||||
You have a few options in how you flash the firmware:
|
||||
|
||||
- Flash the left half, rebuild the firmware with "MASTER=right" and then flash
|
||||
the right half. This allows you to plug in either half directly to the
|
||||
computer and is what the above instructions do.
|
||||
|
||||
- Flash the left half, then flash the same firmware on the right. This only
|
||||
works when the left half is plugged directly to the computer and the keymap
|
||||
is mirrored. It saves the small extra step of rebuilding with
|
||||
"MASTER=right".
|
||||
|
||||
- The same as the previous one but with "MASTER=right" when you build the
|
||||
firmware, then flash the same firmware to both halves. You just have to
|
||||
directly connect the right half to the computer.
|
||||
|
||||
- For minor changes such as changing only the keymap without having updated
|
||||
any part of the firmware code itself, you can program only the MASTER half.
|
||||
It is safest to program both halves though.
|
||||
|
||||
## ErgoDone
|
||||
|
||||
The ErgoDone uses its own HID bootloader and needs to be flashed using the [TKG Toolkit](https://github.com/kairyu/tkg-toolkit).
|
||||
|
||||
- Build the firmware with `make ergodone-keymapname`
|
||||
|
||||
- While plugging in the USB cable, hold the two right-most keys on the left half of the ErgoDone to enter FLASH mode.
|
||||
|
||||
- Use the utility from [TKG Toolkit](https://github.com/kairyu/tkg-toolkit) to flash the keyboard: `hid_bootloader_cli -mmcu=atmega32u4 ergodox_ergodone_keymapname.hex`
|
@@ -1,28 +0,0 @@
|
||||
#----------------------------------------------------------------------------
|
||||
# On command line:
|
||||
#
|
||||
# make = Make software.
|
||||
#
|
||||
# make clean = Clean out built project files.
|
||||
#
|
||||
# That's pretty much all you need. To compile, always go make clean,
|
||||
# followed by make.
|
||||
#
|
||||
# For advanced users only:
|
||||
# make teensy = Download the hex file to the device, using teensy_loader_cli.
|
||||
# (must have teensy_loader_cli installed).
|
||||
#
|
||||
#----------------------------------------------------------------------------
|
||||
# Build Options
|
||||
# comment out to disable the options.
|
||||
#
|
||||
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
|
||||
CUSTOM_MATRIX = yes # Custom matrix file for the ErgoDox EZ
|
||||
SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend
|
||||
NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
UNICODE_ENABLE = yes # Unicode
|
||||
ONEHAND_ENABLE = yes # Allow swapping hands of keyboard
|
0
keyboards/ergodox/ez/190hotfix.sh → keyboards/ergodox_ez/190hotfix.sh
Executable file → Normal file
0
keyboards/ergodox/ez/190hotfix.sh → keyboards/ergodox_ez/190hotfix.sh
Executable file → Normal file
@@ -4,5 +4,5 @@ RGBLIGHT_ENABLE = yes
|
||||
MIDI_ENABLE = no
|
||||
|
||||
ifndef MAKEFILE_INCLUDED
|
||||
include ../../../Makefile
|
||||
include ../../Makefile
|
||||
endif
|
@@ -19,8 +19,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#ifndef ERGODOX_EZ_CONFIG_H
|
||||
#define ERGODOX_EZ_CONFIG_H
|
||||
|
||||
#include "../config.h"
|
||||
|
||||
#include "config_common.h"
|
||||
|
||||
/* USB Device descriptor parameter */
|
||||
@@ -35,6 +33,31 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define MATRIX_ROWS 14
|
||||
#define MATRIX_COLS 6
|
||||
|
||||
#define MOUSEKEY_INTERVAL 20
|
||||
#define MOUSEKEY_DELAY 0
|
||||
#define MOUSEKEY_TIME_TO_MAX 60
|
||||
#define MOUSEKEY_MAX_SPEED 7
|
||||
#define MOUSEKEY_WHEEL_DELAY 0
|
||||
|
||||
#define TAPPING_TOGGLE 1
|
||||
|
||||
/* define if matrix has ghost */
|
||||
//#define MATRIX_HAS_GHOST
|
||||
|
||||
#define TAPPING_TERM 200
|
||||
#define IGNORE_MOD_TAP_INTERRUPT // this makes it possible to do rolling combos (zx) with keys that convert to other keys on hold (z becomes ctrl when you hold it, and when this option isn't enabled, z rapidly followed by x actually sends Ctrl-x. That's bad.)
|
||||
|
||||
/* 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_LCTL) | MOD_BIT(KC_RCTL)) || \
|
||||
keyboard_report->mods == (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)) \
|
||||
)
|
||||
|
||||
/* number of backlight levels */
|
||||
#define BACKLIGHT_LEVELS 3
|
||||
|
@@ -1,4 +1,4 @@
|
||||
#include "ez.h"
|
||||
#include QMK_KEYBOARD_H
|
||||
#include "i2cmaster.h"
|
||||
|
||||
|
@@ -160,4 +160,6 @@ inline void ergodox_led_all_set(uint8_t n)
|
||||
{ k0D, k1D, k2D, k3D, k4D, KC_NO } \
|
||||
}
|
||||
|
||||
#define LAYOUT_ergodox KEYMAP
|
||||
|
||||
#endif
|
@@ -1,4 +1,4 @@
|
||||
#include "ergodox.h"
|
||||
#include QMK_KEYBOARD_H
|
||||
#include "debug.h"
|
||||
#include "action_layer.h"
|
||||
|
223
keyboards/ergodox_ez/keymaps/default/keymap.c
Normal file
223
keyboards/ergodox_ez/keymaps/default/keymap.c
Normal file
@@ -0,0 +1,223 @@
|
||||
#include QMK_KEYBOARD_H
|
||||
#include "debug.h"
|
||||
#include "action_layer.h"
|
||||
#include "version.h"
|
||||
|
||||
#define BASE 0 // default layer
|
||||
#define SYMB 1 // symbols
|
||||
#define MDIA 2 // media keys
|
||||
|
||||
enum custom_keycodes {
|
||||
PLACEHOLDER = SAFE_RANGE, // can always be here
|
||||
EPRM,
|
||||
VRSN,
|
||||
RGB_SLD
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/* Keymap 0: Basic layer
|
||||
*
|
||||
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||
* | = | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | - |
|
||||
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||
* | Del | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | \ |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | BkSp | A | S | D | F | G |------| |------| H | J | K | L |; / L2|' / Cmd |
|
||||
* |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------|
|
||||
* | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift |
|
||||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||
* |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* | App | LGui | | Alt |Ctrl/Esc|
|
||||
* ,------|------|------| |------+--------+------.
|
||||
* | | | Home | | PgUp | | |
|
||||
* | Space|Backsp|------| |------| Tab |Enter |
|
||||
* | |ace | End | | PgDn | | |
|
||||
* `--------------------' `----------------------'
|
||||
*/
|
||||
// If it accepts an argument (i.e, is a function), it doesn't need KC_.
|
||||
// Otherwise, it needs KC_*
|
||||
[BASE] = LAYOUT_ergodox( // layer 0 : default
|
||||
// left hand
|
||||
KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT,
|
||||
KC_DELT, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB),
|
||||
KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G,
|
||||
KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO),
|
||||
LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LEFT,KC_RGHT,
|
||||
ALT_T(KC_APP), KC_LGUI,
|
||||
KC_HOME,
|
||||
KC_SPC,KC_BSPC,KC_END,
|
||||
// right hand
|
||||
KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,
|
||||
TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS,
|
||||
KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),GUI_T(KC_QUOT),
|
||||
MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT,
|
||||
KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1,
|
||||
KC_LALT, CTL_T(KC_ESC),
|
||||
KC_PGUP,
|
||||
KC_PGDN,KC_TAB, KC_ENT
|
||||
),
|
||||
/* Keymap 1: Symbol Layer
|
||||
*
|
||||
* ,---------------------------------------------------. ,--------------------------------------------------.
|
||||
* |Version | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 |
|
||||
* |---------+------+------+------+------+------+------| |------+------+------+------+------+------+--------|
|
||||
* | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 |
|
||||
* |---------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | |
|
||||
* |---------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | |
|
||||
* `---------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||
* | EPRM | | | | | | | . | 0 | = | |
|
||||
* `-----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* |Animat| | |Toggle|Solid |
|
||||
* ,------|------|------| |------+------+------.
|
||||
* |Bright|Bright| | | |Hue- |Hue+ |
|
||||
* |ness- |ness+ |------| |------| | |
|
||||
* | | | | | | | |
|
||||
* `--------------------' `--------------------'
|
||||
*/
|
||||
// SYMBOLS
|
||||
[SYMB] = LAYOUT_ergodox(
|
||||
// left hand
|
||||
VRSN, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS,
|
||||
KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS,
|
||||
KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV,
|
||||
KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS,
|
||||
EPRM,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,
|
||||
RGB_MOD,KC_TRNS,
|
||||
KC_TRNS,
|
||||
RGB_VAD,RGB_VAI,KC_TRNS,
|
||||
// right hand
|
||||
KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
|
||||
KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12,
|
||||
KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS,
|
||||
KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS,
|
||||
KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS,
|
||||
RGB_TOG, RGB_SLD,
|
||||
KC_TRNS,
|
||||
KC_TRNS, RGB_HUD, RGB_HUI
|
||||
),
|
||||
/* Keymap 2: Media and mouse keys
|
||||
*
|
||||
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||
* | | | | | | | | | | | | | | | |
|
||||
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||
* | | | | MsUp | | | | | | | | | | | |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | | | | | | | | | | | | Prev | Next | | |
|
||||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||
* | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* | | | | | |
|
||||
* ,------|------|------| |------+------+------.
|
||||
* | | | | | | |Brwser|
|
||||
* | | |------| |------| |Back |
|
||||
* | | | | | | | |
|
||||
* `--------------------' `--------------------'
|
||||
*/
|
||||
// MEDIA AND MOUSE
|
||||
[MDIA] = LAYOUT_ergodox(
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2,
|
||||
KC_TRNS, KC_TRNS,
|
||||
KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
// right hand
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS,
|
||||
KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS,
|
||||
KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_WBAK
|
||||
),
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM fn_actions[] = {
|
||||
[1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols)
|
||||
};
|
||||
|
||||
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
||||
{
|
||||
// MACRODOWN only works in this function
|
||||
switch(id) {
|
||||
case 0:
|
||||
if (record->event.pressed) {
|
||||
SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (record->event.pressed) { // For resetting EEPROM
|
||||
eeconfig_init();
|
||||
}
|
||||
break;
|
||||
}
|
||||
return MACRO_NONE;
|
||||
};
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
switch (keycode) {
|
||||
// dynamically generate these.
|
||||
case EPRM:
|
||||
if (record->event.pressed) {
|
||||
eeconfig_init();
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case VRSN:
|
||||
if (record->event.pressed) {
|
||||
SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case RGB_SLD:
|
||||
if (record->event.pressed) {
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
rgblight_mode(1);
|
||||
#endif
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// Runs just one time when the keyboard initializes.
|
||||
void matrix_init_user(void) {
|
||||
|
||||
};
|
||||
|
||||
|
||||
// Runs constantly in the background, in a loop.
|
||||
void matrix_scan_user(void) {
|
||||
|
||||
uint8_t layer = biton32(layer_state);
|
||||
|
||||
ergodox_board_led_off();
|
||||
ergodox_right_led_1_off();
|
||||
ergodox_right_led_2_off();
|
||||
ergodox_right_led_3_off();
|
||||
switch (layer) {
|
||||
// TODO: Make this relevant to the ErgoDox EZ.
|
||||
case 1:
|
||||
ergodox_right_led_1_on();
|
||||
break;
|
||||
case 2:
|
||||
ergodox_right_led_2_on();
|
||||
break;
|
||||
default:
|
||||
// none
|
||||
break;
|
||||
}
|
||||
|
||||
};
|
15
keyboards/ergodox_ez/keymaps/default/readme.md
Normal file
15
keyboards/ergodox_ez/keymaps/default/readme.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# ErgoDox EZ Default Configuration
|
||||
|
||||
## Changelog
|
||||
|
||||
* Dec 2016:
|
||||
* Added LED keys
|
||||
* Refreshed layout graphic, comes from http://configure.ergodox-ez.com now.
|
||||
* Sep 22, 2016:
|
||||
* Created a new key in layer 1 (bottom-corner key) that resets the EEPROM.
|
||||
* Feb 2, 2016 (V1.1):
|
||||
* Made the right-hand quote key double as Cmd/Win on hold. So you get ' when you tap it, " when you tap it with Shift, and Cmd or Win when you hold it. You can then use it as a modifier, or just press and hold it for a moment (and then let go) to send a single Cmd or Win keystroke (handy for opening the Start menu on Windows).
|
||||
|
||||
This is what we ship with out of the factory. :) The image says it all:
|
||||
|
||||

|
@@ -1,7 +1,7 @@
|
||||
// Netable differences vs. the default firmware for the ErgoDox EZ:
|
||||
// 1. The Cmd key is now on the right side, making Cmd+Space easier.
|
||||
// 2. The media keys work on OSX (But not on Windows).
|
||||
#include "ergodox.h"
|
||||
#include QMK_KEYBOARD_H
|
||||
#include "debug.h"
|
||||
#include "action_layer.h"
|
||||
|
||||
@@ -33,7 +33,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
*/
|
||||
// If it accepts an argument (i.e, is a function), it doesn't need KC_.
|
||||
// Otherwise, it needs KC_*
|
||||
[BASE] = KEYMAP( // layer 0 : default
|
||||
[BASE] = LAYOUT_ergodox( // layer 0 : default
|
||||
// left hand
|
||||
KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT,
|
||||
KC_DELT, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB),
|
||||
@@ -75,7 +75,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
* `--------------------' `--------------------'
|
||||
*/
|
||||
// SYMBOLS
|
||||
[SYMB] = KEYMAP(
|
||||
[SYMB] = LAYOUT_ergodox(
|
||||
// left hand
|
||||
KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS,
|
||||
KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS,
|
||||
@@ -117,7 +117,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
* `--------------------' `--------------------'
|
||||
*/
|
||||
// MEDIA AND MOUSE
|
||||
[MDIA] = KEYMAP(
|
||||
[MDIA] = LAYOUT_ergodox(
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS,
|
@@ -1,10 +1,9 @@
|
||||
TAP_DANCE_ENABLE = yes
|
||||
LAYER_UNDERGLOW_LIGHTING = yes
|
||||
SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend
|
||||
COMMAND_ENABLE = no # Commands for debug and configuration
|
||||
RGBLIGHT_ENABLE = yes
|
||||
MIDI_ENABLE = no
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../../Makefile
|
||||
endif
|
||||
TAP_DANCE_ENABLE = yes
|
||||
SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend
|
||||
COMMAND_ENABLE = no # Commands for debug and configuration
|
||||
RGBLIGHT_ENABLE = yes
|
||||
MIDI_ENABLE = no
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../../Makefile
|
||||
endif
|
@@ -4,5 +4,3 @@
|
||||
|
||||
#define TAPPING_TERM 200
|
||||
|
||||
|
||||
#define LAYER_UNDERGLOW_LIGHTING
|
@@ -1,4 +1,20 @@
|
||||
#include "ergodox.h"
|
||||
/*
|
||||
This is the keymap for the keyboard
|
||||
Copyright 2012 Jun Wako <wakojun@gmail.com>
|
||||
Copyright 2015 Jack Humbert
|
||||
Copyright 2017 Art Ortenburger
|
||||
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 "debug.h"
|
||||
#include "action_layer.h"
|
||||
#include "version.h"
|
||||
@@ -28,17 +44,18 @@
|
||||
#define M_SALT M(2)
|
||||
#define M_HARD M(3)
|
||||
#define M_MAKE M(4)
|
||||
#define M_COVECUBE M(5)
|
||||
#define M_GOODGAME M(5)
|
||||
#define M_MORESALT M(6)
|
||||
#define M_DOOMFIST M(7)
|
||||
|
||||
|
||||
//define layer change stuff for underglow indicator
|
||||
bool skip_leds = false;
|
||||
|
||||
//This is both for underglow, and Diablo 3 macros
|
||||
bool has_layer_changed = false;
|
||||
static uint8_t current_layer;
|
||||
|
||||
static uint16_t key_timer;
|
||||
//define diablo macro timer variables
|
||||
static uint16_t diablo_timer[4];
|
||||
static uint8_t diablo_times[] = {0, 1, 3, 5, 10, 30};
|
||||
@@ -49,10 +66,6 @@ bool check_dtimer(uint8_t dtimer) {
|
||||
return (timer_elapsed(diablo_timer[dtimer]) < ( diablo_key_time[dtimer] * 1000 ) ) ? false : true;
|
||||
};
|
||||
|
||||
bool checktime(void){
|
||||
return (timer_elapsed(key_timer) < 150) ? true : false;
|
||||
};
|
||||
|
||||
|
||||
enum custom_keycodes {
|
||||
PLACEHOLDER = SAFE_RANGE, // can always be here
|
||||
@@ -69,11 +82,7 @@ enum custom_keycodes {
|
||||
|
||||
#ifdef TAP_DANCE_ENABLE
|
||||
enum {
|
||||
SFT_CAP = 0,
|
||||
TD_DIABLO_J,
|
||||
TD_CLN,
|
||||
TD_EGG,
|
||||
TD_FLSH,
|
||||
TD_FLSH = 0,
|
||||
TD_DIABLO_1,
|
||||
TD_DIABLO_2,
|
||||
TD_DIABLO_3,
|
||||
@@ -82,33 +91,10 @@ enum {
|
||||
|
||||
|
||||
|
||||
void dance_cln_finished (qk_tap_dance_state_t *state, void *user_data) {
|
||||
if (state->count == 1) {
|
||||
register_code (KC_RSFT);
|
||||
register_code (KC_SCLN);
|
||||
} else {
|
||||
register_code (KC_SCLN);
|
||||
}
|
||||
}
|
||||
|
||||
void dance_cln_reset (qk_tap_dance_state_t *state, void *user_data) {
|
||||
if (state->count == 1) {
|
||||
unregister_code (KC_RSFT);
|
||||
unregister_code (KC_SCLN);
|
||||
} else {
|
||||
unregister_code (KC_SCLN);
|
||||
}
|
||||
}
|
||||
|
||||
void dance_egg (qk_tap_dance_state_t *state, void *user_data) {
|
||||
if (state->count >= 10) {
|
||||
SEND_STRING ("Safety dance!");
|
||||
reset_tap_dance (state);
|
||||
}
|
||||
}
|
||||
|
||||
// on each tap, light up one led, from right to left
|
||||
// on the forth tap, turn them off from right to left
|
||||
// on the forth tap, turn them off from right to leftmake ergodox-ez-drashna-custom-teensy
|
||||
|
||||
void dance_flsh_each(qk_tap_dance_state_t *state, void *user_data) {
|
||||
if (!skip_leds) {
|
||||
ergodox_board_led_off();
|
||||
@@ -119,37 +105,38 @@ void dance_flsh_each(qk_tap_dance_state_t *state, void *user_data) {
|
||||
}
|
||||
switch (state->count) {
|
||||
case 1:
|
||||
ergodox_right_led_3_on();
|
||||
ergodox_right_led_1_on();
|
||||
break;
|
||||
case 2:
|
||||
ergodox_right_led_2_on();
|
||||
break;
|
||||
case 3:
|
||||
ergodox_right_led_1_on();
|
||||
ergodox_right_led_3_on();
|
||||
break;
|
||||
case 4:
|
||||
ergodox_right_led_3_off();
|
||||
ergodox_right_led_1_off();
|
||||
_delay_ms(50);
|
||||
ergodox_right_led_2_off();
|
||||
_delay_ms(50);
|
||||
ergodox_right_led_1_off();
|
||||
ergodox_right_led_3_off();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// on the fourth tap, set the keyboard on flash state
|
||||
// and set the underglow to red, because red == bad
|
||||
void dance_flsh_finished(qk_tap_dance_state_t *state, void *user_data) {
|
||||
if (state->count >= 4) {
|
||||
#ifdef LAYER_UNDERGLOW_LIGHTING
|
||||
rgblight_enable();
|
||||
rgblight_mode(1);
|
||||
rgblight_setrgb(0xff,0x00,0x00);
|
||||
#endif
|
||||
reset_keyboard();
|
||||
reset_tap_dance(state);
|
||||
}
|
||||
}
|
||||
|
||||
// Cycle through the times for the macro, starting at 0, for disabled.
|
||||
// Max of six values, so don't exceed
|
||||
void diablo_tapdance_master (qk_tap_dance_state_t *state, void *user_data, uint8_t diablo_key) {
|
||||
if (state->count >= 7) {
|
||||
diablo_key_time[diablo_key] = diablo_times[0];
|
||||
@@ -159,6 +146,8 @@ void diablo_tapdance_master (qk_tap_dance_state_t *state, void *user_data, uint8
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Would rather have one function for all of this, but no idea how to do that...
|
||||
void diablo_tapdance1 (qk_tap_dance_state_t *state, void *user_data) {
|
||||
diablo_tapdance_master (state, user_data, 0);
|
||||
}
|
||||
@@ -179,28 +168,20 @@ void diablo_tapdance4 (qk_tap_dance_state_t *state, void *user_data) {
|
||||
// if the flash state didnt happen, then turn off leds, left to right
|
||||
void dance_flsh_reset(qk_tap_dance_state_t *state, void *user_data) {
|
||||
_delay_ms(200);
|
||||
ergodox_right_led_1_off();
|
||||
ergodox_right_led_3_off();
|
||||
_delay_ms(200);
|
||||
ergodox_right_led_2_off();
|
||||
_delay_ms(200);
|
||||
ergodox_right_led_3_off();
|
||||
ergodox_right_led_1_off();
|
||||
_delay_ms(500);
|
||||
skip_leds = false;
|
||||
}
|
||||
|
||||
//Tap Dance Definitions
|
||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
||||
//Tap one for Space, and twice for Enter
|
||||
[SFT_CAP] = ACTION_TAP_DANCE_DOUBLE(KC_LSHIFT, KC_CAPS),
|
||||
// Special Z
|
||||
[TD_DIABLO_J] = ACTION_TAP_DANCE_DOUBLE(KC_J, S(KC_J)),
|
||||
// Once for colin, twice for semi-colin
|
||||
[TD_CLN] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, dance_cln_finished, dance_cln_reset),
|
||||
// Tap until you get a surprise
|
||||
[TD_EGG] = ACTION_TAP_DANCE_FN (dance_egg),
|
||||
//Once for Blue, Twice for Green, Thrice for Red, and four to flash
|
||||
[TD_FLSH] = ACTION_TAP_DANCE_FN_ADVANCED (dance_flsh_each, dance_flsh_finished, dance_flsh_reset),
|
||||
|
||||
// tap once to disable, and more to enable timed micros
|
||||
[TD_DIABLO_1] = ACTION_TAP_DANCE_FN(diablo_tapdance1),
|
||||
[TD_DIABLO_2] = ACTION_TAP_DANCE_FN(diablo_tapdance2),
|
||||
[TD_DIABLO_3] = ACTION_TAP_DANCE_FN(diablo_tapdance3),
|
||||
@@ -220,9 +201,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | Bksp | A | S | D | F | G |------| |------| H | J | K | L | ; | ' " |
|
||||
* |--------+------+------+------+------+------| TG(2)| | TG(2)|------+------+------+------+------+--------|
|
||||
* | Shift | Z | X | C | V | B | | | | N | M | , < | . > | UP | Shift |
|
||||
* | Shift | Z | X | C | V | B | | | | N | M | , < | . > | ? / | Shift |
|
||||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||
* | `/SYM| ' " | LGUI | [ { | ] } | | SYMB | ? / | LEFT | DOWN |RIGHT |
|
||||
* | `/SYM| ' " | LGUI | [ { | ] } | | LEFT | DOWN | UP |RIGHT | SYMB |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,--------------. ,--------------.
|
||||
* |Alt/Ap| Win | | Alt |Ctl/Esc|
|
||||
@@ -247,7 +228,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
TG(DVORAK), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLASH,
|
||||
KC_H, KC_J, KC_K, KC_L, KC_SCOLON, GUI_T(KC_QUOTE),
|
||||
TG(COLEMAK), KC_N, KC_M, KC_COMMA, KC_DOT, CTL_T(KC_SLASH),KC_RSHIFT,
|
||||
KC_FN1, KC_LEFT, KC_UP, KC_DOWN, KC_RIGHT,
|
||||
KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_FN1,
|
||||
KC_LALT, CTL_T(KC_ESCAPE),
|
||||
KC_PGUP,
|
||||
KC_PGDOWN, KC_DELETE, KC_ENTER
|
||||
@@ -281,16 +262,16 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
KC_DELT, KC_Q, KC_W, KC_F, KC_P, KC_G, TG(DIABLO),
|
||||
KC_BSPC, KC_A, KC_R, KC_S, KC_T, KC_D,
|
||||
KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, TG(OVERWATCH),
|
||||
LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LBRACKET,KC_RBRACKET,
|
||||
LT(SYMB,KC_GRV),KC_QUOT, KC_LGUI, KC_LBRACKET,KC_RBRACKET,
|
||||
ALT_T(KC_APP), KC_LGUI,
|
||||
KC_HOME,
|
||||
KC_SPC,KC_BSPC,KC_END,
|
||||
// right hand
|
||||
KC_TRANSPARENT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,
|
||||
KC_NO, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSLS,
|
||||
KC_TRNS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,
|
||||
KC_NO, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSLS,
|
||||
KC_H, KC_N, KC_E, KC_I, LT(MOUS, KC_O), KC_QUOTE,
|
||||
KC_TRANSPARENT,KC_K, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLASH),KC_RSHIFT,
|
||||
KC_FN1, KC_LEFT, KC_UP, KC_DOWN, KC_RIGHT,
|
||||
KC_TRNS,KC_K,KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLASH),KC_RSHIFT,
|
||||
KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_FN1,
|
||||
KC_LALT, CTL_T(KC_ESC),
|
||||
KC_PGUP,
|
||||
KC_PGDN,KC_TAB, KC_ENT
|
||||
@@ -324,16 +305,16 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
KC_DELT, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, TG(DIABLO),
|
||||
KC_BSPC, KC_A, KC_O, KC_E, KC_U, KC_I,
|
||||
KC_LSFT, CTL_T(KC_SCLN), KC_Q, KC_J, KC_K, KC_X, TG(OVERWATCH),
|
||||
LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LBRACKET,KC_RBRACKET,
|
||||
LT(SYMB,KC_GRV),KC_QUOT, KC_LGUI, KC_LBRACKET, KC_RBRACKET,
|
||||
ALT_T(KC_APP), KC_LGUI,
|
||||
KC_HOME,
|
||||
KC_SPC,KC_BSPC,KC_END,
|
||||
// right hand
|
||||
KC_TRANSPARENT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS,
|
||||
KC_TRANSPARENT, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH,
|
||||
KC_TRNS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS,
|
||||
KC_TRNS, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH,
|
||||
KC_D, KC_H, KC_T, KC_N, LT(MOUS, KC_S), KC_MINS,
|
||||
KC_NO,KC_B, KC_M, KC_W, KC_V, CTL_T(KC_Z), KC_RSHIFT,
|
||||
KC_FN1, KC_LEFT, KC_UP, KC_DOWN, KC_RIGHT,
|
||||
KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_FN1,
|
||||
KC_LALT, CTL_T(KC_ESC),
|
||||
KC_PGUP,
|
||||
KC_PGDN,KC_TAB, KC_ENT
|
||||
@@ -347,43 +328,43 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
* | VERSION| ! | @ | { | } | | | | | | + | 7 | 8 | 9 | * | F12 |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | MAKE | # | $ | ( | ) | ` |------| |------| - | 4 | 5 | 6 | / | PrtSc |
|
||||
* |--------+------+------+------+------+------| COVE | | |------+------+------+------+------+--------|
|
||||
* | RESET | % | ^ | [ | ] | ~ | CUBE | | | NUM | 1 | 2 | 3 | = | PAUSE |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | RESET | % | ^ | [ | ] | ~ | | | | NUM | 1 | 2 | 3 | = | PAUSE |
|
||||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||
* | LT0 | & | * | : | ; | | 0 | 0 | NUM. | ENT | ENT |
|
||||
* | LT0 | & | * | : | ; | | | 0 | NUM. | ENT | ENT |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* | RGBM | RED | | OFF | SOLID|
|
||||
* ,------|------|------| |------+------+------.
|
||||
* | | | GREEN| | | | |
|
||||
* | RGB | RGB |------| |------| NUM. | NUM0 |
|
||||
* | RGB | RGB |------| |------| NUM0 | NUME |
|
||||
* | DARK |BRITE | BLUE | | | | |
|
||||
* `--------------------' `--------------------'
|
||||
*/
|
||||
[SYMB] = KEYMAP(
|
||||
KC_ESCAPE,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRANSPARENT,
|
||||
M_VERSION, KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_PIPE, KC_TRANSPARENT,
|
||||
KC_ESCAPE,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS,
|
||||
M_VERSION, KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_PIPE, KC_TRNS,
|
||||
M_MAKE, KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_GRAVE,
|
||||
TD(TD_FLSH), KC_PERC, KC_CIRC, KC_LBRACKET,KC_RBRACKET,KC_TILD, M_COVECUBE,
|
||||
TD(TD_FLSH), KC_PERC, KC_CIRC, KC_LBRACKET,KC_RBRACKET,KC_TILD, KC_TRNS,
|
||||
KC_NO, KC_AMPR, KC_ASTR, KC_COLN, KC_SCOLON,
|
||||
RGB_MOD, RGB_0000FF,
|
||||
RGB_008000,
|
||||
RGB_VAD, RGB_VAI, RGB_FF0000,
|
||||
KC_TRNS, KC_TRNS,
|
||||
KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
|
||||
KC_TRANSPARENT, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
|
||||
KC_TRANSPARENT, KC_KP_PLUS, KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_ASTERISK, KC_F12,
|
||||
KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
|
||||
KC_TRNS, KC_KP_PLUS, KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_ASTERISK, KC_F12,
|
||||
KC_KP_MINUS, KC_KP_4, KC_KP_5, KC_KP_6, KC_KP_SLASH,KC_PSCREEN,
|
||||
KC_TRANSPARENT, KC_NUMLOCK, KC_KP_1, KC_KP_2, KC_KP_3, KC_EQUAL, KC_PAUSE,
|
||||
KC_KP_0, KC_KP_0, KC_KP_DOT, KC_KP_ENTER, KC_KP_ENTER,
|
||||
KC_TRNS, KC_NUMLOCK, KC_KP_1, KC_KP_2, KC_KP_3, KC_EQUAL, KC_PAUSE,
|
||||
KC_KP_0, KC_KP_0, KC_KP_DOT, KC_KP_ENTER, KC_TRNS,
|
||||
RGB_TOG, RGB_SLD,
|
||||
RGB_HUI,
|
||||
RGB_HUD, KC_KP_DOT, KC_KP_0
|
||||
KC_NO,
|
||||
KC_KP_DOT, KC_KP_0, KC_KP_ENTER
|
||||
),
|
||||
|
||||
/* Keymap 4: Customized Overwatch Layout
|
||||
*
|
||||
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||
* | ESC | SALT | SYMM | MORE | DOOM | | | | | F9 | F10 | F11 | F12 | | |
|
||||
* | ESC | SALT | MORE | GG | SYMM | DOOM | HARD | | | F9 | F10 | F11 | F12 | | |
|
||||
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||
* | F1 | K | Q | W | E | R | T | | | | | | | | |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
@@ -402,10 +383,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
* `--------------------' `--------------------'
|
||||
*/
|
||||
[OVERWATCH] = KEYMAP(
|
||||
KC_ESCAPE, M_SALT, M_SYMM, M_MORESALT, M_DOOMFIST, KC_NO, KC_NO,
|
||||
KC_ESCAPE, M_SALT, M_MORESALT, M_GOODGAME, M_SYMM, M_DOOMFIST, M_HARD,
|
||||
KC_F1, KC_K, KC_Q, KC_W, KC_E, KC_R, KC_T,
|
||||
KC_TAB, KC_G, KC_A, KC_S, KC_D, KC_F,
|
||||
KC_LCTL, KC_LSHIFT, KC_Z, KC_X, KC_C, KC_M, KC_TRANSPARENT,
|
||||
KC_LCTL, KC_LSHIFT, KC_Z, KC_X, KC_C, KC_M, KC_TRNS,
|
||||
KC_G, KC_U, KC_I, KC_Y, KC_T,
|
||||
KC_O, KC_P,
|
||||
KC_LGUI,
|
||||
@@ -444,10 +425,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
*/
|
||||
[DIABLO] = KEYMAP(
|
||||
KC_ESCAPE, KC_V, KC_D, KC_LALT, KC_NO, KC_NO, KC_NO,
|
||||
KC_TAB, KC_S, KC_I, KC_F, KC_M, KC_T, KC_TRANSPARENT,
|
||||
KC_TAB, KC_S, KC_F, KC_I, KC_M, KC_T, KC_TRNS,
|
||||
KC_Q, KC_1, KC_2, KC_3, KC_4, KC_G,
|
||||
KC_NUMLOCK, KC_KP_1, KC_KP_2, KC_KP_3, KC_KP_4, KC_Z, KC_NO,
|
||||
KC_LCTL, TD(TD_DIABLO_1), TD(TD_DIABLO_2), TD(TD_DIABLO_3), TD(TD_DIABLO_4),
|
||||
KC_LCTL, TD(TD_DIABLO_1), TD(TD_DIABLO_2), TD(TD_DIABLO_3), TD(TD_DIABLO_4), KC_Z, KC_NO,
|
||||
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
|
||||
KC_L, KC_J,
|
||||
KC_F,
|
||||
SFT_T(KC_SPACE), ALT_T(KC_Q), KC_DIABLO_CLEAR,
|
||||
@@ -485,19 +466,19 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
* `--------------------' `--------------------'
|
||||
*/
|
||||
[MOUS] = KEYMAP(
|
||||
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRANSPARENT,
|
||||
KC_NO, KC_NO, KC_MS_UP, KC_NO, KC_NO, KC_NO, KC_TRANSPARENT,
|
||||
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS,
|
||||
KC_NO, KC_NO, KC_MS_UP, KC_NO, KC_NO, KC_NO, KC_TRNS,
|
||||
KC_NO, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT,KC_NO, KC_NO,
|
||||
KC_NO, KC_MS_ACCEL0,KC_MS_ACCEL1,KC_MS_ACCEL2,KC_NO, KC_NO, KC_TRANSPARENT,
|
||||
KC_NO, KC_MS_ACCEL0,KC_MS_ACCEL1,KC_MS_ACCEL2,KC_NO, KC_NO, KC_TRNS,
|
||||
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
|
||||
KC_NO,KC_NO,
|
||||
KC_MS_WH_UP,
|
||||
KC_MS_BTN1,KC_MS_BTN2,KC_MS_WH_DOWN,
|
||||
|
||||
KC_TRANSPARENT,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,
|
||||
KC_TRANSPARENT,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,
|
||||
KC_TRNS,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,
|
||||
KC_TRNS,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,
|
||||
KC_NO,KC_NO,KC_MS_ACCEL0,KC_MS_ACCEL1,KC_MS_ACCEL2,KC_NO,KC_NO,
|
||||
KC_TRANSPARENT,KC_MEDIA_PLAY_PAUSE,KC_MEDIA_STOP,KC_AUDIO_MUTE,KC_AUDIO_VOL_DOWN,KC_AUDIO_VOL_UP,KC_NO,
|
||||
KC_TRNS,KC_MEDIA_PLAY_PAUSE,KC_MEDIA_STOP,KC_AUDIO_MUTE,KC_AUDIO_VOL_DOWN,KC_AUDIO_VOL_UP,KC_NO,
|
||||
KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,
|
||||
KC_NO,KC_NO,
|
||||
KC_NO,
|
||||
@@ -509,10 +490,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
const uint16_t PROGMEM fn_actions[] = {
|
||||
[1] = ACTION_LAYER_TAP_TOGGLE(SYMB),
|
||||
// FN1 - Momentary Layer 1 (Symbols)
|
||||
[2] = ACTION_MODS_TAP_KEY(MOD_RCTL, KC_UP),
|
||||
[3] = ACTION_MODS_TAP_KEY(MOD_RGUI, KC_LEFT),
|
||||
[4] = ACTION_MODS_TAP_KEY(MOD_RALT, KC_DOWN),
|
||||
[5] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_RIGHT),
|
||||
};
|
||||
|
||||
void action_function(keyrecord_t *event, uint8_t id, uint8_t opt)
|
||||
@@ -547,13 +524,12 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
||||
case 4:
|
||||
if (record->event.pressed) {
|
||||
// make ergodox-ez-drashna-custom-teensy
|
||||
return MACRO( I(5), T(M), T(A), T(K), T(E), T(SPACE), T(E), T(R), T(G), T(O), T(D), T(O), T(X), T(MINUS), T(E), T(Z), T(MINUS), T(D), T(R), T(A), T(S), T(H), T(N), T(A), T(MINUS), T(C), T(U), T(S), T(T), T(O), T(M), T(MINUS), T(T), T(E), T(E), T(N), T(S), T(Y), T(ENTER), END );
|
||||
return MACRO(I(5), T(M), T(A), T(K), T(E), T(SPACE), T(E), T(R), T(G), T(O), T(D), T(O), T(X), D(LSFT), T(MINUS), U(LSFT), T(E), T(Z), T(MINUS), T(D), T(R), T(A), T(S), T(H), T(N), T(A), T(MINUS), T(C), T(U), T(S), T(T), T(O), T(M), T(MINUS), T(T), T(E), T(E), T(N), T(S), T(Y), T(ENTER), END);
|
||||
}
|
||||
case 5:
|
||||
if (record->event.pressed) {
|
||||
//super secret hash
|
||||
SEND_STRING("supersecrethash");
|
||||
return MACRO_NONE;
|
||||
//gg
|
||||
return MACRO(I(50), T(ENTER), I(5), T(G), T(G), T(ENTER), END);
|
||||
}
|
||||
case 6:
|
||||
if (record->event.pressed) {
|
||||
@@ -562,40 +538,15 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
if (record->event.pressed) {
|
||||
// DoomFisted
|
||||
// Hey, look at me. I'm Doomfist, and I'm overpowered!
|
||||
// All I do is spam punches all day! I'm DPS, tank and
|
||||
// defense, rolled into one! All I need is team healing to be complete!
|
||||
return MACRO( I(50), T(ENTER), I(5), D(LSFT), T(H), U(LSFT), T(E), T(Y), T(COMMA), T(SPACE), T(L), T(O), T(O), T(K), T(SPACE), T(A), T(T), T(SPACE), T(M), T(E), T(DOT), T(SPACE), T(SPACE), D(LSFT), T(I), U(LSFT), T(QUOTE), T(M), T(SPACE), D(LSFT), T(D), U(LSFT), T(O), T(O), T(M), T(F), T(I), T(S), T(T), T(COMMA), T(SPACE), T(A), T(N), T(D), T(SPACE), D(LSFT), T(I), U(LSFT), T(QUOTE), T(M), T(SPACE), T(O), T(V), T(E), T(R), T(P), T(O), T(W), T(E), T(R), T(E), T(D), D(LSFT), T(1), U(LSFT), T(SPACE), T(SPACE), D(LSFT), T(A), U(LSFT), T(L), T(L), T(SPACE), D(LSFT), T(I), U(LSFT), T(SPACE), T(D), T(O), T(SPACE), T(I), T(S), T(SPACE), T(S), T(P), T(A), T(M), T(SPACE), T(P), T(U), T(N), T(C), T(H), T(E), T(S), T(SPACE), T(A), T(L), T(L), T(SPACE), T(D), T(A), T(Y), D(LSFT), T(1), U(LSFT), T(SPACE), T(SPACE), T(SPACE), D(LSFT), T(I), U(LSFT), T(QUOTE), T(M), T(SPACE), D(LSFT), T(D), U(LSFT), D(LSFT), T(P), U(LSFT), D(LSFT), T(S), U(LSFT), T(COMMA), T(SPACE), T(T), T(A), T(N), T(K), T(SPACE), T(A), T(N), T(D), T(SPACE), T(D), T(E), T(F), T(E), T(N), T(S), T(E), T(COMMA), T(SPACE), T(R), T(O), T(L), T(L), T(E), T(D), T(SPACE), T(I), T(N), T(T), T(O), T(SPACE), T(O), T(N), T(E), D(LSFT), T(1), U(LSFT), T(SPACE), D(LSFT), T(A), U(LSFT), T(L), T(L), T(SPACE), D(LSFT), T(I), U(LSFT), T(SPACE), T(N), T(E), T(E), T(D), T(SPACE), T(I), T(S), T(SPACE), T(T), T(E), T(A), T(M), T(SPACE), T(H), T(E), T(A), T(L), T(I), T(N), T(G), T(SPACE), T(T), T(O), T(SPACE), T(B), T(E), T(SPACE), T(C), T(O), T(M), T(P), T(L), T(E), T(T), T(E), D(LSFT), T(1), U(LSFT), T(ENTER), END );
|
||||
}
|
||||
case 8: //MAC1 - Hold for rshift and } on tap
|
||||
if (record->event.pressed) {
|
||||
key_timer = timer_read();
|
||||
return MACRO(D(LSFT), END );
|
||||
} else {
|
||||
return checktime() ? MACRO(U(LSFT),D(RALT),T(7),U(RALT),END): MACRO(U(LSFT),END);
|
||||
}; break;
|
||||
case 9: //MAC1 - Hold for rshift and } on tap
|
||||
if (record->event.pressed) {
|
||||
key_timer = timer_read();
|
||||
return MACRO(D(RSFT), END );
|
||||
} else {
|
||||
return checktime() ? MACRO(U(RSFT),D(RALT),T(0),U(RALT),END): MACRO(U(RSFT),END);
|
||||
}; break;
|
||||
case 10: //MAC2 - Hold for lctrl and [ on tap
|
||||
if (record->event.pressed) {
|
||||
key_timer = timer_read();
|
||||
return MACRO(D(LCTL), END );
|
||||
} else {return checktime() ? MACRO(U(LCTL),D(RALT),T(8),U(RALT),END):MACRO(U(LCTL),END);
|
||||
}; break;
|
||||
case 11: //MAC3 - Hold for rctrl and ] on tap
|
||||
if (record->event.pressed) {
|
||||
key_timer = timer_read();
|
||||
return MACRO(D(RCTL), END );
|
||||
} else {
|
||||
return checktime() ? MACRO(U(RCTL),D(RALT),T(9),U(RALT),END):MACRO(U(RCTL),END);
|
||||
}; break;
|
||||
if (record->event.pressed) {
|
||||
// DoomFisted
|
||||
// Hey, look at me. I'm Doomfist, and I'm overpowered!
|
||||
// All I do is spam punches all day! I'm DPS, tank and
|
||||
// defense, rolled into one! All I need is team healing to be complete!
|
||||
return MACRO( I(50), T(ENTER), I(5), D(LSFT), T(H), U(LSFT), T(E), T(Y), T(COMMA), T(SPACE), T(L), T(O), T(O), T(K), T(SPACE), T(A), T(T), T(SPACE), T(M), T(E), T(DOT), T(SPACE), T(SPACE), D(LSFT), T(I), U(LSFT), T(QUOTE), T(M), T(SPACE), D(LSFT), T(D), U(LSFT), T(O), T(O), T(M), T(F), T(I), T(S), T(T), T(COMMA), T(SPACE), T(A), T(N), T(D), T(SPACE), D(LSFT), T(I), U(LSFT), T(QUOTE), T(M), T(SPACE), T(O), T(V), T(E), T(R), T(P), T(O), T(W), T(E), T(R), T(E), T(D), D(LSFT), T(1), U(LSFT), T(SPACE), T(SPACE), D(LSFT), T(A), U(LSFT), T(L), T(L), T(SPACE), D(LSFT), T(I), U(LSFT), T(SPACE), T(D), T(O), T(SPACE), T(I), T(S), T(SPACE), T(S), T(P), T(A), T(M), T(SPACE), T(P), T(U), T(N), T(C), T(H), T(E), T(S), T(SPACE), T(A), T(L), T(L), T(SPACE), T(D), T(A), T(Y), D(LSFT), T(1), U(LSFT), T(SPACE), T(SPACE), T(SPACE), D(LSFT), T(I), U(LSFT), T(QUOTE), T(M), T(SPACE), D(LSFT), T(D), U(LSFT), D(LSFT), T(P), U(LSFT), D(LSFT), T(S), U(LSFT), T(COMMA), T(SPACE), T(T), T(A), T(N), T(K), T(SPACE), T(A), T(N), T(D), T(SPACE), T(D), T(E), T(F), T(E), T(N), T(S), T(E), T(COMMA), T(SPACE), T(R), T(O), T(L), T(L), T(E), T(D), T(SPACE), T(I), T(N), T(T), T(O), T(SPACE), T(O), T(N), T(E), D(LSFT), T(1), U(LSFT), T(SPACE), D(LSFT), T(A), U(LSFT), T(L), T(L), T(SPACE), D(LSFT), T(I), U(LSFT), T(SPACE), T(N), T(E), T(E), T(D), T(SPACE), T(I), T(S), T(SPACE), T(T), T(E), T(A), T(M), T(SPACE), T(H), T(E), T(A), T(L), T(I), T(N), T(G), T(SPACE), T(T), T(O), T(SPACE), T(B), T(E), T(SPACE), T(C), T(O), T(M), T(P), T(L), T(E), T(T), T(E), D(LSFT), T(1), U(LSFT), T(ENTER), END );
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
return MACRO_NONE;
|
||||
};
|
||||
@@ -677,7 +628,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case KC_DIABLO_CLEAR:
|
||||
case KC_DIABLO_CLEAR: // reset all Diable timers, disabling them
|
||||
if (record->event.pressed) {
|
||||
uint8_t dtime;
|
||||
|
||||
@@ -692,6 +643,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// Sends the key press to system, but only if on the Diablo layer
|
||||
void send_diablo_keystroke (uint8_t diablo_key) {
|
||||
if (current_layer == DIABLO) {
|
||||
switch (diablo_key) {
|
||||
@@ -711,6 +664,8 @@ void send_diablo_keystroke (uint8_t diablo_key) {
|
||||
}
|
||||
}
|
||||
|
||||
// Checks each of the 4 timers/keys to see if enough time has elapsed
|
||||
// Runs the "send string" command if enough time has passed, and resets the timer.
|
||||
void run_diablo_macro_check(void) {
|
||||
uint8_t dtime;
|
||||
|
||||
@@ -724,32 +679,7 @@ void run_diablo_macro_check(void) {
|
||||
}
|
||||
|
||||
void matrix_init_user(void) { // Runs boot tasks for keyboard
|
||||
wait_ms(500);
|
||||
ergodox_board_led_on();
|
||||
wait_ms(200);
|
||||
ergodox_right_led_1_on();
|
||||
wait_ms(200);
|
||||
ergodox_right_led_2_on();
|
||||
wait_ms(200);
|
||||
ergodox_right_led_3_on();
|
||||
wait_ms(200);
|
||||
ergodox_board_led_off();
|
||||
wait_ms(200);
|
||||
ergodox_right_led_1_off();
|
||||
wait_ms(200);
|
||||
ergodox_right_led_2_off();
|
||||
wait_ms(200);
|
||||
ergodox_right_led_3_off();
|
||||
|
||||
|
||||
#ifdef LAYER_UNDERGLOW_LIGHTING
|
||||
rgblight_enable();
|
||||
rgblight_sethsv(195,255,255);
|
||||
#endif
|
||||
has_layer_changed = false;
|
||||
|
||||
|
||||
|
||||
has_layer_changed = true;
|
||||
};
|
||||
|
||||
|
||||
@@ -764,6 +694,9 @@ void matrix_scan_user(void) { // runs frequently to update info
|
||||
ergodox_right_led_2_off();
|
||||
ergodox_right_led_3_off();
|
||||
|
||||
// Since we're not using the LEDs here for layer indication anymore,
|
||||
// then lets use them for modifier indicators. Shame we don't have 4...
|
||||
// Also, no "else", since we want to know each, independantly.
|
||||
if ( modifiders & MODS_SHIFT_MASK) {
|
||||
ergodox_right_led_1_on();
|
||||
}
|
||||
@@ -775,93 +708,61 @@ void matrix_scan_user(void) { // runs frequently to update info
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Check layer, and apply color if its changed since last check
|
||||
switch (layer) {
|
||||
case SYMB:
|
||||
#ifdef LAYER_UNDERGLOW_LIGHTING
|
||||
if (has_layer_changed) {
|
||||
rgblight_sethsv (240,255,255);
|
||||
}
|
||||
#else
|
||||
ergodox_right_led_3_on();
|
||||
#endif
|
||||
break;
|
||||
case OVERWATCH:
|
||||
#ifdef LAYER_UNDERGLOW_LIGHTING
|
||||
if (has_layer_changed) {
|
||||
rgblight_sethsv (30,255,255);
|
||||
}
|
||||
#else
|
||||
ergodox_right_led_2_on();
|
||||
#endif
|
||||
break;
|
||||
case DIABLO:
|
||||
#ifdef LAYER_UNDERGLOW_LIGHTING
|
||||
if (has_layer_changed) {
|
||||
rgblight_sethsv (0,255,255);
|
||||
}
|
||||
#else
|
||||
ergodox_right_led_1_on();
|
||||
#endif
|
||||
break;
|
||||
case MOUS:
|
||||
#ifdef LAYER_UNDERGLOW_LIGHTING
|
||||
if (has_layer_changed) {
|
||||
rgblight_sethsv (60,255,255);
|
||||
}
|
||||
#else
|
||||
ergodox_right_led_3_on();
|
||||
ergodox_right_led_2_on();
|
||||
#endif
|
||||
break;
|
||||
case COLEMAK:
|
||||
#ifdef LAYER_UNDERGLOW_LIGHTING
|
||||
if (has_layer_changed) {
|
||||
rgblight_sethsv (300,255,255);
|
||||
}
|
||||
#else
|
||||
ergodox_right_led_1_on();
|
||||
ergodox_right_led_3_on();
|
||||
#endif
|
||||
break;
|
||||
case DVORAK:
|
||||
#ifdef LAYER_UNDERGLOW_LIGHTING
|
||||
if (has_layer_changed) {
|
||||
rgblight_sethsv (120,255,255);
|
||||
}
|
||||
#else
|
||||
ergodox_right_led_2_on();
|
||||
ergodox_right_led_1_on();
|
||||
#endif
|
||||
break;
|
||||
case 7:
|
||||
#ifdef LAYER_UNDERGLOW_LIGHTING
|
||||
if (has_layer_changed) {
|
||||
rgblight_sethsv (255,255,255);
|
||||
}
|
||||
#else
|
||||
ergodox_right_led_1_on();
|
||||
ergodox_right_led_2_on();
|
||||
ergodox_right_led_3_on();
|
||||
#endif
|
||||
break;
|
||||
case OVERWATCH:
|
||||
if (has_layer_changed) {
|
||||
rgblight_sethsv (30,255,255);
|
||||
}
|
||||
break;
|
||||
case DIABLO:
|
||||
if (has_layer_changed) {
|
||||
rgblight_sethsv (0,255,255);
|
||||
}
|
||||
break;
|
||||
case MOUS:
|
||||
if (has_layer_changed) {
|
||||
rgblight_sethsv (60,255,255);
|
||||
}
|
||||
break;
|
||||
case COLEMAK:
|
||||
if (has_layer_changed) {
|
||||
rgblight_sethsv (300,255,255);
|
||||
}
|
||||
break;
|
||||
case DVORAK:
|
||||
if (has_layer_changed) {
|
||||
rgblight_sethsv (120,255,255);
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
if (has_layer_changed) {
|
||||
rgblight_sethsv (255,255,255);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
// Do not add anything here, as this will be ran EVERY check, and can cause a significant slowdown
|
||||
#ifdef LAYER_UNDERGLOW_LIGHTING
|
||||
if (has_layer_changed) {
|
||||
rgblight_sethsv (195,255,255);
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// Update layer status at the end, so this sets the default color
|
||||
// rather than relying on the init, which was unreliably...
|
||||
// Probably due to a timing issue, but this requires no additional code
|
||||
if (current_layer == layer) {
|
||||
has_layer_changed = false;
|
||||
} else {
|
||||
has_layer_changed = true;
|
||||
current_layer = layer;
|
||||
}
|
||||
|
||||
// Run Diablo 3 macro checking code.
|
||||
run_diablo_macro_check();
|
||||
};
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
RGBLIGHT_ENABLE = yes
|
||||
RGBLIGHT_ANIMATION = no
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../../Makefile
|
||||
endif
|
||||
RGBLIGHT_ENABLE = yes
|
||||
RGBLIGHT_ANIMATION = no
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../../Makefile
|
||||
endif
|
@@ -1,4 +1,4 @@
|
||||
#include "ergodox.h"
|
||||
#include QMK_KEYBOARD_H
|
||||
#include "debug.h"
|
||||
#include "action_layer.h"
|
||||
#include "version.h"
|
@@ -1,4 +1,4 @@
|
||||
#include "ergodox.h"
|
||||
#include QMK_KEYBOARD_H
|
||||
#include "debug.h"
|
||||
#include "action_layer.h"
|
||||
#include "version.h"
|
@@ -1,4 +1,4 @@
|
||||
#include "ergodox.h"
|
||||
#include QMK_KEYBOARD_H
|
||||
#include "debug.h"
|
||||
#include "action_layer.h"
|
||||
#include "sendchar.h"
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user