aboutsummaryrefslogtreecommitdiff
path: root/users/sigul
diff options
context:
space:
mode:
authorSilvio Gulizia <desk@silviogulizia.com>2020-03-31 23:15:16 +0200
committerGitHub <noreply@github.com>2020-03-31 14:15:16 -0700
commite5b10079cfaf9bd3cfb25781f2847a6ca4590fd4 (patch)
tree6922477b0d8bd550d99e17501102d3ba743e904b /users/sigul
parent854d46f833e57fa3b2b3b29c0230cba8f3e95a6e (diff)
downloadqmk_firmware-e5b10079cfaf9bd3cfb25781f2847a6ca4590fd4.tar.gz
qmk_firmware-e5b10079cfaf9bd3cfb25781f2847a6ca4590fd4.zip
[Keymap] Sigul planck (#8546)
* remove IT_PIPE duplicate and add IT_GRAD IT_PIPE was declared 2 times, ones as ° and once as |. I changed the first declaration and called it IT_GRAD. I even fixed the definition because the ° in Italian is obtained with LSFT(IT_AACC) * rename IT_GRAD to IT_DEGR * fix missing music mode legend * add missing plus_and_minus * fix missing IT_ACUT definition * change KC_LALT(KC_LSFT to LALT(LSFT * Fix alignment * remove leftover * fix issue generated with chars while pushing * fix typo * add sigul folder in Planck keymaps * fix LCBR and RCBR * fix euro symbol * fix RBRC * change IT_LESS form KC_NUBS to KC_GRAVE * add IT_TILDE and change IT_GRAV to IT_GRAVE * initial commit * add ideas to readme * comment key lock * add a bunch of new features as stated in readme.md * check features added and list to do * add macros on RAISE * add F keys on numbers row on FN layer * flag features added * fix macro formulas * move DESK and SGCOM under D and S * invert IT_EACC and S(IT_EACC) to align the layout with that of the default Planck * invert IT_EACC and S(IT_EACC) to align the layout with that of the default Planck fix spaces for readability * add missing legends for accented vowels * format for readability * move MOUSE button on B (same key that activates it) on MOUSE layer * revert to commit befor I edit it * initial commit * edited to be easier to compare to _ansi.h * remove keymap_italian_osx_iso.h and rename with edits keymap_italian_osx_ansi.h to keymap_italian_osx.h I found out there were no difference at all * fix missing #endif * change the included file from italian.h to italian_osx.h * fix debug key * edit Numapd layer, add enter and bsps * change TAPPING_TOGGLE from 2 to 3 * change italian_osx.h to italian_ansi.h * rename quantum/keymap_extras/keymap_italian_osx.h to quantum/keymap_extras/keymap_italian_ansi.h Now this file is a clone of the keymap_italian.h that appears to be working only for ISO keyboards. It also contains a few improvements for IT_PIPE (defined two times) and IT_ACUT (missing definition). Additionally it redefines LCBR and RCBR to LSFT(IT_LBRC) and LSFT(IT_RBRC) * rename file * redefines IT_BKSL and IT_PIPE based on KC_BKSL * merge new italian * add new osx_iso and osx_ansi version for italian.h and align BKSL to BSLS, fix double definition of PIPE * rename BKSL to BSLS * add FN_D and some comments * add MOUSEKEY configuration * update * edit swap =/+ with ò/ì * merge with master * add MS_B to have _MOUSE when pressing B * move RAISE on _FN * add phone number * remove CONTRA folder * remove CONTRA folder * Update keyboards/planck/keymaps/sigul/keymap.c fix include definition Co-Authored-By: Ryan <fauxpark@gmail.com> * remove default planck kemap * remove extern keymap_config_t keymap_config; based on suggestion from @fauxpark, It's not needed as it should already be externed through one of the includes provided by QMK_KEYBOARD_H. Co-Authored-By: Ryan <fauxpark@gmail.com> * add user space for user sigul * remove custom config moved to user space sigul * comment tri layers state (moved to user space) * remove tri layers update comment (code moved in user space) * add secrets * move enum and define to userspace * Edit title * move enum and define to sigul.h * add thanks * edit: moving to userspace enum, define and process_records * add enum and defines * add process_records * cleaning code after moving code to user space * add process_records * cleaning code * adding rules to manage secrets * remove secretes * first commit * add macro timer * add keycodes macro * edit custom keycodes order * add strings to send inside the secrets array * remove codes for secrets & change secret to secrets * edit secrets keycodes * edit keycodes names and order * add secrets.h and secrets.c * add #pragma once Co-Authored-By: Joel Challis <git@zvecr.com> * Update .gitignore Co-Authored-By: Joel Challis <git@zvecr.com> * add local gitignore for secrets * remove secrets * update for secrets * change FN_D to IT_D * remove FN_D definition Co-authored-by: pisilvio <silvio@picampus.it> Co-authored-by: admin <admin@admins-MacBook-Pro.local> Co-authored-by: Ryan <fauxpark@gmail.com> Co-authored-by: Joel Challis <git@zvecr.com>
Diffstat (limited to 'users/sigul')
-rw-r--r--users/sigul/.gitignore2
-rw-r--r--users/sigul/README.md17
-rw-r--r--users/sigul/config.h21
-rw-r--r--users/sigul/rules.mk8
-rw-r--r--users/sigul/sigul.c100
-rw-r--r--users/sigul/sigul.h42
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 @@
1secrets.h
2secrets.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 @@
1Copyright 2020 Silvio Gulizia desk@silviogulizia.com @sigul
2
3Userspace by Silvio Gulizia
4Contains code for ANSI / Italian layouts.
5
6This program is free software: you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation, either version 2 of the License, or
9(at your option) any later version.
10
11This program is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along 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 @@
1SRC += sigul.c
2MOUSEKEY_ENABLE = yes
3
4ifneq ($(strip $(NO_SECRETS)), yes)
5 ifneq ("$(wildcard $(USER_PATH)/secrets.c)","")
6 SRC += secrets.c
7 endif
8endif
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))
5layer_state_t layer_state_set_keymap (layer_state_t state) {
6 return state;
7}
8
9layer_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))
14bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
15 return true;
16}
17
18__attribute__ ((weak))
19bool process_record_secrets(uint16_t keycode, keyrecord_t *record) {
20 return true;
21}
22
23bool 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
5enum userspace_layers {
6 _QWERTY,
7 _LOWER, //symbols
8 _RAISE, //numbers
9 _ADJUST, //system
10 _NUMPAD,
11 _FN,
12 _MOUSE
13};
14
15enum 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