Compare commits

...
9 Commits
Author SHA1 Message Date
Samuel Jahnke d04485e32c Add samuel's literate keymap file for planck (#4998)
* added my own keymap

* changed thing

* updated keymap Samuel

* updated laypout for better one handed use

* updated stuff I want

* happy with my lagout

* formatting

* Added new literate config

* made everything nice

* cleaned

* fixed spelling and two small bugs in macros

* Made press and lift function for modifiers
2019-02-15 06:49:02 -08:00
zvecr f61c99fdda Remove duplication of ssh keys and fix usage on PR builds (#5013) 2019-02-15 06:47:47 -08:00
Konstantin Đorđević cd369b7107 docker_build.sh: Run container in interactive mode (#5088)
* docker_build.sh: Run container in interactive mode

* Add message about QMK Toolbox

* Update Docker docs
2019-02-15 06:46:42 -08:00
Drashna Jaelre cc146e32dc Improve RGB Light code (#4326)
* Improve RGB Light code

* Add is_rgblight_initialized as an externed value in rgblight.h

* Use remander of hue
2019-02-15 06:37:44 -08:00
Shihpin Tseng 68fad7b777 Enable custom chibios sub-platform 2019-02-14 21:06:26 -08:00
fauxpark 7c2bee8b88 Swap KBD75 caps lock LED pin levels (#5132) 2019-02-14 21:01:40 -08:00
Ben 1e1b55fbdf Improve Encoder documentation (#5130) 2019-02-14 21:00:57 -08:00
Konstantin Đorđević d7754a19b9 Remove problematic unicode_map stub definition in process_unicodemap.c (#5110)
* Remove problematic unicode_map stub definition in process_unicodemap.c

* Add unicode_map declaration to process_unicodemap.h

* Disable UNICODEMAP on converter boards that don't use it
2019-02-14 20:55:31 -08:00
fauxpark 3a3de84e40 Tweak issue templates (capitalisation mostly) (#5133)
* Tweak issue templates (capitalisation mostly)

* Consistent headings
2019-02-14 20:44:27 -08:00
23 changed files with 799 additions and 88 deletions

No files matched your search

+16 -15
View File
@@ -2,30 +2,31 @@
name: Bug report name: Bug report
about: Create a report to help us improve the QMK Firmware about: Create a report to help us improve the QMK Firmware
--- ---
<!-- Provide a general summary of the bug in the Title above --> <!-- Provide a general summary of the bug in the title above. -->
<!-- This template is entirely option and can be removed, but is here to help both you and us. --> <!--- This template is entirely optional and can be removed, but is here to help both you and us. -->
<!-- This text and anything on lines wrapped like this one will not show up in the final text. This text is to help us and you. --> <!--- Anything on lines wrapped in comments like these will not show up in the final text. -->
**Describe the bug** ## Describe the Bug
<!-- A clear and concise description of what the bug is. --> <!-- A clear and concise description of what the bug is. -->
**System Information** ## System Information
- Keyboard: - Keyboard:
- Revision (if applicable): - Revision (if applicable):
- Operating System: - Operating system:
- avr-gcc version: - AVR GCC version:
<!-- Run `avr-gcc --version` to find out --> <!-- Run `avr-gcc --version` to find this out. -->
- arm gcc version: - ARM GCC version:
<!-- Run `arm-none-eabi-gcc --version` to find out --> <!-- Run `arm-none-eabi-gcc --version` to find this out. -->
- QMK Firmware version: - QMK Firmware version:
<!-- You can run `git describe --abbrev=0 --tags` to find this out --> <!-- Run `git describe --abbrev=0 --tags` to find this out. -->
- Any keyboard related software installed? - Any keyboard related software installed?
- [ ] Auto Hot Key - [ ] AutoHotKey
- [ ] Karabiner - [ ] Karabiner
- [ ] Other - [ ] Other:
**Additional context** ## Additional Context
<!-- Add any other context about the problem here. --> <!-- Add any other relevant information about the problem here. -->
+8 -8
View File
@@ -2,18 +2,18 @@
name: Feature request name: Feature request
about: Suggest a new feature or changes to existing features about: Suggest a new feature or changes to existing features
--- ---
<!--- Provide a general summary of the changes you want in the Title above --> <!--- Provide a general summary of the changes you want in the title above. -->
<!-- This template is entirely option and can be removed, but is here to help both you and us. --> <!--- This template is entirely optional and can be removed, but is here to help both you and us. -->
<!-- This text and anything on lines wrapped like this one will not show up in the final text. This text is to help us and you. --> <!--- Anything on lines wrapped in comments like these will not show up in the final text. -->
## Feature Request Type ## Feature Request Type
- [ ] Core Functionality - [ ] Core functionality
- [ ] Add-on hardware support (e.g. audio, RGB, OLED screen, etc.) - [ ] Add-on hardware support (eg. audio, RGB, OLED screen, etc.)
- [ ] Alteration (enhancement/optimization) of existing Feature(s) - [ ] Alteration (enhancement/optimization) of existing feature(s)
- [ ] New behavior - [ ] New behavior
## Description ## Description
<!-- A few sentences describing what it is that you'd like to see. Additional information (such as links to spec sheets, licensing info, other related issues or PR's, etc) would be helpful. --> <!-- A few sentences describing what it is that you'd like to see in QMK. Additional information (such as links to spec sheets, licensing info, other related issues or PRs, etc) would be helpful. -->
+3 -3
View File
@@ -2,8 +2,8 @@
name: Other issues name: Other issues
about: Anything else that doesn't fall into the above categories. about: Anything else that doesn't fall into the above categories.
--- ---
<!--- Provide a general summary of the changes you want in the Title above --> <!--- Provide a general summary of the changes you want in the title above. -->
<!-- This text and anything on lines wrapped like this one will not show up in the final text. This text is to help us and you. --> <!--- Anything on lines wrapped in comments like these will not show up in the final text. -->
<!-- Please check https://docs.qmk.fm/#/support for additional resources first. If that doesn't answer your question, check the bug report option, as that may be more appropriate. --> <!-- Please check https://docs.qmk.fm/#/support for additional resources first. If that doesn't answer your question, choose the bug report template instead, as that may be more appropriate. -->
+15 -13
View File
@@ -1,32 +1,34 @@
<!--- Provide a general summary of your changes in the Title above --> <!--- Provide a general summary of your changes in the title above. -->
<!--- This template is entirely option and can be removed, but is here to help both you and us. --> <!--- This template is entirely optional and can be removed, but is here to help both you and us. -->
<!--- This text and anything on lines wrapped like this one will not show up in the final text. This text is to help us and you. --> <!--- Anything on lines wrapped in comments like these will not show up in the final text. -->
## Description ## Description
<!--- Describe your changes in detail -->
## Types of changes <!--- Describe your changes in detail here. -->
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
## Types of Changes
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply. -->
- [ ] Core - [ ] Core
- [ ] Bugfix - [ ] Bugfix
- [ ] New Feature - [ ] New feature
- [ ] Enhancement/Optimization - [ ] Enhancement/optimization
- [ ] Keyboard (addition or update) - [ ] Keyboard (addition or update)
- [ ] Keymap/Layout/Userspace (addition or update) - [ ] Keymap/layout/userspace (addition or update)
- [ ] Documentation - [ ] Documentation
## Issues Fixed or Closed by This PR
## Issues Fixed or Closed by this PR
* *
## Checklist: ## Checklist
<!--- Go over all the following points, and put an `x` in all the boxes that apply. --> <!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> <!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
- [ ] My code follows the code style of this project. - [ ] My code follows the code style of this project.
- [ ] My change requires a change to the documentation. - [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly. - [ ] I have updated the documentation accordingly.
- [ ] I have read the **CONTRIBUTING** document. (https://docs.qmk.fm/#/contributing) - [ ] I have read the [**CONTRIBUTING** document](https://docs.qmk.fm/#/contributing).
- [ ] I have added tests to cover my changes. - [ ] I have added tests to cover my changes.
- [ ] I have tested the changes and verified that they work and don't break anything (as well as I can manage). - [ ] I have tested the changes and verified that they work and don't break anything (as well as I can manage).
+1 -1
View File
@@ -38,7 +38,7 @@ or `keymap.c`:
} else { } else {
tap_code(KC_PGUP); tap_code(KC_PGUP);
} }
} else if (index == 2) { } else if (index == 1) { /* Second encoder
if (clockwise) { if (clockwise) {
tap_code(KC_UP); tap_code(KC_UP);
} else { } else {
+4 -4
View File
@@ -129,12 +129,12 @@ If you have trouble and want to ask for help, it is useful to generate a *Win_Ch
## Docker ## Docker
If this is a bit complex for you, Docker might be the turn-key solution you need. After installing [Docker CE](https://docs.docker.com/install/#supported-platforms), run the following command from the `qmk_firmware` directory to build a keyboard/keymap: If this is a bit complex for you, Docker might be the turnkey solution you need. After installing [Docker CE](https://docs.docker.com/install/#supported-platforms), run the following command from the `qmk_firmware` directory to build a keyboard/keymap:
```bash ```bash
util/docker_build.sh keyboard:keymap util/docker_build.sh keyboard:keymap
# For example: util/docker_build.sh ergodox_ez:steno # For example: util/docker_build.sh ergodox_ez:steno
``` ```
This will compile the targeted keyboard/keymap and leave the resulting `.hex` or `.bin` file in the QMK directory for you to flash. If `:keymap` is omitted, the `default` keymap is used. Note that the parameter format is the same as when building with `make`. This will compile the desired keyboard/keymap and leave the resulting `.hex` or `.bin` file in the QMK directory for you to flash. If `:keymap` is omitted, the `default` keymap is used. Note that the parameter format is the same as when building with `make`.
You can also start the script without any parameters, in which case it will ask you to input the build parameters one by one, which you may find easier to use: You can also start the script without any parameters, in which case it will ask you to input the build parameters one by one, which you may find easier to use:
```bash ```bash
@@ -147,7 +147,7 @@ There is also support for building _and_ flashing the keyboard straight from Doc
util/docker_build.sh keyboard:keymap:target util/docker_build.sh keyboard:keymap:target
# For example: util/docker_build.sh planck/rev6:default:dfu-util # For example: util/docker_build.sh planck/rev6:default:dfu-util
``` ```
If you're on Linux, this should work out of the box. On Windows and macOS, it requires [Docker Machine](http://gw.tnode.com/docker/docker-machine-with-usb-support-on-windows-macos/) to be running. This is tedious to set up, so it's not recommended; use QMK Toolbox instead. If you're on Linux, this should work out of the box. On Windows and macOS, it requires [Docker Machine](http://gw.tnode.com/docker/docker-machine-with-usb-support-on-windows-macos/) to be running. This is tedious to set up, so it's not recommended; use [QMK Toolbox](https://github.com/qmk/qmk_toolbox) instead.
!> Docker for Windows requires [Hyper-V](https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/quick-start/enable-hyper-v) to be enabled. This means that it cannot work on versions of Windows which don't have Hyper-V, such as Windows 7, Windows 8 and **Windows 10 Home**. !> Docker for Windows requires [Hyper-V](https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/quick-start/enable-hyper-v) to be enabled. This means that it cannot work on versions of Windows which don't have Hyper-V, such as Windows 7, Windows 8 and **Windows 10 Home**.
@@ -12,9 +12,8 @@ BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
MIDI_ENABLE = no # MIDI controls MIDI_ENABLE = no # MIDI controls
AUDIO_ENABLE = no # Audio output on port C6 AUDIO_ENABLE = no # Audio output on port C6
UNICODE_ENABLE = no # Unicode UNICODE_ENABLE = no # Unicode
UNICODEMAP_ENABLE = yes
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
PS2_USE_USART = yes PS2_USE_USART = yes
API_SYSEX_ENABLE = no API_SYSEX_ENABLE = no
@@ -58,7 +58,6 @@ BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
MIDI_ENABLE = no # MIDI controls MIDI_ENABLE = no # MIDI controls
AUDIO_ENABLE = no # Audio output on port C6 AUDIO_ENABLE = no # Audio output on port C6
UNICODE_ENABLE = no # Unicode UNICODE_ENABLE = no # Unicode
UNICODEMAP_ENABLE = yes
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
PS2_USE_USART = yes PS2_USE_USART = yes
-1
View File
@@ -22,7 +22,6 @@ BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
MIDI_ENABLE = no # MIDI controls MIDI_ENABLE = no # MIDI controls
AUDIO_ENABLE = no # Audio output on port C6 AUDIO_ENABLE = no # Audio output on port C6
UNICODE_ENABLE = no # Unicode UNICODE_ENABLE = no # Unicode
UNICODEMAP_ENABLE = no
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
-1
View File
@@ -22,7 +22,6 @@ BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
MIDI_ENABLE = no # MIDI controls MIDI_ENABLE = no # MIDI controls
AUDIO_ENABLE = no # Audio output on port C6 AUDIO_ENABLE = no # Audio output on port C6
UNICODE_ENABLE = no # Unicode UNICODE_ENABLE = no # Unicode
UNICODEMAP_ENABLE = yes
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
+4 -4
View File
@@ -1,14 +1,14 @@
#include "rev1.h" #include "rev1.h"
void led_set_kb(uint8_t usb_led) { void led_set_kb(uint8_t usb_led) {
// put your keyboard LED indicator (ex: Caps Lock LED) toggling code here // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) {
writePinHigh(B2);
} else {
writePinLow(B2); writePinLow(B2);
} else {
writePinHigh(B2);
} }
led_set_user(usb_led); led_set_user(usb_led);
} }
void matrix_init_kb(void) { void matrix_init_kb(void) {
+4 -4
View File
@@ -1,14 +1,14 @@
#include "rev2.h" #include "rev2.h"
void led_set_kb(uint8_t usb_led) { void led_set_kb(uint8_t usb_led) {
// put your keyboard LED indicator (ex: Caps Lock LED) toggling code here // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) {
writePinHigh(B2);
} else {
writePinLow(B2); writePinLow(B2);
} else {
writePinHigh(B2);
} }
led_set_user(usb_led); led_set_user(usb_led);
} }
void matrix_init_kb(void) { void matrix_init_kb(void) {
+431
View File
@@ -0,0 +1,431 @@
#+Title: Samuel's Literate QMK Config
#+PROPERTY: header-args :tangle ~/qmk_firmware/keyboards/planck/keymaps/samuel/keymap.c
This is my qmk firmware for my keyboard. I grew tired of organizing the keycode
array in plain text so I made it a literate .org file. I've never done this
before, so bear with me.
* Keymap
#+BEGIN_COMMENT
#+NAME: empty-layer
| <6> | <6> | <6> | <6> | <6> | <6> | <6> | <6> | <6> | <6> | <6> | <6> |
|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
| - | - | - | - | - | - | - | - | - | - | - | - |
| - | - | - | - | - | - | - | - | - | - | - | - |
| - | - | - | - | - | - | - | - | - | - | - | - |
| - | - | - | - | - | - | - | - | - | - | - | - |
|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
#+END_COMMENT
This is my "pretty" org mode organized table for my main dvorak layer. If you
don't use org mode, it won't be that exiting, but if you enjoy working in org
mode, you can edit this table directly, and this file is tangled to the actual
keymap. No more organizing spaces or converting to and from comments.
#+NAME: home-layer
|--------+--------+------+------+------+-----+-----+-----+------+-------+--------+--------|
| T_LRSE | QUOT | COMM | DOT | P | Y | F | G | C | R | L | T_RRSE |
| T_LSFT | A | O | E | U | I | D | H | T | N | S | T_RSFT |
| T_LCTL | SCLN | Q | J | K | X | B | M | W | V | Z | T_RCTL |
| T_LGUI | T_LALT | UP | DOWN | BSPC | TAB | ENT | SPC | LEFT | RIGHT | T_RALT | T_RGUI |
|--------+--------+------+------+------+-----+-----+-----+------+-------+--------+--------|
I tried to keep my layout bare bones, just what would be available on a normal
keyboard, minus some keys I never used. The bottom left copies a normal
keyboards symbols from shifted numbers, and the rest is placed where convenient,
with some considerations for one handed use, hence the shortcuts in the top
left.
#+TODO: qwerty layer for ma friends
#+NAME: secondary-layer
|----+--------+--------+--------+--------+------+------+----+--------+--------+-----+----|
| -- | EZUNDO | EZCOPY | EZCUT | EZPSTE | INS | EQL | 7 | 8 | 9 | F11 | -- |
| -- | ESC | CAPS | PGUP | PGDN | F4 | ASTR | 4 | 5 | 6 | 0 | -- |
| -- | EXLM | AT | HASH | DLR | PERC | CIRC | 1 | 2 | 3 | F12 | -- |
| -- | -- | EZUP | EZDOWN | -- | AMPR | PIPE | -- | EZLEFT | EZRGHT | -- | -- |
|----+--------+--------+--------+--------+------+------+----+--------+--------+-----+----|
But wait, we are missing several important keys!? yes, well, the modifier keys
all do other keys when tapped. More about that in the keymap section.
* Keymap Conversion in Python
This python can convert that table into the array needed for the keymap file. It
simply prepends every key with "KC_". I used to use a dictionary to convert some
keys from the table into qmk keycodes, but the double convertion was
unneccessary so I simply prepended all my macros with KC and moved all the
implementation to the `process-user-input` function.
#+NAME:layer-to-array
#+BEGIN_SRC python :var keys=secondary-layer :tangle no
results = "{"
row = 0
while row < len(keys):
results += '{ '
key = 0
while key < len(keys[row]):
keyName = str(keys[row][key])
if keyName == '--':
keyName = 'TRANSPARENT'
results += 'KC_' + keyName
if key != 11:
results += ', '
key+=1
results += '}'
if row != 3:
results += ','
results += '\n'
row+=1
results += '},\n'
return results
#+END_SRC
* keymap.c
Now that we have done all the hard work, lets layout our keymap file then define
our macros.
** Headers And Layer Declaration
#+BEGIN_SRC C :noweb yes
#include QMK_KEYBOARD_H
extern keymap_config_t keymap_config;
static uint16_t tap_timers[10] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
char last_mod = -1;
enum planck_layers {
_DVORAK,
_RISE
};
// where the 'T_' communicates how the key does something different when tapped.
enum planck_keycodes {
DVORAK = SAFE_RANGE,
KC_T_LALT,
KC_T_RALT,
KC_T_LGUI,
KC_T_RGUI,
KC_T_LCTL,
KC_T_RCTL,
KC_T_LSFT,
KC_T_RSFT,
KC_T_LRSE,
KC_T_RRSE,
KC_EZRGHT,
KC_EZLEFT,
KC_EZUP,
KC_EZDOWN,
KC_EZUNDO,
KC_EZCOPY,
KC_EZCUT,
KC_EZPSTE
};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
#+END_SRC
** Import Key table
#+BEGIN_SRC C :noweb yes
[_DVORAK] =
#+END_SRC
#+BEGIN_SRC C :noweb yes
<<layer-to-array(home-layer)>>
#+END_SRC
#+BEGIN_SRC C :noweb yes
[_RISE] =
#+END_SRC
#+BEGIN_SRC C :noweb yes
<<layer-to-array(secondary-layer)>>
#+END_SRC
** Process User Input
*** Tap Key Functionality
These methods define how I implemented the tap mechanic. Basically, I believe
that /pressing/ any other key should be grounds for the hold functionality to be
assumed. My natuaral typing style experiences no delays from my method.
#+BEGIN_SRC C :noweb yes
};
void mod_press(uint16_t hold_code, int id) {
tap_timers[id] = timer_read();
last_mod = id;
register_code(hold_code);
}
void mod_lift(uint16_t tap_code, uint16_t hold_code, int id) {
unregister_code(hold_code);
if (last_mod == id && timer_elapsed(tap_timers[id]) < TAPPING_TERM) {
tap_code16(tap_code);
last_mod = -1;
}
}
#+END_SRC
*** Set DVORAK layout
The function that filter's user inputs and applies macros, the begginning is
pretty basic, setting our main layer and configuring our secondary layer.
#+BEGIN_SRC C :noweb yes
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case DVORAK:
if (record->event.pressed) {
set_single_persistent_default_layer(_DVORAK);
}
return false;
break;
#+END_SRC
*** Alt and ()
Left and right alt are ( and ) when tapped. I put them on alt instead of a more
conveniant key like control because parentheses do not need to be shift modified
ever, unlike some other tap keys seen in the next sections.
#+BEGIN_SRC C :noweb yes
case KC_T_LALT:
if (record->event.pressed) {
mod_press(KC_LALT, 0);
} else {
mod_lift(S(KC_9), KC_LALT, 0);
}
return false;
break;
case KC_T_RALT:
if (record->event.pressed) {
mod_press(KC_RALT, 1);
} else {
mod_lift(S(KC_0), KC_RALT, 1);
}
return false;
break;
#+END_SRC
*** Gui and `\
I place gui in the bottom corner because I believe it is the hardest key to
reach, so gui seemed like a good fit for a dedicated key that I never want to
have to spam. For tap keys, I used equally unused keys that are not apart of the
number pad or shifted number keys.
#+BEGIN_SRC C :noweb yes
case KC_T_LGUI:
if (record->event.pressed) {
mod_press(KC_LGUI, 2);
} else {
mod_lift(KC_GRAVE, KC_LGUI, 2);
}
return false;
break;
case KC_T_RGUI:
if (record->event.pressed) {
mod_press(KC_RGUI, 3);
} else {
mod_lift(KC_BSLASH, KC_RGUI, 3);
}
return false;
break;
#+END_SRC
*** Ctrl and []
Left and right control are [] respectively when they are tapped, making { and }
also very convenient.
#+BEGIN_SRC C :noweb yes
case KC_T_LCTL:
if (record->event.pressed) {
mod_press(KC_LCTL, 4);
} else {
mod_lift(KC_LBRACKET, KC_LCTL, 4);
}
return false;
break;
case KC_T_RCTL:
if (record->event.pressed) {
mod_press(KC_RCTL, 5);
} else {
mod_lift(KC_RBRACKET, KC_RCTL, 5);
}
return false;
break;
#+END_SRC
*** Shft and =-
I place shift on the home row, so having '-' right of my pinkie is standard, and
it only felt natural to put its opposite, '=/+' on the other side. I put an
extra one on the right side in the secondary layer for the num pad.
#+BEGIN_SRC C :noweb yes
case KC_T_LSFT:
if (record->event.pressed) {
mod_press(KC_LSFT, 6);
} else {
mod_lift(KC_EQUAL, KC_LSFT, 6);
}
return false;
break;
case KC_T_RSFT:
if (record->event.pressed) {
mod_press(KC_RSFT, 7);
} else {
mod_lift(KC_MINUS, KC_RSFT, 7);
}
return false;
break;
#+END_SRC
*** Rise, DEL, and /
I use the top corners as rise because I decided that I do not like using layers
with my thumbs. It feels uncomfortable to hold keys down with the side of my
thumb, and backspace, tab, enter, and spacebar keep them satisfied. My pinky is
for holding modifiers, so it makes sense to put the layer key with the other
modifiers. Both my left and right layer keys activate the same layer which also
makes sense to me. You wouldn't want left and right shift to do different things
I used to have escape in the top left, but I use delete a lot more, and putting
escape under a layer has not been a problem at all. I put / in the top right
corner again mimicing a standard dvorak keyboard.
#+BEGIN_SRC C :noweb yes
case KC_T_LRSE:
if (record->event.pressed) {
tap_timers[8] = timer_read();
last_mod = 8;
layer_on(_RISE);
} else {
layer_off(_RISE);
if (last_mod == 8 && timer_elapsed(tap_timers[8]) < TAPPING_TERM) {
tap_code16(KC_DELETE);
last_mod = -1;
}
}
return false;
break;
case KC_T_RRSE:
if (record->event.pressed) {
tap_timers[9] = timer_read();
last_mod = 9;
layer_on(_RISE);
} else {
layer_off(_RISE);
if (last_mod == 9 && timer_elapsed(tap_timers[9]) < TAPPING_TERM) {
tap_code16(KC_SLASH);
last_mod = -1;
}
}
return false;
break;
#+END_SRC
*** EZ keys
I use ctrl+shift+arrows keys a lot, so when the layer key is pressed they became
lazy versions of themselves with control and shift already pressed.
I also added undo, copy, paste, and cut to be easily available with only the
left hand like on a qwerty or colemek keyboard.
#+BEGIN_SRC C :noweb yes
case KC_EZRGHT:
if (record->event.pressed) {
register_code(KC_LCTL);
tap_code16(S(KC_RGHT));
unregister_code(KC_LCTL);
last_mod = -1;
}
return false;
break;
case KC_EZLEFT:
if (record->event.pressed) {
register_code(KC_LCTL);
tap_code16(S(KC_LEFT));
unregister_code(KC_LCTL);
last_mod = -1;
}
return false;
break;
case KC_EZDOWN:
if (record->event.pressed) {
register_code(KC_LCTL);
tap_code16(S(KC_DOWN));
unregister_code(KC_LCTL);
last_mod = -1;
}
return false;
break;
case KC_EZUP:
if (record->event.pressed) {
register_code(KC_LCTL);
tap_code16(S(KC_UP));
unregister_code(KC_LCTL);
last_mod = -1;
}
return false;
break;
case KC_EZUNDO:
if (record->event.pressed) {
tap_code16(C(KC_Z));
last_mod = -1;
}
return false;
break;
case KC_EZCOPY:
if (record->event.pressed) {
tap_code16(C(KC_C));
last_mod = -1;
}
return false;
break;
case KC_EZCUT:
if (record->event.pressed) {
tap_code16(C(KC_X));
last_mod = -1;
}
return false;
break;
case KC_EZPSTE:
if (record->event.pressed) {
tap_code16(C(KC_P));
last_mod = -1;
}
return false;
break;
#+END_SRC
*** Standard inputs interupt tap
Finally, if just a standard key is tapped, set the interupted flag.
#+BEGIN_SRC C :noweb yes
}
last_mod = -1;
return true;
}
#+END_SRC
+1
View File
@@ -0,0 +1 @@
#define TAPPING_TERM 250
+245
View File
@@ -0,0 +1,245 @@
#include QMK_KEYBOARD_H
extern keymap_config_t keymap_config;
static uint16_t tap_timers[10] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
char last_mod = -1;
enum planck_layers {
_DVORAK,
_RISE
};
// where the 'T_' communicates how the key does something different when tapped.
enum planck_keycodes {
DVORAK = SAFE_RANGE,
KC_T_LALT,
KC_T_RALT,
KC_T_LGUI,
KC_T_RGUI,
KC_T_LCTL,
KC_T_RCTL,
KC_T_LSFT,
KC_T_RSFT,
KC_T_LRSE,
KC_T_RRSE,
KC_EZRGHT,
KC_EZLEFT,
KC_EZUP,
KC_EZDOWN,
KC_EZUNDO,
KC_EZCOPY,
KC_EZCUT,
KC_EZPSTE
};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_DVORAK] =
{{ KC_T_LRSE, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_T_RRSE},
{ KC_T_LSFT, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_T_RSFT},
{ KC_T_LCTL, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_T_RCTL},
{ KC_T_LGUI, KC_T_LALT, KC_UP, KC_DOWN, KC_BSPC, KC_TAB, KC_ENT, KC_SPC, KC_LEFT, KC_RIGHT, KC_T_RALT, KC_T_RGUI}
},
[_RISE] =
{{ KC_TRANSPARENT, KC_EZUNDO, KC_EZCOPY, KC_EZCUT, KC_EZPSTE, KC_INS, KC_EQL, KC_7, KC_8, KC_9, KC_F11, KC_TRANSPARENT},
{ KC_TRANSPARENT, KC_ESC, KC_CAPS, KC_PGUP, KC_PGDN, KC_F4, KC_ASTR, KC_4, KC_5, KC_6, KC_0, KC_TRANSPARENT},
{ KC_TRANSPARENT, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_1, KC_2, KC_3, KC_F12, KC_TRANSPARENT},
{ KC_TRANSPARENT, KC_TRANSPARENT, KC_EZUP, KC_EZDOWN, KC_TRANSPARENT, KC_AMPR, KC_PIPE, KC_TRANSPARENT, KC_EZLEFT, KC_EZRGHT, KC_TRANSPARENT, KC_TRANSPARENT}
},
};
void mod_press(uint16_t hold_code, int id) {
tap_timers[id] = timer_read();
last_mod = id;
register_code(hold_code);
}
void mod_lift(uint16_t tap_code, uint16_t hold_code, int id) {
unregister_code(hold_code);
if (last_mod == id && timer_elapsed(tap_timers[id]) < TAPPING_TERM) {
tap_code16(tap_code);
last_mod = -1;
}
}
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case DVORAK:
if (record->event.pressed) {
set_single_persistent_default_layer(_DVORAK);
}
return false;
break;
case KC_T_LALT:
if (record->event.pressed) {
mod_press(KC_LALT, 0);
} else {
mod_lift(S(KC_9), KC_LALT, 0);
}
return false;
break;
case KC_T_RALT:
if (record->event.pressed) {
mod_press(KC_RALT, 1);
} else {
mod_lift(S(KC_0), KC_RALT, 1);
}
return false;
break;
case KC_T_LGUI:
if (record->event.pressed) {
mod_press(KC_LGUI, 2);
} else {
mod_lift(KC_GRAVE, KC_LGUI, 2);
}
return false;
break;
case KC_T_RGUI:
if (record->event.pressed) {
mod_press(KC_RGUI, 3);
} else {
mod_lift(KC_BSLASH, KC_RGUI, 3);
}
return false;
break;
case KC_T_LCTL:
if (record->event.pressed) {
mod_press(KC_LCTL, 4);
} else {
mod_lift(KC_LBRACKET, KC_LCTL, 4);
}
return false;
break;
case KC_T_RCTL:
if (record->event.pressed) {
mod_press(KC_RCTL, 5);
} else {
mod_lift(KC_RBRACKET, KC_RCTL, 5);
}
return false;
break;
case KC_T_LSFT:
if (record->event.pressed) {
mod_press(KC_LSFT, 6);
} else {
mod_lift(KC_EQUAL, KC_LSFT, 6);
}
return false;
break;
case KC_T_RSFT:
if (record->event.pressed) {
mod_press(KC_RSFT, 7);
} else {
mod_lift(KC_MINUS, KC_RSFT, 7);
}
return false;
break;
case KC_T_LRSE:
if (record->event.pressed) {
tap_timers[8] = timer_read();
last_mod = 8;
layer_on(_RISE);
} else {
layer_off(_RISE);
if (last_mod == 8 && timer_elapsed(tap_timers[8]) < TAPPING_TERM) {
tap_code16(KC_DELETE);
last_mod = -1;
}
}
return false;
break;
case KC_T_RRSE:
if (record->event.pressed) {
tap_timers[9] = timer_read();
last_mod = 9;
layer_on(_RISE);
} else {
layer_off(_RISE);
if (last_mod == 9 && timer_elapsed(tap_timers[9]) < TAPPING_TERM) {
tap_code16(KC_SLASH);
last_mod = -1;
}
}
return false;
break;
case KC_EZRGHT:
if (record->event.pressed) {
register_code(KC_LCTL);
tap_code16(S(KC_RGHT));
unregister_code(KC_LCTL);
last_mod = -1;
}
return false;
break;
case KC_EZLEFT:
if (record->event.pressed) {
register_code(KC_LCTL);
tap_code16(S(KC_LEFT));
unregister_code(KC_LCTL);
last_mod = -1;
}
return false;
break;
case KC_EZDOWN:
if (record->event.pressed) {
register_code(KC_LCTL);
tap_code16(S(KC_DOWN));
unregister_code(KC_LCTL);
last_mod = -1;
}
return false;
break;
case KC_EZUP:
if (record->event.pressed) {
register_code(KC_LCTL);
tap_code16(S(KC_UP));
unregister_code(KC_LCTL);
last_mod = -1;
}
return false;
break;
case KC_EZUNDO:
if (record->event.pressed) {
tap_code16(C(KC_Z));
last_mod = -1;
}
return false;
break;
case KC_EZCOPY:
if (record->event.pressed) {
tap_code16(C(KC_C));
last_mod = -1;
}
return false;
break;
case KC_EZCUT:
if (record->event.pressed) {
tap_code16(C(KC_X));
last_mod = -1;
}
return false;
break;
case KC_EZPSTE:
if (record->event.pressed) {
tap_code16(C(KC_P));
last_mod = -1;
}
return false;
break;
}
last_mod = -1;
return true;
}
@@ -17,9 +17,6 @@
#include "process_unicodemap.h" #include "process_unicodemap.h"
#include "process_unicode_common.h" #include "process_unicode_common.h"
__attribute__((weak))
const uint32_t PROGMEM unicode_map[] = {};
void register_hex32(uint32_t hex) { void register_hex32(uint32_t hex) {
bool onzerostart = true; bool onzerostart = true;
for(int i = 7; i >= 0; i--) { for(int i = 7; i >= 0; i--) {
@@ -19,5 +19,7 @@
#include "quantum.h" #include "quantum.h"
#include "process_unicode_common.h" #include "process_unicode_common.h"
extern const uint32_t PROGMEM unicode_map[];
void unicodemap_input_error(void); void unicodemap_input_error(void);
bool process_unicodemap(uint16_t keycode, keyrecord_t *record); bool process_unicodemap(uint16_t keycode, keyrecord_t *record);
+44 -2
View File
@@ -58,6 +58,7 @@ const uint16_t RGBLED_GRADIENT_RANGES[] PROGMEM = {360, 240, 180, 120, 90};
#endif #endif
rgblight_config_t rgblight_config; rgblight_config_t rgblight_config;
bool is_rgblight_initialized = false;
LED_TYPE led[RGBLED_NUM]; LED_TYPE led[RGBLED_NUM];
bool rgblight_timer_enabled = false; bool rgblight_timer_enabled = false;
@@ -123,6 +124,35 @@ void setrgb(uint8_t r, uint8_t g, uint8_t b, LED_TYPE *led1) {
(*led1).b = b; (*led1).b = b;
} }
void rgblight_check_config(void) {
/* Add some out of bound checks for RGB light config */
if (rgblight_config.mode < RGBLIGHT_MODE_STATIC_LIGHT) {
rgblight_config.mode = RGBLIGHT_MODE_STATIC_LIGHT;
}
else if (rgblight_config.mode > RGBLIGHT_MODES) {
rgblight_config.mode = RGBLIGHT_MODES;
}
if (rgblight_config.hue < 0) {
rgblight_config.hue = 0;
} else if (rgblight_config.hue > 360) {
rgblight_config.hue %= 360;
}
if (rgblight_config.sat < 0) {
rgblight_config.sat = 0;
} else if (rgblight_config.sat > 255) {
rgblight_config.sat = 255;
}
if (rgblight_config.val < 0) {
rgblight_config.val = 0;
} else if (rgblight_config.val > RGBLIGHT_LIMIT_VAL) {
rgblight_config.val = RGBLIGHT_LIMIT_VAL;
}
}
uint32_t eeconfig_read_rgblight(void) { uint32_t eeconfig_read_rgblight(void) {
#if defined(__AVR__) || defined(STM32_EEPROM_ENABLE) || defined(PROTOCOL_ARM_ATSAM) || defined(EEPROM_SIZE) #if defined(__AVR__) || defined(STM32_EEPROM_ENABLE) || defined(PROTOCOL_ARM_ATSAM) || defined(EEPROM_SIZE)
@@ -131,13 +161,14 @@ uint32_t eeconfig_read_rgblight(void) {
return 0; return 0;
#endif #endif
} }
void eeconfig_update_rgblight(uint32_t val) { void eeconfig_update_rgblight(uint32_t val) {
#if defined(__AVR__) || defined(STM32_EEPROM_ENABLE) || defined(PROTOCOL_ARM_ATSAM) || defined(EEPROM_SIZE) #if defined(__AVR__) || defined(STM32_EEPROM_ENABLE) || defined(PROTOCOL_ARM_ATSAM) || defined(EEPROM_SIZE)
if (eeconfig_read_rgblight() != val) { rgblight_check_config();
eeprom_update_dword(EECONFIG_RGBLIGHT, val); eeprom_update_dword(EECONFIG_RGBLIGHT, val);
}
#endif #endif
} }
void eeconfig_update_rgblight_default(void) { void eeconfig_update_rgblight_default(void) {
//dprintf("eeconfig_update_rgblight_default\n"); //dprintf("eeconfig_update_rgblight_default\n");
rgblight_config.enable = 1; rgblight_config.enable = 1;
@@ -148,6 +179,7 @@ void eeconfig_update_rgblight_default(void) {
rgblight_config.speed = 0; rgblight_config.speed = 0;
eeconfig_update_rgblight(rgblight_config.raw); eeconfig_update_rgblight(rgblight_config.raw);
} }
void eeconfig_debug_rgblight(void) { void eeconfig_debug_rgblight(void) {
dprintf("rgblight_config eprom\n"); dprintf("rgblight_config eprom\n");
dprintf("rgblight_config.enable = %d\n", rgblight_config.enable); dprintf("rgblight_config.enable = %d\n", rgblight_config.enable);
@@ -159,6 +191,11 @@ void eeconfig_debug_rgblight(void) {
} }
void rgblight_init(void) { void rgblight_init(void) {
/* if already initialized, don't do it again.
If you must do it again, extern this and set to false, first.
This is a dirty, dirty hack until proper hooks can be added for keyboard startup. */
if (is_rgblight_initialized) { return; }
debug_enable = 1; // Debug ON! debug_enable = 1; // Debug ON!
dprintf("rgblight_init called.\n"); dprintf("rgblight_init called.\n");
dprintf("rgblight_init start!\n"); dprintf("rgblight_init start!\n");
@@ -173,6 +210,8 @@ void rgblight_init(void) {
eeconfig_update_rgblight_default(); eeconfig_update_rgblight_default();
rgblight_config.raw = eeconfig_read_rgblight(); rgblight_config.raw = eeconfig_read_rgblight();
} }
rgblight_check_config();
eeconfig_debug_rgblight(); // display current eeprom values eeconfig_debug_rgblight(); // display current eeprom values
#ifdef RGBLIGHT_USE_TIMER #ifdef RGBLIGHT_USE_TIMER
@@ -182,6 +221,9 @@ void rgblight_init(void) {
if (rgblight_config.enable) { if (rgblight_config.enable) {
rgblight_mode_noeeprom(rgblight_config.mode); rgblight_mode_noeeprom(rgblight_config.mode);
} }
is_rgblight_initialized = true;
} }
void rgblight_update_dword(uint32_t dword) { void rgblight_update_dword(uint32_t dword) {
+1
View File
@@ -146,6 +146,7 @@ extern const uint8_t RGBLED_RAINBOW_SWIRL_INTERVALS[3] PROGMEM;
extern const uint8_t RGBLED_SNAKE_INTERVALS[3] PROGMEM; extern const uint8_t RGBLED_SNAKE_INTERVALS[3] PROGMEM;
extern const uint8_t RGBLED_KNIGHT_INTERVALS[3] PROGMEM; extern const uint8_t RGBLED_KNIGHT_INTERVALS[3] PROGMEM;
extern const uint16_t RGBLED_RGBTEST_INTERVALS[1] PROGMEM; extern const uint16_t RGBLED_RGBTEST_INTERVALS[1] PROGMEM;
extern bool is_rgblight_initialized;
typedef union { typedef union {
uint32_t raw; uint32_t raw;
+6 -2
View File
@@ -39,9 +39,13 @@ include $(STARTUP_MK)
# HAL-OSAL files (optional). # HAL-OSAL files (optional).
include $(CHIBIOS)/os/hal/hal.mk include $(CHIBIOS)/os/hal/hal.mk
PLATFORM_MK = $(CHIBIOS)/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)/platform.mk ifeq ("$(PLATFORM_NAME)","")
PLATFORM_NAME = platform
endif
PLATFORM_MK = $(CHIBIOS)/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)/$(PLATFORM_NAME).mk
ifeq ("$(wildcard $(PLATFORM_MK))","") ifeq ("$(wildcard $(PLATFORM_MK))","")
PLATFORM_MK = $(CHIBIOS_CONTRIB)/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)/platform.mk PLATFORM_MK = $(CHIBIOS_CONTRIB)/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)/$(PLATFORM_NAME).mk
endif endif
include $(PLATFORM_MK) include $(PLATFORM_MK)
+2 -1
View File
@@ -39,11 +39,12 @@ if [ -n "$target" ]; then
else else
echo "Error: target requires docker-machine to work on your platform" >&2 echo "Error: target requires docker-machine to work on your platform" >&2
echo "See http://gw.tnode.com/docker/docker-machine-with-usb-support-on-windows-macos" >&2 echo "See http://gw.tnode.com/docker/docker-machine-with-usb-support-on-windows-macos" >&2
echo "Consider flashing with QMK Toolbox (https://github.com/qmk/qmk_toolbox) instead" >&2
exit 3 exit 3
fi fi
fi fi
dir=$(pwd -W 2>/dev/null) || dir=$PWD # Use Windows path if on Windows dir=$(pwd -W 2>/dev/null) || dir=$PWD # Use Windows path if on Windows
# Run container and build firmware # Run container and build firmware
docker run --rm $usb_args -v "$dir":/qmk_firmware qmkfm/qmk_firmware \ docker run --rm -it $usb_args -v "$dir":/qmk_firmware qmkfm/qmk_firmware \
make "$keyboard${keymap:+:$keymap}${target:+:$target}" make "$keyboard${keymap:+:$keymap}${target:+:$target}"
+1 -15
View File
@@ -1,9 +1,6 @@
#!/bin/bash #!/bin/bash
TRAVIS_BRANCH="${TRAVIS_BRANCH:master}" source util/travis_push.sh
TRAVIS_PULL_REQUEST="${TRAVIS_PULL_REQUEST:false}"
TRAVIS_COMMIT_MESSAGE="${TRAVIS_COMMIT_MESSAGE:-none}"
TRAVIS_COMMIT_RANGE="${TRAVIS_COMMIT_RANGE:-HEAD~1..HEAD}"
set -o errexit -o nounset set -o errexit -o nounset
@@ -12,17 +9,6 @@ echo "Using git hash ${rev}"
if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" == "false" ]] ; then if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" == "false" ]] ; then
git config --global user.name "QMK Bot"
git config --global user.email "[email protected]"
openssl aes-256-cbc -K $encrypted_b0ee987fd0fc_key -iv $encrypted_b0ee987fd0fc_iv -in secrets.tar.enc -out secrets.tar -d
tar xvf secrets.tar
chmod 600 id_rsa_qmk_firmware
chmod 600 id_rsa_qmk.fm
eval `ssh-agent -s`
ssh-add id_rsa_qmk_firmware
# convert to unix line-endings # convert to unix line-endings
git checkout master git checkout master
git diff --diff-filter=M --name-only -n 1 -z ${TRAVIS_COMMIT_RANGE} | xargs -0 dos2unix git diff --diff-filter=M --name-only -n 1 -z ${TRAVIS_COMMIT_RANGE} | xargs -0 dos2unix
+10 -8
View File
@@ -5,13 +5,15 @@ TRAVIS_PULL_REQUEST="${TRAVIS_PULL_REQUEST:false}"
TRAVIS_COMMIT_MESSAGE="${TRAVIS_COMMIT_MESSAGE:-none}" TRAVIS_COMMIT_MESSAGE="${TRAVIS_COMMIT_MESSAGE:-none}"
TRAVIS_COMMIT_RANGE="${TRAVIS_COMMIT_RANGE:-HEAD~1..HEAD}" TRAVIS_COMMIT_RANGE="${TRAVIS_COMMIT_RANGE:-HEAD~1..HEAD}"
git config --global user.name "QMK Bot" if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" == "false" ]] ; then
git config --global user.email "[email protected]" git config --global user.name "QMK Bot"
git config --global user.email "[email protected]"
openssl aes-256-cbc -K $encrypted_b0ee987fd0fc_key -iv $encrypted_b0ee987fd0fc_iv -in secrets.tar.enc -out secrets.tar -d openssl aes-256-cbc -K $encrypted_b0ee987fd0fc_key -iv $encrypted_b0ee987fd0fc_iv -in secrets.tar.enc -out secrets.tar -d
tar xvf secrets.tar tar xvf secrets.tar
chmod 600 id_rsa_qmk_firmware chmod 600 id_rsa_qmk_firmware
chmod 600 id_rsa_qmk.fm chmod 600 id_rsa_qmk.fm
eval `ssh-agent -s` eval `ssh-agent -s`
ssh-add id_rsa_qmk_firmware ssh-add id_rsa_qmk_firmware
fi