Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Shinichi-Ohki committed Oct 27, 2018
2 parents 2b0e557 + 5be438f commit a73948d
Show file tree
Hide file tree
Showing 646 changed files with 19,721 additions and 2,512 deletions.
2 changes: 1 addition & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Vagrant.configure(2) do |config|
# add a # before ,args: and run 'vagrant up' to get a working
# non-updated box and then attempt to troubleshoot or open a Github issue

config.vm.provision "shell", run: "always", path: "./util/install_dependencies.sh", args: "-update"
config.vm.provision "shell", run: "always", path: "./util/qmk_install.sh", args: "-update"

config.vm.post_up_message = <<-EOT
Expand Down
5 changes: 5 additions & 0 deletions common_features.mk
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,11 @@ ifeq ($(strip $(USB_HID_ENABLE)), yes)
include $(TMK_DIR)/protocol/usb_hid.mk
endif

ifeq ($(strip $(ENCODER_ENABLE)), yes)
SRC += $(QUANTUM_DIR)/encoder.c
OPT_DEFS += -DENCODER_ENABLE
endif

ifeq ($(strip $(HD44780_ENABLE)), yes)
SRC += drivers/avr/hd44780.c
OPT_DEFS += -DHD44780_ENABLE
Expand Down
1 change: 1 addition & 0 deletions docs/_sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
* [Combos](feature_combo)
* [Command](feature_command.md)
* [Dynamic Macros](feature_dynamic_macros.md)
* [Encoders](feature_encoders.md)
* [Grave Escape](feature_grave_esc.md)
* [Key Lock](feature_key_lock.md)
* [Layouts](feature_layouts.md)
Expand Down
1 change: 1 addition & 0 deletions docs/_summary.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
* [Combos](feature_combo)
* [Command](feature_command.md)
* [Dynamic Macros](feature_dynamic_macros.md)
* [Encoders](feature_encoders.md)
* [Grave Escape](feature_grave_esc.md)
* [Key Lock](feature_key_lock.md)
* [Layouts](feature_layouts.md)
Expand Down
2 changes: 2 additions & 0 deletions docs/faq_build.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,12 @@ The solution is to remove and reinstall all affected modules.
```
brew rm avr-gcc
brew rm dfu-programmer
brew rm dfu-util
brew rm gcc-arm-none-eabi
brew rm avrdude
brew install avr-gcc
brew install dfu-programmer
brew install dfu-util
brew install gcc-arm-none-eabi
brew install avrdude
```
Expand Down
35 changes: 25 additions & 10 deletions docs/feature_advanced_keycodes.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Your keymap can include keycodes that are more advanced than normal, for example keys that switch layers or send modifiers when held, but send regular keycodes when tapped. This page documents the functions that are available to you.

### Assigning Custom Names
## Assigning Custom Names

People often define custom names using `#define`. For example:

Expand All @@ -13,7 +13,7 @@ People often define custom names using `#define`. For example:
This will allow you to use `FN_CAPS` and `ALT_TAB` in your `KEYMAP()`, keeping it more readable.
### Caveats
## Caveats
Currently, `LT()` and `MT()` are limited to the [Basic Keycode set](keycodes_basic.md), meaning you can't use keycodes like `LCTL()`, `KC_TILD`, or anything greater than `0xFF`. Modifiers specified as part of a Layer Tap or Mod Tap's keycode will be ignored.
Expand All @@ -36,19 +36,19 @@ These functions allow you to activate layers in various ways. Note that layers a
Care must be taken when switching layers, it's possible to lock yourself into a layer with no way to deactivate that layer (without unplugging your keyboard.) We've created some guidelines to help users avoid the most common problems.
### Beginners
## Beginners
If you are just getting started with QMK you will want to keep everything simple. Follow these guidelines when setting up your layers:
* Setup layer 0 as your default, "base" layer. This is your normal typing layer, and could be whatever layout you want (qwerty, dvorak, colemak, etc.). It's important to set this as the lowest layer since it will typically have most or all of the keyboard's keys defined, so would block other layers from having any effect if it were above them (i.e., had a higher layer number).
* Arrange your layers in a "tree" layout, with layer 0 as the root. Do not try to enter the same layer from more than one other layer.
* In a layer's keymap, only reference higher-numbered layers. Because layers are processed from the highest-numbered (topmost) active layer down, modifying the state of lower layers can be tricky and error-prone.
### Intermediate Users
## Intermediate Users
Sometimes you need more than one base layer. For example, if you want to switch between QWERTY and Dvorak, switch between layouts for different countries, or switch your layout for different videogames. Your base layers should always be the lowest numbered layers. When you have multiple base layers you should always treat them as mutually exclusive. When one base layer is on the others are off.
### Advanced Users
## Advanced Users
Once you have a good feel for how layers work and what you can do, you can get more creative. The rules listed in the beginner section will help you be successful by avoiding some of the tricker details but they can be constraining, especially for ultra-compact keyboard users. Understanding how layers work will allow you to use them in more advanced ways.
Expand Down Expand Up @@ -126,6 +126,14 @@ For convenience, QMK includes some Mod-Tap shortcuts to make common combinations
|`SGUI_T(kc)`|`SCMD_T(kc)`, `SWIN_T(kc)` |Left Shift and GUI when held, `kc` when tapped |
|`LCA_T(kc)` | |Left Control and Alt when held, `kc` when tapped |

