Skip to content

Commit

Permalink
Merge pull request #17 from rafaelromao/last_qmk_magic-h
Browse files Browse the repository at this point in the history
Add Magic-H to QMK and remove ZMK files
  • Loading branch information
rafaelromao authored May 25, 2024
2 parents 6e8a06b + 3b352d2 commit 8ddefd8
Show file tree
Hide file tree
Showing 68 changed files with 163 additions and 2,771 deletions.
8 changes: 1 addition & 7 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,4 @@
url = https://github.com/qmk/qmk_firmware
[submodule "modules/getreuer/qmk-keymap"]
path = modules/getreuer/qmk-keymap
url = https://github.com/getreuer/qmk-keymap
[submodule "modules/rafaelromao/zmk"]
path = modules/rafaelromao/zmk
url = https://github.com/rafaelromao/zmk
[submodule "modules/caksoylar/zmk-rgbled-widget"]
path = modules/caksoylar/zmk-rgbled-widget
url = https://github.com/caksoylar/zmk-rgbled-widget
url = https://github.com/getreuer/qmk-keymap
14 changes: 7 additions & 7 deletions docs/base.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@
- The Alpha1 layer is the base layer, which contains the most common alphas of Portuguese and English, plus comma and period. It is extended by the Alpha2 layer.

