Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Devided #3856, split Space Cadet process, trying fix at #3701 #3885

Closed
wants to merge 34 commits into from
Closed
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
34a708f
Improvement of Space Cadet Shift by preventing to automatically apply…
Sep 5, 2018
afc189a
Improve the use of the DISABLE_SPACE_CADET_MODIFIER flag to avoid unr…
Sep 6, 2018
5c6f7b6
change #if to if statement
leico Sep 8, 2018
64a67a8
Merge pull request #1 from leico/space_cadet
anthonyrichir Sep 8, 2018
18bd520
split space cadet functions from quantum.c to process_space_cadet.c
leico Sep 9, 2018
7b938b5
scoop upped default setting in quantum.c
leico Sep 9, 2018
3f4ae09
refactored space cadet process
leico Sep 9, 2018
13d5620
edit grave escape to set ignore modifier
leico Sep 9, 2018
db0352e
add selection for grave escape
leico Sep 9, 2018
eda84a8
fixed tapping term not defined
leico Sep 9, 2018
1212a51
changes magic number to enum
leico Sep 10, 2018
a16a3c8
add SPACE_CADET_ENABLE
leico Sep 10, 2018
b8005d2
improve forgot #ifdef preprocessor in quantum.c
leico Sep 10, 2018
d54a763
change space cadet process to strict
leico Sep 10, 2018
c9dbdbb
adding space cadet flag in required keymaps rules.mk
leico Sep 10, 2018
6ba54ef
Merge branch 'master' into space_cadet
leico Sep 10, 2018
0952a42
update each docs
leico Sep 10, 2018
7d7fbe3
improve incorrect information
leico Sep 10, 2018
2ff1e14
Merge branch 'master' into space_cadet
leico Sep 12, 2018
2db461e
revert docs/feature_grave_escape.md
leico Sep 12, 2018
a6b5e61
revert grave escape process
leico Sep 12, 2018
1c03d1a
improve documentation, revert quantum/quantum_keycodes.h
leico Sep 12, 2018
200059d
Merge branch 'master' into space_cadet
leico Sep 14, 2018
5ce9b7b
Merge branch 'master' into space_cadet
leico Sep 16, 2018
7015a92
Merge branch 'master' into space_cadet
leico Oct 21, 2018
da2a1cb
Merge branch 'master' into space_cadet
leico Oct 23, 2018
8a553c7
Add SPACE_CADET_ENABLE = yes option which have already used those fea…
leico Oct 23, 2018
09fd90c
add SPACE_CADET_ENABLE = no in keyboard template
leico Oct 23, 2018
7a801a6
change SPACE_CADET_ENABLE = yes position, add SPACE_CADET_ENABLE = ye…
leico Oct 23, 2018
f468f55
edit keyboard templates rules.mk, add binary size info in documents /…
leico Oct 23, 2018
33db372
Merge branch 'master' into space_cadet
leico Oct 27, 2018
f178b81
Merge branch 'master' into space_cadet
leico Feb 16, 2019
bc22678
add SPACE_CADET_ENABLE = yes they have already used LSPO, RSPC or SFTENT
leico Feb 16, 2019
b50f078
Merge branch 'master' into space_cadet
leico Feb 28, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion common_features.mk
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,12 @@ ifeq ($(strip $(HD44780_ENABLE)), yes)
OPT_DEFS += -DHD44780_ENABLE
endif

# space cadet shift process enable
ifeq ($(strip $(SPACE_CADET_ENABLE)), yes)
SRC += $(QUANTUM_DIR)/process_keycode/process_space_cadet.c
OPT_DEFS += -DSPACE_CADET_ENABLE
endif

QUANTUM_SRC:= \
$(QUANTUM_DIR)/quantum.c \
$(QUANTUM_DIR)/keymap_common.c \
Expand All @@ -246,5 +252,5 @@ ifeq ($(strip $(SPLIT_KEYBOARD)), yes)
QUANTUM_SRC += $(QUANTUM_DIR)/split_common/split_flags.c \
$(QUANTUM_DIR)/split_common/split_util.c \
$(QUANTUM_DIR)/split_common/i2c.c \
$(QUANTUM_DIR)/split_common/serial.c
$(QUANTUM_DIR)/split_common/serial.c
endif
54 changes: 42 additions & 12 deletions docs/feature_grave_esc.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,54 @@
# Grave Escape