## Caveats

Unfortunately, these keycodes cannot be used in Mod-Taps or Layer-Taps, since any modifiers specified in the keycode are ignored.

Additionally, you may run into issues when using Remote Desktop Connection on Windows. Because these codes send shift very fast, Remote Desktop may miss the codes.

To fix this, open Remote Desktop Connection, click on "Show Options", open the the "Local Resources" tab. In the keyboard section, change the drop down to "On this Computer". This will fix the issue, and allow the characters to work correctly.

# One Shot Keys

One shot keys are keys that remain active until the next key is pressed, and then are released. This allows you to type keyboard combinations without pressing more than one key at a time. These keys are usually called "Sticky keys" or "Dead keys".
Expand All @@ -134,6 +142,8 @@ For example, if you define a key as `OSM(MOD_LSFT)`, you can type a capital A ch

One shot keys also work as normal modifiers. If you hold down a one shot key and type other keys, your one shot will be released immediately after you let go of the key.

Additionally, hitting keys five times in a short period will lock that key. This applies for both One Shot Modifiers and One Shot Layers, and is controlled by the `ONESHOT_TAP_TOGGLE` define.

You can control the behavior of one shot keys by defining these in `config.h`:

```c
Expand All @@ -144,15 +154,20 @@ You can control the behavior of one shot keys by defining these in `config.h`:
* `OSM(mod)` - Momentarily hold down *mod*. You must use the `MOD_*` keycodes as shown in [Mod Tap](#mod-tap), not the `KC_*` codes.
* `OSL(layer)` - momentary switch to *layer*.
Sometimes, you want to activate a one-shot layer as part of a macro or tap dance routine. To do this, you need to call `set_oneshot_layer(LAYER, ONESHOT_START)` on key down, and `set_oneshot_layer(ONESHOT_PRESSED)` on key up. If you want to cancel the oneshot, call `reset_oneshot_layer()`. For more complicated actions, take a look at the oneshot implementation in [`process_record`](https://github.com/qmk/qmk_firmware/blob/master/tmk_core/common/action.c#L429).
Sometimes, you want to activate a one-shot key as part of a macro or tap dance routine.
For one shot layers, you need to call `set_oneshot_layer(LAYER, ONESHOT_START)` on key down, and `set_oneshot_layer(ONESHOT_PRESSED)` on key up. If you want to cancel the oneshot, call `reset_oneshot_layer()`.
For one shot mods, you need to call `set_oneshot_mods(MOD)` to set it, or `clear_oneshot_mods()` to cancel it.
!> If you're having issues with OSM translating over Remote Desktop Connection, this can be fixed by opening the settings, going to the "Local Resources" tap, and in the keyboard section, change the drop down to "On this Computer". This will fix the issue and allow OSM to function properly over Remote Desktop.
If you're having issues with OSM translating over Remote Desktop Connection, this can be fixed by opening the settings, going to the "Local Resources" tap, and in the keyboard section, change the drop down to "On this Computer". This will fix the issue and allow OSM to function properly over Remote Desktop.
# Permissive Hold
As of [PR#1359](https://github.com/qmk/qmk_firmware/pull/1359/), there is a new `config.h` option:
```
```c
#define PERMISSIVE_HOLD
```

Expand Down Expand Up @@ -197,6 +212,6 @@ With `TAPPING_FORCE_HOLD`, the second press will be interpreted as a Shift, allo

# Retro Tapping