### Secondary Alpha Layer
- The Alpha2 layer has common Portuguese accented letters, readily available with a single tap on the right inner thumb key (OS Accents), making them as easy to type as shifted letters, which are available with a single tap on the right outer thumb key (OS Shift).
- There are dedicated accent keys for à á â é ê ó ô ú í and ç, as well as a dead key for ~, which is all that is needed for Portuguese.
- This layer also gives access to comma, dot and replicated versions of q, y, w, v, z and j, that are not available in the base layer, for the 24 keys variant, as well as an standalone apostrophe character in the thumb.
- The Alpha2 layer has common Portuguese accentuated letters, readily available with a single tap on the right inner thumb key, along with the alphas that are missing in the base layer.
- There are dedicated keys for `à` `á` `â` `é` `ê` `ó` `ô` `ú` `í` and `ç`, as well, which is all that is needed for Portuguese.
- This two alpha layers approach is based on [Ben Vallack's keymap](https://youtu.be/5RN_4PQ0j1A?si=f9OkOvNdL3jE4seR).

### Magic Key
- The Bottom Row Index Key, in the right hand, is programmed to act as a Magic Key. It will behave like `H` after most consonants, like `V` after vowels or accentuated vowels, like `Y` after `B`, `M`, `D` and `F`, and will reactivate the Secondary Alpha Layer when tapped after a consonant from the Secondary Alpha Layer. To see more about that, check the [Magic Romak](https://github.com/rafaelromao/romak/tree/main?tab=readme-ov-file#magic-romak) page.

## Smart Thumb Keys
- The Smart Thumb keys in this layout change behavior according to the context (active layer, active modifiers and more).
- The four thumb keys control layer transitions, when held (Navigation, Lower, Raise and Media).

### Smart Repeat / Magic Key
- The outer left thumb key repeats the last key by default (Repeat Key), but outputs an alternate result for keys that do not worth repeating (Alternate Repeat Key).
- When tapped in the secondary alpha layer, this key outputs alternate results by default (Magic Key), but repeats the key when there is no predefined alternate result.
- See more about that [here](https://github.com/rafaelromao/romak/tree/main?tab=readme-ov-file#magic-romak).
### Repeat Key
- The outer left thumb key repeats the last key by default, but outputs an alternate result for keys that do not worth repeating. For `Ç`, the repeat key reactivates the Secondary Alpha Layer, which makes it easier to type `çã` and `çõ`.
- Holding this key in the base layer will activate the [Navigation](../navigation.md) layer.
- Tapping or holding this key in the [Raise](../symbols.md) layer acts as a normal Repeat Key, which can be used to spam or to repeat shortcuts.

Expand Down
28 changes: 0 additions & 28 deletions docs/cygnus.md

This file was deleted.

2 changes: 1 addition & 1 deletion docs/system.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
The System layer is activated holding both pinky keys and allows us to:
- Put the keyboard in bootloader mode.
- Reset the keyboard memory.
- Configure Bluetooth and RGB lights.
- Configure RGB lights.
- Put the host computer in sleep mode, lock it or power it off.
- Change the operating system used in keys that are OS aware, like the shortcut combos.

Expand Down
Binary file removed img/aellopos.jpeg
Binary file not shown.
Binary file removed img/cygnus.jpeg
Binary file not shown.
Binary file removed img/cygnus/01.jpeg
Binary file not shown.
Binary file removed img/cygnus/02.jpeg
Binary file not shown.
Binary file removed img/cygnus/03.jpeg
Binary file not shown.
Binary file removed img/cygnus/04.jpeg
Binary file not shown.
Binary file removed img/cygnus/05.jpeg
Binary file not shown.
Binary file removed img/cygnus/06.jpeg
Binary file not shown.
Binary file modified img/overview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed img/zen.jpeg
Binary file not shown.
78 changes: 0 additions & 78 deletions init_zmk.sh

This file was deleted.

1 change: 0 additions & 1 deletion modules/caksoylar/zmk-rgbled-widget
Submodule zmk-rgbled-widget deleted from 797587
1 change: 0 additions & 1 deletion modules/rafaelromao/zmk
Submodule zmk deleted from b1242d
33 changes: 3 additions & 30 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ The following pages explain how this layout works and which features are impleme

- [Smart Modifiers](docs/modifiers.md)
- [Smart Thumb Keys](docs/base.md#smart-thumb-keys)
- [Smart Repeat / Magic Key](docs/base.md#smart-thumb-keys)
- [Smart Shift / Caps Word](docs/base.md#smart-thumb-keys)
- [Smart Cases](docs/modifiers.md#smart-cases)
- [Sentence Case](docs/base.md#sentence-case)
- [Repeat Key](docs/base.md#repeat-key)
- [Magic Key](docs/base.md#magic-key)
- [Shortcut Combos](docs/base.md#base-layer-combos)
- [Numpad Layer](docs/symbols.md#numpad)
- [NumWord](docs/symbols.md#numword)
Expand Down Expand Up @@ -62,23 +63,7 @@ Some features are not available on all keyboards though. For instance, the BM40

### ZMK

The zmk version used for this keymap is the one available in [this fork](https://github.com/rafaelromao/zmk), which contains some experimental code from [Nick Conway](https://github.com/nickconway/zmk-config), [Cem Aksoylar](https://github.com/caksoylar/zmk-config ), [Robert U](https://github.com/urob/zmk-config), [VoidYourWarranty2](https://github.com/voidyourwarranty2/zmk) and [Alexander Krikun](https://github.com/krikun98), to implement features like:
- [Swapper](https://github.com/zmkfirmware/zmk/pull/1366)
- [Smart Word](https://github.com/zmkfirmware/zmk/pull/1451)
- [Leader Key](https://github.com/zmkfirmware/zmk/pull/1380)
- [Dynamic Macros](https://github.com/zmkfirmware/zmk/pull/1351)
- [Adaptive Keys](https://github.com/zmkfirmware/zmk/pull/2042)
- [Mouse Keys](https://github.com/zmkfirmware/zmk/pull/778)
- [Some improvements for the Corne-ish Zen display](https://gist.github.com/caksoylar/c411313990978e1903c244f03039187a)

This fork is also updated to Zephyr 3.5.

The tested boards are listed below:

- [Corne-ish Zen](src/zmk/boards/lowprokb.ca/corneish-zen/readme.md)
- [Dactyl Cygnus](src/zmk/boards/handwired/boards/shields/cygnus/readme.md)

Some features might not be available in ZMK. [This readme file](src/zmk/rafaelromao/readme.md) will indicate what features are missing.
For the ZMK version, check the `main` branch.

## Building

Expand All @@ -87,11 +72,6 @@ Some features might not be available in ZMK. [This readme file](src/zmk/rafaelro
The script [init_qmk.sh](init_qmk.sh) will clone [the QMK firmware](https://github.com/qmk/qmk_firmware) and symlink these keyboard files on it.
After [installing QMK](https://docs.qmk.fm/#/newbs_getting_started) and running the init script above, [qmk cli](https://docs.qmk.fm/#/cli) should be working to compile and flash.

### ZMK

The script [init_zmk.sh](init_zmk.sh) will clone [the ZMK firmware](https://github.com/rafaelromao/zmk) and configure the toolchain.
After [installing ZMK](https://zmk.dev/docs/development/setup) and running the init script above, [west cli](https://zmk.dev/docs/development/build-flash) should be working to compile and flash.

## References

Most features implemented here were based on the work referenced below.
Expand All @@ -118,12 +98,6 @@ Most features implemented here were based on the work referenced below.
- [Treeman](https://github.com/treeman/qmk_firmware/tree/master/keyboards/ferris/keymaps/treeman)
- [Thomas Baart](https://thomasbaart.nl/category/mechanical-keyboards/firmware/qmk)

### ZMK
- [Nick Conway](https://github.com/nickconway/zmk-config)
- [Cem Aksoylar](https://github.com/caksoylar/zmk-config )
- [Robert U](https://github.com/urob/zmk-config)
- [Alexander Krikun](https://github.com/krikun98)

### 3D Printing and Handwiring
- [Jan Lunge](https://m.youtube.com/@JanLunge)
- [Sadek Baroudi](https://github.com/sadekbaroudi)
Expand All @@ -136,7 +110,6 @@ Most features implemented here were based on the work referenced below.
- [KLE](http://www.keyboard-layout-editor.com/#/gists/38f4435ff9a10256d9a7e1a0645c2fec)
- [Keymap DB](https://keymapdb.com/rafaelromao/)
- [QMK Docs](https://docs.qmk.fm)
- [ZMK Docs](https://zmk.dev/docs)
- [Keyboard Tester](https://config.qmk.fm/#/test)
- [r/olkb](https://www.reddit.com/r/olkb)
- [r/ErgoMechKeyboards](https://www.reddit.com/r/ErgoMechKeyboards)
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#pragma once

// Configure RGB
#define RGBLIGHT_HUE_STEP 20
#define RGBLIGHT_HUE_STEP 20

#define SAVE_MEMORY
4 changes: 3 additions & 1 deletion src/qmk/keyboards/xiudi/xd75/keymaps/rafaelromao/config.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#pragma once

// Configure RGB
#define RGBLIGHT_SLEEP
#define RGBLIGHT_SLEEP

#define SAVE_MEMORY
7 changes: 6 additions & 1 deletion src/qmk/users/rafaelromao/definitions/keycodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,9 @@ bool is_shift_macro_keycode(uint16_t keycode) {

bool is_accent_macro_keycode(uint16_t keycode) {
return keycode > ACCENT_MACRO_START && keycode < ACCENT_MACRO_END;
}
}

bool is_shifted(void) {
return get_mods() & MOD_MASK_SHIFT || get_oneshot_mods() & MOD_MASK_SHIFT ||
get_oneshot_locked_mods() & MOD_MASK_SHIFT;
}
11 changes: 6 additions & 5 deletions src/qmk/users/rafaelromao/definitions/keycodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ enum {
// Begin macros used to write text
STR_MACRO_START,

MC_NG, MC_EY, MC_HY, MC_OU, MC_COM, MC_AO, MC_ES, MC_OES, MC_FIX_I,
MC_BTIC, MC_DQUO, MC_SQUO, MC_CIRC, MC_TILD, MC_ORDO, MC_ORDA,
MC_EUR, MC_LTE, MC_GTE, MC_DDS, MC_ENT, MC_TAB, MC_ESC, MC_ESCC,
TG_NUMC, MC_EXLM, MC_QUES, MC_ESAV, MC_SENT, MC_DEG, MC_DELW, MC_LY,
Expand All @@ -122,7 +121,7 @@ enum {
// Start macros for accented letters
ACCENT_MACRO_START,

MC_GV_A, MC_CR_A, MC_SQ_A, MC_QU,
MC_GV_A, MC_CR_A, MC_SQ_A, MC_QU, MC_AH,
MC_SQ_U, MC_CR_O, MC_SQ_O, MC_SQ_I,
MC_CR_E, MC_SQ_C, MC_SQ_E, MC_TL_A, MC_TL_O,

Expand Down Expand Up @@ -161,9 +160,10 @@ enum {
#define RCTLT_A RCTL_T(KC_A)

#define LALTT_P LALT_T(KC_P)
#define RALTT_H RALT_T(KC_H)
#define RALTT_F RALT_T(KC_F)

#define ALT_MAG RALT_T(KC_H)

#define LGUIT_T LGUI_T(KC_T)
#define RGUIT_R RGUI_T(KC_R)

Expand All @@ -178,8 +178,8 @@ enum {

#define NAV_F12 LT(_NAVIGATION, KC_F12)
#define NAV_AT LT(_NAVIGATION, KC_AT)
#define NAV_STI LT(_NAVIGATION, MC_STIN) // Hold behavior is implemented in intercepted code
#define NAV_MAG LT(_NAVIGATION, MAGIC)
#define NAV_STI LT(_NAVIGATION, MC_STIN) // Tap behavior is implemented in intercepted code
#define NAV_Q LT(_NAVIGATION, KC_Q)
#define NAV_REP LT(_NAVIGATION, REPEAT)
#define FNA_REP LT(_FIXED_NAV, REPEAT)

Expand Down Expand Up @@ -216,5 +216,6 @@ uint16_t extract_tapping_keycode(uint16_t keycode);
bool is_string_macro_keycode(uint16_t keycode);
bool is_shift_macro_keycode(uint16_t keycode);
bool is_accent_macro_keycode(uint16_t keycode);
bool is_shifted(void);

// clang-format on
16 changes: 8 additions & 8 deletions src/qmk/users/rafaelromao/definitions/keymap_blocks.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

#define ________ALPHA1_R1____________________ KC_L , KC_O , KC_U , KC_Y
#define __________________ALPHA1_R2____________________ KC_Z , RGUIT_R , RCTLT_A , RSFTT_E , SHO_KCI
#define __________________ALPHA1_R3__________ KC_J , RALTT_H , TD_COMM , TD_DOT
#define __________________ALPHA1_R3__________ KC_J , ALT_MAG , TD_COMM , TD_DOT
#define ___ALPHA1_R4_____ RAI_A2 , MED_CAS

#define ___________________LOWER_L1__________ XXXXXXX , TD_LCBR , TD_RCBR , TD_BSLS
Expand All @@ -23,7 +23,7 @@
#define _________LOWER_R1____________________ KC_7 , KC_8 , KC_9 , XXXXXXX
#define ___________________LOWER_R2____________________ XXXXXXX , KC_4 , KC_5 , KC_6 , KC_DOT
#define ___________________LOWER_R3__________ XXXXXXX , KC_1 , KC_2 , KC_3
#define ____LOWER_R4_____ RAI_SPC , MED_0
#define ____LOWER_R4_____ SYM_SPC , MED_0

#define ___________________RAISE_L1__________ XXXXXXX , KC_F9 , KC_F8 , KC_F7
#define ___________________RAISE_L2____________________ XXXXXXX , KC_F6 , KC_F5 , KC_F4 , XXXXXXX
Expand All @@ -43,7 +43,7 @@
#define _________NUMPAD_R1___________________ KC_7 , KC_8 , KC_9 , XXXXXXX
#define ___________________NUMPAD_R2___________________ XXXXXXX , KC_4 , KC_5 , KC_6 , SHO_DOT
#define ___________________NUMPAD_R3_________ XXXXXXX , KC_1 , KC_2 , KC_3
#define ____NUMPAD_R4____ RAI_SPC , MED_0
#define ____NUMPAD_R4____ SYM_SPC , MED_0

#define ________________SHORTCUTS_L1_________ XXXXXXX , MC_CLOS , MC_Z0R , MC_PREV
#define ________________SHORTCUTS_L2___________________ MO_SYS , SF_MODM , MC_MODP , MC_TABS , XXXXXXX
Expand Down Expand Up @@ -75,14 +75,14 @@
#define ___________________NOMOD_R3__________ KC_J , KC_H , KC_COMM , KC_DOT
#define ____NOMOD_R4_____ OSL_A2 , OS_LSFT

#define ___________________ALPHA2_L1_________ XXXXXXX , KC_Q , MC_QU , KC_K
#define ___________________ALPHA2_L1_________ XXXXXXX , KC_H , MC_QU , KC_K
#define ___________________ALPHA2_L2___________________ KC_Y , KC_Z , KC_X , KC_W , XXXXXXX
#define _________ALPHA2_L3___________________ KC_J , MC_SQ_C , KC_V , XXXXXXX
#define ____ALPHA2_L4____ NAV_MAG , OS_SYM
#define ____ALPHA2_L4____ NAV_Q , OS_SYM

#define _________ALPHA2_R1___________________ MC_CR_O , MC_SQ_O , MC_SQ_U , XXXXXXX
#define ___________________ALPHA2_R2___________________ XXXXXXX , MC_TL_A , MC_SQ_A , MC_SQ_E , MC_SQ_I
#define ___________________ALPHA2_R3_________ XXXXXXX , MC_TL_O , MC_CR_A , MC_CR_E
#define _________ALPHA2_R1___________________ MC_CR_O , MC_CR_E , MC_CR_A , XXXXXXX
#define ___________________ALPHA2_R2___________________ XXXXXXX , MC_TL_A , MC_SQ_E , MC_SQ_A , MC_SQ_I
#define ___________________ALPHA2_R3_________ XXXXXXX , MC_TL_O , MC_SQ_O , MC_SQ_U
#define ____ALPHA2_R4____ _______ , MC_SQUO

#define _________________SYMBOLS_L1__________ XXXXXXX , KC_LCBR , KC_RCBR , KC_DLR
Expand Down
Loading

0 comments on commit 8ddefd8

Please sign in to comment.