If you're using a 60% keyboard, or any other layout with no F-row, you will have noticed that there is no dedicated Escape key. Grave Escape is a feature that allows you to share the grave key (<code>&#96;</code> and `~`) with Escape.
If you're using a 60% keyboard, or any other layout with no F-row, you will have noticed that there is no dedicated Escape key.
Grave Escape is a feature that allows you to share the grave key (<code>&#96;</code> and `~`) with Escape.

## Usage

Replace the `KC_GRAVE` key in your keymap (usually to the left of the `1` key) with `KC_GESC`. When pressed it will behave like `KC_ESC`, but with Shift or GUI held it will send `KC_GRAVE`.
Replace the `KC_GRAVE` key in your keymap (usually to the left of the `1` key) with `KC_GESC`.
When pressed it will behave like `KC_ESC`, but with Shift or GUI held it will send `KC_GRAVE`.

## Keycodes

|Key |Aliases |Description |
|---------|-----------|------------------------------------------------------------------|
|`KC_GESC`|`GRAVE_ESC`|Escape when pressed, <code>&#96;</code> when Shift or GUI are held|
| Key | Aliases | Description |
|-----------|-------------|--------------------------------------------------------------------|
| `KC_GESC` | `GRAVE_ESC` | Escape when pressed, <code>&#96;</code> when Shift or GUI are held |

## Configuration

There are several possible key combinations this will break, among them Control+Shift+Escape on Windows and Command+Option+Escape on macOS. To work around this, you can `#define` these options in your `config.h`:
### Overrides

|Define |Description |
|--------------------------|-----------------------------------------|
|`GRAVE_ESC_ALT_OVERRIDE` |Always send Escape if Alt is pressed |
|`GRAVE_ESC_CTRL_OVERRIDE` |Always send Escape if Control is pressed |
|`GRAVE_ESC_GUI_OVERRIDE` |Always send Escape if GUI is pressed |
|`GRAVE_ESC_SHIFT_OVERRIDE`|Always send Escape if Shift is pressed |
There are several possible key combinations this will break, among them Control + Shift + Escape on Windows
and Command + Option + Escape on macOS.
To work around this, you can `#define` these options in your `config.h`:

| Define | Default | Description |
|----------------------------|---------------|------------------------------------------|
| `GRAVE_ESC_ALT_OVERRIDE` | *Not defined* | Always send Escape if Alt is pressed |
| `GRAVE_ESC_CTRL_OVERRIDE` | *Not defined* | Always send Escape if Control is pressed |
| `GRAVE_ESC_GUI_OVERRIDE` | *Not defined* | Always send Escape if GUI is pressed |
| `GRAVE_ESC_SHIFT_OVERRIDE` | *Not defined* | Always send Escape if Shift is pressed |

### Ignore mods

Also you can customize ignore mod combination. It assumes these situations:

* left Shift uses for `~` ( Shift + <code>&#96;</code>, it is normal behavior ), but right Shift want to use <code>&#96;</code>
* want to send just <code>&#96;</code> , when pressed GUI + `KC_GESC`
* depend on enviroment, it will be sent GUI + <code>&#96;</code> message
* apply above both sides

They provided these options, add `#define` in your `(keymap|keyboard)/config.h`.

| Define | Default | Description |
|---------------------------|---------------|--------------------------------------------------------------------------------------------------------------------------|
| `GESC_GR_IGNORED_MOD` | *Not defined* | when defined mod keycode, will be passed mod when pressed <code>&#96;</code>, if mod is enabled |
| `GESC_GR_IGNORED_MOD_BIT` | *Not defined* | when defined mod bit, will be passed correspond mods when pressed <code>&#96;</code>, if any correspond mods are enabled |


#### example

* passed left Shift
* `#define GESC_GR_IGNORED_MOD KC_LSFT`
* passed both GUI
* `#define GESC_GR_IGNORED_MOD_BIT ( MOD_BIT( KC_LGUI ) | MOD_BIT( KC_RGUI ) )`
32 changes: 21 additions & 11 deletions docs/feature_space_cadet_shift.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,20 @@ Steve Losh described the [Space Cadet Shift](http://stevelosh.com/blog/2012/10/a

## Usage

Replace the Left Shift key in your keymap with `KC_LSPO` (Left Shift, Parenthesis Open), and Right Shift with `KC_RSPC` (Right Shift, Parenthesis Close).
First, you need to enable Space Cadet Shift feature. Add a flag in your `(keymap|keyboard)/rules.mk` like this:

```make
SPACE_CADET_ENABLE = yes
```

Then, replace the Left Shift key in your keymap with `KC_LSPO` (Left Shift, Parenthesis Open), and Right Shift with `KC_RSPC` (Right Shift, Parenthesis Close).

## Keycodes

|Keycode |Description |
|---------|--------------------------------------|
|`KC_LSPO`|Left Shift when held, `(` when tapped |
|`KC_RSPC`|Right Shift when held, `)` when tapped|
| Keycode | Description |
|-----------|----------------------------------------|
| `KC_LSPO` | Left Shift when held, `(` when tapped |
| `KC_RSPC` | Right Shift when held, `)` when tapped |

## Caveats

Expand All @@ -25,9 +31,13 @@ COMMAND_ENABLE = no

By default Space Cadet assumes a US ANSI layout, but if your layout uses different keys for parentheses, you can redefine them in your `config.h`.
You can also disable the rollover, allowing you to use the opposite Shift key to cancel the Space Cadet state in the event of an erroneous press, instead of emitting a pair of parentheses when the keys are released.

|Define |Default |Description |
|------------------------------|-------------|------------------------------------------------------------|
|`LSPO_KEY` |`KC_9` |The keycode to send when Left Shift is tapped |
|`RSPC_KEY` |`KC_0` |The keycode to send when Right Shift is tapped |
|`DISABLE_SPACE_CADET_ROLLOVER`|*Not defined*|If defined, use the opposite Shift key to cancel Space Cadet|
Also, by default, the Space Cadet applies modifiers LSPO_MOD and RSPC_MOD to keys defined by LSPO_KEY and RSPC_KEY. You can override this behavior by redefining those variables in your `config.h`. You can also prevent the Space Cadet to apply a modifier by defining DISABLE_SPACE_CADET_MODIFIER in your `config.h`.

| Define | Default | Description |
|--------------------------------|---------------|----------------------------------------------------------------------------------|
| `LSPO_KEY` | `KC_9` | The keycode to send when Left Shift is tapped |
| `RSPC_KEY` | `KC_0` | The keycode to send when Right Shift is tapped |
| `LSPO_MOD` | `KC_LSFT` | The keycode to send when Left Shift is tapped |
| `RSPC_MOD` | `KC_RSFT` | The keycode to send when Right Shift is tapped |
| `DISABLE_SPACE_CADET_ROLLOVER` | *Not defined* | If defined, use the opposite Shift key to cancel Space Cadet |
| `DISABLE_SPACE_CADET_MODIFIER` | *Not defined* | If defined, prevent the Space Cadet to apply a modifier to LSPO_KEY and RSPC_KEY |
8 changes: 7 additions & 1 deletion docs/feature_space_cadet_shift_enter.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ Based on the [Space Cadet Shift](feature_space_cadet_shift.md) feature. Tap the

## Usage

Replace any Shift key in your keymap with `KC_SFTENT` (Shift, Enter), and you're done.
First, you need to enable Space Cadet Shift feature. Add a flag in your `(keymap|keyboard)/rules.mk` like this:

```make
SPACE_CADET_ENABLE = yes
```

Then, replace any Shift key in your keymap with `KC_SFTENT` (Shift, Enter), and you're done.

## Keycodes

Expand Down
1 change: 1 addition & 0 deletions keyboards/alu84/keymaps/default/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SPACE_CADET_ENABLE = yes
1 change: 1 addition & 0 deletions keyboards/chimera_ergo/keymaps/default/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SPACE_CADET_ENABLE = yes
1 change: 1 addition & 0 deletions keyboards/chimera_ls/keymaps/default/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SPACE_CADET_ENABLE = yes
1 change: 1 addition & 0 deletions keyboards/chimera_ortho/keymaps/default/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SPACE_CADET_ENABLE = yes
1 change: 1 addition & 0 deletions keyboards/handwired/magicforce61/keymaps/default/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SPACE_CADET_ENABLE = yes
3 changes: 2 additions & 1 deletion keyboards/handwired/terminus_mini/keymaps/default/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@ 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.
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
TAP_DANCE_ENABLE = no # Enable Tap Dance
TAP_DANCE_ENABLE = no # Enable Tap Dance
SPACE_CADET_ENABLE = yes # Enable Space Cadet Shifts
1 change: 1 addition & 0 deletions keyboards/mt40/keymaps/default/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SPACE_CADET_ENABLE = yes
2 changes: 1 addition & 1 deletion keyboards/qwertyydox/keymaps/default/rules.mk
Original file line number Diff line number Diff line change
@@ -1 +1 @@

SPACE_CADET_ENABLE = yes
Loading