When you hold a dual function key, and haven't pressed anything when you release the key, normally nothing happens. However, if you enable this, if you release the key without pressing another key, it will send the original key, even if it is outside of the tapping term.
Holding and releasing a dual function key without pressing another key will result in nothing happening. With retro tapping enabled, releasing the key without pressing another will send the original keycode even if it is outside the tapping term.

For instance, if you're using `LT(2, KC_SPACE)`, if you hold the key, don't hit anything else and then release it, normally, nothing happens. But with `RETRO_TAPPING` defined in your `config.h`, it will send `KC_SPACE`.
For instance, holding and releasing `LT(2, KC_SPACE)` without hitting another key will result in nothing happening. With `RETRO_TAPPING` defined in your `config.h`, it will send `KC_SPACE`.
2 changes: 1 addition & 1 deletion docs/feature_backlight.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ In this handler, the value of an incrementing counter is mapped onto a precomput
|`backlight_increase()` |Increase the backlight level |
|`backlight_decrease()` |Decrease the backlight level |
|`backlight_level(x)` |Sets the backlight level to specified level |
|`get_backlight_level()`|Toggle backlight breathing |
|`get_backlight_level()`|Return the current backlight level |

### Backlight Breathing Functions

Expand Down
1 change: 1 addition & 0 deletions docs/feature_combo.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ combo_t key_combos[COMBO_COUNT] = {COMBO(test_combo, KC_ESC)};
This will send "Escape" if you hit the A and B keys.
!> This method only supports [basic keycodes](keycodes_basic.md). See the examples for more control.
!> You cannot reuse (share) keys in combos. Each key should only belong to a single combo.
## Examples
Expand Down
48 changes: 48 additions & 0 deletions docs/feature_encoders.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Encoders

Basic encoders are supported by adding this to your `rules.mk`:

ENCODER_ENABLE = yes

and this to your `config.h`:

#define NUMBER_OF_ENCODERS 1
#define ENCODERS_PAD_A { B12 }
#define ENCODERS_PAD_B { B13 }

Each PAD_A/B variable defines an array so multiple encoders can be defined, e.g.:

#define ENCODERS_PAD_A { encoder1a, encoder2a }
#define ENCODERS_PAD_B { encoder1a, encoder2b }

If your encoder's clockwise directions are incorrect, you can swap the A & B pad definitions.

Additionally, the resolution can be specified in the same file (the default & suggested is 4):

#define ENCODER_RESOLUTION 4

## Callbacks

The callback functions can be inserted into your `<keyboard>.c`:

void encoder_update_kb(uint8_t index, bool clockwise) {
encoder_update_user(index, clockwise);
}

or `keymap.c`:

void encoder_update_user(uint8_t index, bool clockwise) {
if (index == 0) {
if (clockwise) {
register_code(KC_PGDN);
unregister_code(KC_PGDN);
} else {
register_code(KC_PGUP);
unregister_code(KC_PGUP);
}
}
}

## Hardware

The A an B lines of the encoders should be wired directly to the MCU, and the C/common lines should be wired to ground.
2 changes: 2 additions & 0 deletions docs/feature_tap_dance.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ This array specifies what actions shall be taken when a tap-dance key is in acti

The first option is enough for a lot of cases, that just want dual roles. For example, `ACTION_TAP_DANCE_DOUBLE(KC_SPC, KC_ENT)` will result in `Space` being sent on single-tap, `Enter` otherwise.

!> Keep in mind that only [basic keycodes](keycodes_basic.md) are supported here. Custom keycodes are not supported.

And that's the bulk of it!

And now, on to the explanation of how it works!
Expand Down
9 changes: 5 additions & 4 deletions docs/getting_started_build_tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Note: If it is your first time here, Check out the "Complete Newbs guide" instea

## Linux

To ensure you are always up to date, you can just run `sudo util/install_dependencies.sh`. That should always install all the dependencies needed. **This will run `apt-get upgrade`.**
To ensure you are always up to date, you can just run `sudo util/qmk_install.sh`. That should always install all the dependencies needed. **This will run `apt-get upgrade`.**

You can also install things manually, but this documentation might not be always up to date with all requirements.

Expand Down Expand Up @@ -58,20 +58,21 @@ If you're using [homebrew,](http://brew.sh/) you can use the following commands:
brew update
brew install avr-gcc@7
brew install dfu-programmer
brew install dfu-util
brew install gcc-arm-none-eabi
brew install avrdude

