diff options
| author | Giorgi Chavchanidze <76832811+gkbd@users.noreply.github.com> | 2021-07-20 02:32:20 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-07-19 17:32:20 -0700 |
| commit | 8bc8eadaf97e2b9d18d814074027e204abc0e335 (patch) | |
| tree | b93b36a774181031220839a8e9dbeb3a284df3dd /keyboards/idobo/keymaps | |
| parent | 7e698c71cd8b9d0cdef6c622cfdd88a13e2a6587 (diff) | |
| download | qmk_firmware-8bc8eadaf97e2b9d18d814074027e204abc0e335.tar.gz qmk_firmware-8bc8eadaf97e2b9d18d814074027e204abc0e335.zip | |
[Keymap] Orthon keymap for idobo (#13584)
Co-authored-by: Giorgi Chavchanidze <giorgi@vivaldi.com>
Diffstat (limited to 'keyboards/idobo/keymaps')
| -rw-r--r-- | keyboards/idobo/keymaps/gkbd_orthon/config.h | 20 | ||||
| -rw-r--r-- | keyboards/idobo/keymaps/gkbd_orthon/keymap.c | 78 | ||||
| -rw-r--r-- | keyboards/idobo/keymaps/gkbd_orthon/readme.md | 11 |
3 files changed, 109 insertions, 0 deletions
diff --git a/keyboards/idobo/keymaps/gkbd_orthon/config.h b/keyboards/idobo/keymaps/gkbd_orthon/config.h new file mode 100644 index 000000000..e8fc39faa --- /dev/null +++ b/keyboards/idobo/keymaps/gkbd_orthon/config.h | |||
| @@ -0,0 +1,20 @@ | |||
| 1 | /* Copyright 2021 Giorgi Chavchanidze | ||
| 2 | * | ||
| 3 | * This program is free software: you can redistribute it and/or modify | ||
| 4 | * it under the terms of the GNU General Public License as published by | ||
| 5 | * the Free Software Foundation, either version 2 of the License, or | ||
| 6 | * (at your option) any later version. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | |||
| 17 | #pragma once | ||
| 18 | |||
| 19 | #define TAPPING_TERM 200 | ||
| 20 | #define IGNORE_MOD_TAP_INTERRUPT | ||
diff --git a/keyboards/idobo/keymaps/gkbd_orthon/keymap.c b/keyboards/idobo/keymaps/gkbd_orthon/keymap.c new file mode 100644 index 000000000..a603eae65 --- /dev/null +++ b/keyboards/idobo/keymaps/gkbd_orthon/keymap.c | |||
| @@ -0,0 +1,78 @@ | |||
| 1 | /* Copyright 2021 Giorgi Chavchanidze | ||
| 2 | * | ||
| 3 | * This program is free software: you can redistribute it and/or modify | ||
| 4 | * it under the terms of the GNU General Public License as published by | ||
| 5 | * the Free Software Foundation, either version 2 of the License, or | ||
| 6 | * (at your option) any later version. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | |||
| 17 | #include QMK_KEYBOARD_H | ||
| 18 | |||
| 19 | #define MIN_PROXIMITY 8000 | ||
| 20 | |||
| 21 | uint16_t predecessor_key = KC_NO; | ||
| 22 | uint16_t adaptive_key = KC_NO; | ||
| 23 | |||
| 24 | static uint16_t vowel_proximity; | ||
| 25 | |||
| 26 | enum custom_keycodes { | ||
| 27 | ON = SAFE_RANGE, | ||
| 28 | }; | ||
| 29 | |||
| 30 | bool promote_consonants(void) { | ||
| 31 | return predecessor_key == KC_O && timer_elapsed(vowel_proximity) < MIN_PROXIMITY && !(get_mods() & ~MOD_MASK_SHIFT & MOD_MASK_CAG); | ||
| 32 | }; | ||
| 33 | |||
| 34 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
| 35 | |||
| 36 | if (keycode == ON) { | ||
| 37 | |||
| 38 | if (record->event.pressed) { | ||
| 39 | |||
| 40 | keycode = promote_consonants()?KC_N:KC_O; | ||
| 41 | register_code(keycode); | ||
| 42 | adaptive_key = keycode; | ||
| 43 | |||
| 44 | } | ||
| 45 | else { | ||
| 46 | unregister_code(adaptive_key); | ||
| 47 | } | ||
| 48 | } | ||
| 49 | |||
| 50 | if (!IS_MOD(keycode) && record->event.pressed) { | ||
| 51 | if(keycode == KC_E || keycode == KC_A || keycode == KC_O || keycode == KC_I || keycode == KC_U) { | ||
| 52 | predecessor_key = KC_O; | ||
| 53 | vowel_proximity = timer_read(); | ||
| 54 | } | ||
| 55 | else { | ||
| 56 | predecessor_key = keycode; | ||
| 57 | } | ||
| 58 | } | ||
| 59 | |||
| 60 | return true; | ||
| 61 | }; | ||
| 62 | |||
| 63 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 64 | [0] = LAYOUT_ortho_5x15(/* Base */ | ||
| 65 | KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LBRC, KC_APP, KC_RBRC, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL, | ||
| 66 | KC_QUOT, KC_Z, KC_Y, KC_U, KC_F, KC_W, KC_LCBR, KC_PSCR, KC_RCBR, KC_G, KC_M, KC_P, KC_N, KC_J, KC_MINS, | ||
| 67 | KC_ESC, KC_H, KC_I, KC_E, KC_A, KC_C, KC_LPRN, MO(1), KC_RPRN, KC_L, KC_R, KC_T, KC_S, KC_D, KC_ENT, | ||
| 68 | KC_TAB, KC_SCLN, KC_X, KC_O, KC_COMM, KC_DOT, KC_SLSH, KC_LGUI, KC_BSLS, KC_K, KC_V, KC_B, RSFT_T(KC_Q), KC_UP, KC_INS, | ||
| 69 | KC_CAPS, KC_HOME, KC_END, KC_DEL, KC_BSPC, ON, KC_LSFT, KC_RCTL, KC_RALT, KC_SPC, KC_PGDN, KC_PGUP, KC_LEFT, KC_DOWN, KC_RGHT | ||
| 70 | ), | ||
| 71 | [1] = LAYOUT_ortho_5x15(/* Function keys */ | ||
| 72 | KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, | ||
| 73 | KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, | ||
| 74 | KC_SLCK, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_NO, KC_TRNS, KC_NO, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_PAUS, | ||
| 75 | KC_NO, 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, | ||
| 76 | RESET, KC_NO, KC_NO, KC_NO, KC_NO, KC_F11, KC_TRNS, KC_TRNS, KC_TRNS, KC_F12, KC_NO, KC_NO, KC_NO, KC_NO, RGB_TOG | ||
| 77 | ) | ||
| 78 | }; | ||
diff --git a/keyboards/idobo/keymaps/gkbd_orthon/readme.md b/keyboards/idobo/keymaps/gkbd_orthon/readme.md new file mode 100644 index 000000000..36479ff9b --- /dev/null +++ b/keyboards/idobo/keymaps/gkbd_orthon/readme.md | |||
| @@ -0,0 +1,11 @@ | |||
| 1 |  | ||
| 2 | |||
| 3 | # Orthon layout | ||
| 4 | |||
| 5 | Ortholinear carpalx optimized layout with adaptive thumb key. | ||
| 6 | |||
| 7 | Adaptive key is | ||
| 8 | * **n** after **eaoiu** vowels | ||
| 9 | * **o** otherwise | ||
| 10 | |||
| 11 | Some documentation and resources (carpalx report, json configuration) are available at [https://lykt.xyz/rtsd/#orthon](https://lykt.xyz/rtsd/#orthon) | ||
