diff options
Diffstat (limited to 'users/sigul')
| -rw-r--r-- | users/sigul/.gitignore | 2 | ||||
| -rw-r--r-- | users/sigul/README.md | 17 | ||||
| -rw-r--r-- | users/sigul/config.h | 21 | ||||
| -rw-r--r-- | users/sigul/rules.mk | 8 | ||||
| -rw-r--r-- | users/sigul/sigul.c | 100 | ||||
| -rw-r--r-- | users/sigul/sigul.h | 42 |
6 files changed, 190 insertions, 0 deletions
diff --git a/users/sigul/.gitignore b/users/sigul/.gitignore new file mode 100644 index 000000000..12165fdbd --- /dev/null +++ b/users/sigul/.gitignore | |||
| @@ -0,0 +1,2 @@ | |||
| 1 | secrets.h | ||
| 2 | secrets.c | ||
diff --git a/users/sigul/README.md b/users/sigul/README.md new file mode 100644 index 000000000..a8f705e15 --- /dev/null +++ b/users/sigul/README.md | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | Copyright 2020 Silvio Gulizia desk@silviogulizia.com @sigul | ||
| 2 | |||
| 3 | Userspace by Silvio Gulizia | ||
| 4 | Contains code for ANSI / Italian layouts. | ||
| 5 | |||
| 6 | This program is free software: you can redistribute it and/or modify | ||
| 7 | it under the terms of the GNU General Public License as published by | ||
| 8 | the Free Software Foundation, either version 2 of the License, or | ||
| 9 | (at your option) any later version. | ||
| 10 | |||
| 11 | This program is distributed in the hope that it will be useful, | ||
| 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | GNU General Public License for more details. | ||
| 15 | |||
| 16 | You should have received a copy of the GNU General Public License | ||
| 17 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
diff --git a/users/sigul/config.h b/users/sigul/config.h new file mode 100644 index 000000000..dc0cd0f07 --- /dev/null +++ b/users/sigul/config.h | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | #pragma once | ||
| 2 | |||
| 3 | // My custom configurations | ||
| 4 | #define TAPPING_TOGGLE 3 // enable tapping toggle, used to lock level with a custom keycode defined by TT (in my case RAISE, LOWER and MOUSE) | ||
| 5 | #define USB_MAX_POWER_CONSUMPTION 100 // required to be able to use the keyboard with iPad | ||
| 6 | |||
| 7 | // Settings for using the keybaord as a mouse | ||
| 8 | #define MOUSEKEY_DELAY 30 | ||
| 9 | // Delay between pressing a movement key and cursor movement | ||
| 10 | #define MOUSEKEY_INTERVAL 16 | ||
| 11 | // Time between cursor movements | ||
| 12 | #define MOUSEKEY_MAX_SPEED 3 | ||
| 13 | // Maximum cursor speed at which acceleration stops | ||
| 14 | #define MOUSEKEY_TIME_TO_MAX 40 | ||
| 15 | // Time until maximum cursor speed is reached | ||
| 16 | #define MOUSEKEY_WHEEL_MAX_SPEED 0 | ||
| 17 | // Maximum number of scroll steps per scroll action | ||
| 18 | #define MOUSEKEY_WHEEL_TIME_TO_MAX 0 | ||
| 19 | // Time until maximum scroll speed is reached | ||
| 20 | |||
| 21 | #define MACRO_TIMER 5 | ||
diff --git a/users/sigul/rules.mk b/users/sigul/rules.mk new file mode 100644 index 000000000..e272957d0 --- /dev/null +++ b/users/sigul/rules.mk | |||
| @@ -0,0 +1,8 @@ | |||
| 1 | SRC += sigul.c | ||
| 2 | MOUSEKEY_ENABLE = yes | ||
| 3 | |||
| 4 | ifneq ($(strip $(NO_SECRETS)), yes) | ||
| 5 | ifneq ("$(wildcard $(USER_PATH)/secrets.c)","") | ||
| 6 | SRC += secrets.c | ||
| 7 | endif | ||
| 8 | endif | ||
diff --git a/users/sigul/sigul.c b/users/sigul/sigul.c new file mode 100644 index 000000000..0995ca736 --- /dev/null +++ b/users/sigul/sigul.c | |||
| @@ -0,0 +1,100 @@ | |||
| 1 | #include "keymap_italian_osx_ansi.h" | ||
| 2 | #include "sigul.h" | ||
| 3 | |||
| 4 | __attribute__ ((weak)) | ||
| 5 | layer_state_t layer_state_set_keymap (layer_state_t state) { | ||
| 6 | return state; | ||
| 7 | } | ||
| 8 | |||
| 9 | layer_state_t layer_state_set_user(layer_state_t state) { | ||
| 10 | return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); | ||
| 11 | } | ||
| 12 | |||
| 13 | __attribute__ ((weak)) | ||
| 14 | bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { | ||
| 15 | return true; | ||
| 16 | } | ||
| 17 | |||
| 18 | __attribute__ ((weak)) | ||
| 19 | bool process_record_secrets(uint16_t keycode, keyrecord_t *record) { | ||
| 20 | return true; | ||
| 21 | } | ||
| 22 | |||
| 23 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
| 24 | switch (keycode) { | ||
| 25 | |||
| 26 | case IT_SCCL: | ||
| 27 | if (record->event.pressed){ | ||
| 28 | if (get_mods() & MOD_BIT(KC_LSHIFT) || get_mods() & MOD_BIT(KC_RSHIFT)){ | ||
| 29 | register_code16(IT_COLN); | ||
| 30 | } else { | ||
| 31 | register_code16(IT_SCLN); | ||
| 32 | } | ||
| 33 | } else { | ||
| 34 | unregister_code16(IT_COLN); | ||
| 35 | unregister_code16(IT_SCLN); | ||
| 36 | } | ||
| 37 | return false; | ||
| 38 | break; | ||
| 39 | |||
| 40 | case IT_APDQ: | ||
| 41 | if (record->event.pressed){ | ||
| 42 | if (get_mods() & MOD_BIT(KC_LSHIFT) || get_mods() & MOD_BIT(KC_RSHIFT)){ | ||
| 43 | register_code16(IT_DQOT); | ||
| 44 | } else { | ||
| 45 | register_code16(IT_APOS); | ||
| 46 | } | ||
| 47 | } else { | ||
| 48 | unregister_code16(IT_DQOT); | ||
| 49 | unregister_code16(IT_APOS); | ||
| 50 | } | ||
| 51 | return false; | ||
| 52 | break; | ||
| 53 | |||
| 54 | case IT_CMLS: | ||
| 55 | if (record->event.pressed){ | ||
| 56 | if (get_mods() & MOD_BIT(KC_LSHIFT) || get_mods() & MOD_BIT(KC_RSHIFT)){ | ||
| 57 | unregister_code16(KC_LSFT); | ||
| 58 | register_code16(IT_LESS); | ||
| 59 | register_code16(KC_LSFT); | ||
| 60 | } else { | ||
| 61 | register_code16(IT_COMM); | ||
| 62 | } | ||
| 63 | } else { | ||
| 64 | unregister_code16(IT_LESS); | ||
| 65 | unregister_code16(IT_COMM); | ||
| 66 | } | ||
| 67 | return false; | ||
| 68 | break; | ||
| 69 | |||
| 70 | case IT_DTMR: | ||
| 71 | if (record->event.pressed){ | ||
| 72 | if (get_mods() & MOD_BIT(KC_LSHIFT) || get_mods() & MOD_BIT(KC_RSHIFT)){ | ||
| 73 | register_code16(IT_MORE); | ||
| 74 | } else { | ||
| 75 | register_code16(IT_DOT); | ||
| 76 | } | ||
| 77 | } else { | ||
| 78 | unregister_code16(IT_MORE); | ||
| 79 | unregister_code16(IT_DOT); | ||
| 80 | } | ||
| 81 | return false; | ||
| 82 | break; | ||
| 83 | |||
| 84 | case IT_SLQS: | ||
| 85 | if (record->event.pressed){ | ||
| 86 | if (get_mods() & MOD_BIT(KC_LSHIFT) || get_mods() & MOD_BIT(KC_RSHIFT)){ | ||
| 87 | register_code16(IT_QST); | ||
| 88 | } else { | ||
| 89 | register_code16(IT_SLSH); | ||
| 90 | } | ||
| 91 | } else { | ||
| 92 | unregister_code16(IT_QST); | ||
| 93 | unregister_code16(IT_SLSH); | ||
| 94 | } | ||
| 95 | return false; | ||
| 96 | break; | ||
| 97 | } | ||
| 98 | return process_record_keymap(keycode, record) && process_record_secrets(keycode, record); | ||
| 99 | }; | ||
| 100 | |||
diff --git a/users/sigul/sigul.h b/users/sigul/sigul.h new file mode 100644 index 000000000..dc24fae92 --- /dev/null +++ b/users/sigul/sigul.h | |||
| @@ -0,0 +1,42 @@ | |||
| 1 | #pragma once | ||
| 2 | |||
| 3 | #include "quantum.h" | ||
| 4 | |||
| 5 | enum userspace_layers { | ||
| 6 | _QWERTY, | ||
| 7 | _LOWER, //symbols | ||
| 8 | _RAISE, //numbers | ||
| 9 | _ADJUST, //system | ||
| 10 | _NUMPAD, | ||
| 11 | _FN, | ||
| 12 | _MOUSE | ||
| 13 | }; | ||
| 14 | |||
| 15 | enum userspace_custom_keycodes { | ||
| 16 | QWERTY = SAFE_RANGE, | ||
| 17 | // custom keycodes for an Italian ANSI layout with accented vowels | ||
| 18 | IT_CMLS, // IT_COMM and IT_LESS when combined with shift | ||
| 19 | IT_DTMR, // IT_DOT and IT_MORE when combined with shift | ||
| 20 | IT_SLQS, // IT_SLSH and IT_QST when combined with shift | ||
| 21 | IT_APDQ, // IT_APO and IT_DQOT when combined with shift | ||
| 22 | IT_SCCL, // IT_SMCL and IT_COLN when combined with shift | ||
| 23 | SECRET0, | ||
| 24 | SECRET1, | ||
| 25 | SECRET2, | ||
| 26 | SECRET3, | ||
| 27 | SECRET4, | ||
| 28 | NEW_SAFE_RANGE // start new keyboard-level declarations with NEW_SAFE_RANGE | ||
| 29 | }; | ||
| 30 | |||
| 31 | // Defining Layer Keycodes | ||
| 32 | #define QWERTY DF(_QWERTY) | ||
| 33 | // For LOWER and RAISE I use TT instead of MO to be able to lock those layer tapping three times the key (TAPPING_TOGGLE 3 has been added in sigul.h) | ||
| 34 | #define LOWER TT(_LOWER) | ||
| 35 | #define RAISE TT(_RAISE) | ||
| 36 | #define NUMPAD TG(_NUMPAD) | ||
| 37 | #define FN MO(_FN) | ||
| 38 | #define MOUSE TT(_MOUSE) | ||
| 39 | #define TABFN LT(_FN, KC_TAB) | ||
| 40 | #define ESCFN LT(_FN, KC_ESC) | ||
| 41 | #define MS_B LT(_MOUSE, IT_B) | ||
| 42 | |||