This is the recommended method. If you don't have homebrew, [install it!](http://brew.sh/) It's very much worth it for anyone who works in the command line. Note that the `make` and `make install` portion during the homebrew installation of avr-libc can take over 20 minutes and exhibit high CPU usage.
This is the recommended method. If you don't have homebrew, [install it!](http://brew.sh/) It's very much worth it for anyone who works in the command line. Note that the `make` and `make install` portion during the homebrew installation of `avr-gcc@7` can take over 20 minutes and exhibit high CPU usage.

## Windows with msys2 (recommended)

The best environment to use, for Windows Vista through any later version (tested on 7 and 10), is [msys2](http://www.msys2.org).

* Install msys2 by downloading it and following the instructions here: http://www.msys2.org
* Open the ``MSYS2 MingGW 64-bit`` shortcut
* Navigate to your qmk checkout. For example, if it's in the root of your c drive:
* Navigate to your QMK repository. For example, if it's in the root of your c drive:
* `$ cd /c/qmk_firmware`
* Run `util/msys2_install.sh` and follow the prompts
* Run `util/qmk_install.sh` and follow the prompts

## Windows 10 (deprecated)
These are the old instructions for Windows 10. We recommend you use [MSYS2 as outlined above](#windows-with-msys2-recommended).
Expand Down
2 changes: 1 addition & 1 deletion docs/hardware_avr.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Do change the `MANUFACTURER`, `PRODUCT`, and `DESCRIPTION` lines to accurately r
#define DESCRIPTION A custom keyboard
```

?> Note: On Windows and macOS the `MANUFACTURER`, `PRODUCT`, and `DESCRIPTION` fields will be displayed in the list of USB devices. On Linux these values will not be visible in `lsusb`, since Linux takes that information from the list published by the USB-IF.
?> Note: On Windows and macOS the `MANUFACTURER`, `PRODUCT`, and `DESCRIPTION` fields will be displayed in the list of USB devices. ?> On Linux these values will not be visible in lsusb by default, since Linux takes the information from the list maintained by [USB ID Repository](http://www.linux-usb.org/usb-ids.html) by default. lsusb will show the information reported by the device when executed with -v option. It is also present in kernel logs after plugging in the device.

### Keyboard Matrix Configuration

Expand Down
4 changes: 4 additions & 0 deletions docs/keycodes_us_ansi_shifted.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ These keycodes correspond to characters that are "shifted" on a standard US ANSI

Unfortunately, these keycodes cannot be used in Mod-Taps or Layer-Taps, since any modifiers specified in the keycode are ignored.

Additionally, you may run into issues when using Remote Desktop Connection on Windows. Because these codes send shift very fast, Remote Desktop may miss the codes.

To fix this, open Remote Desktop Connection, click on "Show Options", open the the "Local Resources" tab. In the keyboard section, change the drop down to "On this Computer". This will fix the issue, and allow the characters to work correctly.

## Keycodes

|Key |Aliases |Description |
Expand Down
2 changes: 1 addition & 1 deletion docs/newbs_building_firmware.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Start by navigating to the `keymaps` folder for your keyboard.

?> Windows:

start keyboards/<keyboard_folder>/keymaps
start .\\keyboards\\<keyboard_folder>\\keymaps

## Create a Copy Of The `default` Keymap

Expand Down
3 changes: 0 additions & 3 deletions drivers/avr/ws2812.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,4 @@ void ws2812_sendarray_mask(uint8_t *array,uint16_t length, uint8_t pinmask);
#define CONCAT_EXP(a, b) CONCAT(a, b)
#endif

// #define ws2812_PORTREG CONCAT_EXP(PORT,ws2812_port)
// #define ws2812_DDRREG CONCAT_EXP(DDR,ws2812_port)

#endif /* LIGHT_WS2812_H_ */
15 changes: 15 additions & 0 deletions keyboards/1upkeyboards/sweet16/keymaps/ridingintraffic/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#pragma once

/* tap dance stuff*/
#undef TAPPING_TERM
#define TAPPING_TERM 500

#define TAPPING_TOGGLE 2

#define EXAMPLESTRING1 "tapdance_1"
#define EXAMPLESTRING2 "tapdance_2"
#define EXAMPLESTRING3 "tapdance_3"
#define EXAMPLESTRING4 "tapdance_4"

#undef RGBLED_NUM
#define RGBLED_NUM 16
Loading

0 comments on commit a73948d

Please sign in to comment.