commit
						5227e86273
					
				
					 20 changed files with 712 additions and 241 deletions
				
			
		| 
						 | 
				
			
			@ -1,3 +1,18 @@
 | 
			
		|||
/*
 | 
			
		||||
This program is free software: you can redistribute it and/or modify
 | 
			
		||||
it under the terms of the GNU General Public License as published by
 | 
			
		||||
the Free Software Foundation, either version 2 of the License, or
 | 
			
		||||
(at your option) any later version.
 | 
			
		||||
 | 
			
		||||
This program is distributed in the hope that it will be useful,
 | 
			
		||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
			
		||||
GNU General Public License for more details.
 | 
			
		||||
 | 
			
		||||
You should have received a copy of the GNU General Public License
 | 
			
		||||
along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#pragma once
 | 
			
		||||
 | 
			
		||||
#define CHARYBDIS_CONFIG_SYNC
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,3 +1,18 @@
 | 
			
		|||
/*
 | 
			
		||||
This program is free software: you can redistribute it and/or modify
 | 
			
		||||
it under the terms of the GNU General Public License as published by
 | 
			
		||||
the Free Software Foundation, either version 2 of the License, or
 | 
			
		||||
(at your option) any later version.
 | 
			
		||||
 | 
			
		||||
This program is distributed in the hope that it will be useful,
 | 
			
		||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
			
		||||
GNU General Public License for more details.
 | 
			
		||||
 | 
			
		||||
You should have received a copy of the GNU General Public License
 | 
			
		||||
along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#include "t4corun.h"
 | 
			
		||||
 | 
			
		||||
#define LAYOUT_cnano_wrapper(...) LAYOUT_charybdis_3x5(__VA_ARGS__)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,3 +1,18 @@
 | 
			
		|||
/*
 | 
			
		||||
This program is free software: you can redistribute it and/or modify
 | 
			
		||||
it under the terms of the GNU General Public License as published by
 | 
			
		||||
the Free Software Foundation, either version 2 of the License, or
 | 
			
		||||
(at your option) any later version.
 | 
			
		||||
 | 
			
		||||
This program is distributed in the hope that it will be useful,
 | 
			
		||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
			
		||||
GNU General Public License for more details.
 | 
			
		||||
 | 
			
		||||
You should have received a copy of the GNU General Public License
 | 
			
		||||
along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
//Having this makes the left side encoder act like the right side
 | 
			
		||||
#undef EE_HANDS
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,3 +1,19 @@
 | 
			
		|||
/*
 | 
			
		||||
This program is free software: you can redistribute it and/or modify
 | 
			
		||||
it under the terms of the GNU General Public License as published by
 | 
			
		||||
the Free Software Foundation, either version 2 of the License, or
 | 
			
		||||
(at your option) any later version.
 | 
			
		||||
 | 
			
		||||
This program is distributed in the hope that it will be useful,
 | 
			
		||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
			
		||||
GNU General Public License for more details.
 | 
			
		||||
 | 
			
		||||
You should have received a copy of the GNU General Public License
 | 
			
		||||
along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#include "t4corun.h"
 | 
			
		||||
 | 
			
		||||
#define LAYOUT_swoop_wrapper(...) LAYOUT_split_3x5_3(__VA_ARGS__)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1 +1,16 @@
 | 
			
		|||
/*
 | 
			
		||||
This program is free software: you can redistribute it and/or modify
 | 
			
		||||
it under the terms of the GNU General Public License as published by
 | 
			
		||||
the Free Software Foundation, either version 2 of the License, or
 | 
			
		||||
(at your option) any later version.
 | 
			
		||||
 | 
			
		||||
This program is distributed in the hope that it will be useful,
 | 
			
		||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
			
		||||
GNU General Public License for more details.
 | 
			
		||||
 | 
			
		||||
You should have received a copy of the GNU General Public License
 | 
			
		||||
along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#pragma once
 | 
			
		||||
| 
						 | 
				
			
			@ -1,3 +1,18 @@
 | 
			
		|||
/*
 | 
			
		||||
This program is free software: you can redistribute it and/or modify
 | 
			
		||||
it under the terms of the GNU General Public License as published by
 | 
			
		||||
the Free Software Foundation, either version 2 of the License, or
 | 
			
		||||
(at your option) any later version.
 | 
			
		||||
 | 
			
		||||
This program is distributed in the hope that it will be useful,
 | 
			
		||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
			
		||||
GNU General Public License for more details.
 | 
			
		||||
 | 
			
		||||
You should have received a copy of the GNU General Public License
 | 
			
		||||
along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#include "t4corun.h"
 | 
			
		||||
 | 
			
		||||
#define LAYOUT_crkbd_wrapper(...) LAYOUT_split_3x6_3(__VA_ARGS__)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -93,182 +93,182 @@
 | 
			
		|||
    "layouts": {
 | 
			
		||||
        "LAYOUT_konrad": {
 | 
			
		||||
            "layout": [
 | 
			
		||||
                {"label": "L01", "matrix": [0, 1], "x": 3, "y": 0.25},
 | 
			
		||||
                {"label": "L02", "matrix": [0, 2], "x": 13, "y": 0.25},
 | 
			
		||||
                {"label": "L03", "matrix": [0, 3], "x": 4, "y": 0.75},
 | 
			
		||||
                {"label": "L04", "matrix": [0, 4], "x": 12, "y": 0.75},
 | 
			
		||||
                {"label": "L05", "matrix": [0, 5], "x": 5, "y": 1},
 | 
			
		||||
                {"label": "R00", "matrix": [4, 5], "x": 11, "y": 1},
 | 
			
		||||
                {"label": "R01", "matrix": [4, 4], "x": 3, "y": 1.25},
 | 
			
		||||
                {"label": "R02", "matrix": [4, 3], "x": 13, "y": 1.25},
 | 
			
		||||
                {"label": "R03", "matrix": [4, 2], "x": 4, "y": 1.75},
 | 
			
		||||
                {"label": "R04", "matrix": [4, 1], "x": 12, "y": 1.75},
 | 
			
		||||
                {"label": "L10", "matrix": [1, 0], "x": 5, "y": 2},
 | 
			
		||||
                {"label": "L11", "matrix": [1, 1], "x": 11, "y": 2},
 | 
			
		||||
                {"label": "L12", "matrix": [1, 2], "x": 3, "y": 2.25},
 | 
			
		||||
                {"label": "L13", "matrix": [1, 3], "x": 13, "y": 2.25},
 | 
			
		||||
                {"label": "L14", "matrix": [1, 4], "x": 4, "y": 2.75},
 | 
			
		||||
                {"label": "L15", "matrix": [1, 5], "x": 12, "y": 2.75},
 | 
			
		||||
                {"label": "R10", "matrix": [5, 5], "x": 5, "y": 3},
 | 
			
		||||
                {"label": "R11", "matrix": [5, 4], "x": 11, "y": 3},
 | 
			
		||||
                {"label": "R12", "matrix": [5, 3], "x": 6.25, "y": 3.25},
 | 
			
		||||
                {"label": "R13", "matrix": [5, 2], "x": 9.75, "y": 3.25},
 | 
			
		||||
                {"label": "R14", "matrix": [5, 1], "x": -0.5, "y": -0.4499999999999993},
 | 
			
		||||
                {"label": "R15", "matrix": [5, 0], "x": -0.5, "y": -4.149999999999999},
 | 
			
		||||
                {"label": "L20", "matrix": [2, 0], "x": -0.5, "y": -6.149999999999999},
 | 
			
		||||
                {"label": "L21", "matrix": [2, 1], "x": -0.5, "y": -5.149999999999999},
 | 
			
		||||
                {"label": "L22", "matrix": [2, 2], "x": -0.5, "y": -4.149999999999999},
 | 
			
		||||
                {"label": "L23", "matrix": [2, 3], "x": -0.25, "y": -5.499999999999999},
 | 
			
		||||
                {"label": "L24", "matrix": [2, 4], "x": 0.75, "y": -4.699999999999998},
 | 
			
		||||
                {"label": "L25", "matrix": [2, 5], "x": -0.25, "y": -4.499999999999999},
 | 
			
		||||
                {"label": "L35", "matrix": [3, 5], "x": 0.75, "y": -3.6999999999999984},
 | 
			
		||||
                {"label": "R30", "matrix": [7, 5], "x": -0.25, "y": -3.4999999999999987},
 | 
			
		||||
                {"label": "R20", "matrix": [6, 5], "x": -0.5, "y": -7.199999999999998},
 | 
			
		||||
                {"label": "R21", "matrix": [6, 4], "x": -0.5, "y": -7.199999999999998},
 | 
			
		||||
                {"label": "R22", "matrix": [6, 3], "x": -0.5, "y": -10.899999999999999},
 | 
			
		||||
                {"label": "R23", "matrix": [6, 2], "x": -0.5, "y": -10.899999999999999},
 | 
			
		||||
                {"label": "R24", "matrix": [6, 1], "x": -1, "y": -12.249999999999998},
 | 
			
		||||
                {"label": "R25", "matrix": [6, 0], "x": -2, "y": -11.449999999999998},
 | 
			
		||||
                {"label": "L31", "matrix": [3, 1], "x": -1, "y": -11.249999999999998},
 | 
			
		||||
                {"label": "L32", "matrix": [3, 2], "x": -2, "y": -10.449999999999998},
 | 
			
		||||
                {"label": "L33", "matrix": [3, 3], "x": -1, "y": -10.249999999999998},
 | 
			
		||||
                {"label": "R32", "matrix": [7, 3], "x": -0.75, "y": -12.249999999999998},
 | 
			
		||||
                {"label": "R33", "matrix": [7, 2], "x": -0.75, "y": -11.249999999999998},
 | 
			
		||||
                {"label": "R34", "matrix": [7, 1], "x": -0.75, "y": -10.249999999999998}
 | 
			
		||||
                {"label": "L01", "matrix": [0, 1], "x": 1, "y": 0.9},
 | 
			
		||||
                {"label": "L02", "matrix": [0, 2], "x": 0.5, "y": 2},
 | 
			
		||||
                {"label": "L03", "matrix": [0, 3], "x": 0, "y": 3},
 | 
			
		||||
                {"label": "L04", "matrix": [0, 4], "x": 0.5, "y": 4},
 | 
			
		||||
                {"label": "L05", "matrix": [0, 5], "x": 0.7, "y": 5},
 | 
			
		||||
                {"label": "R00", "matrix": [4, 5], "x": 0.7, "y": 10},
 | 
			
		||||
                {"label": "R01", "matrix": [4, 4], "x": 0.5, "y": 11},
 | 
			
		||||
                {"label": "R02", "matrix": [4, 3], "x": 0, "y": 12},
 | 
			
		||||
                {"label": "R03", "matrix": [4, 2], "x": 0.5, "y": 13},
 | 
			
		||||
                {"label": "R04", "matrix": [4, 1], "x": 1, "y": 14.1},
 | 
			
		||||
                {"label": "L10", "matrix": [1, 0], "x": 2, "y": 0},
 | 
			
		||||
                {"label": "L11", "matrix": [1, 1], "x": 2, "y": 1},
 | 
			
		||||
                {"label": "L12", "matrix": [1, 2], "x": 1.5, "y": 2},
 | 
			
		||||
                {"label": "L13", "matrix": [1, 3], "x": 1, "y": 3},
 | 
			
		||||
                {"label": "L14", "matrix": [1, 4], "x": 1.5, "y": 4},
 | 
			
		||||
                {"label": "L15", "matrix": [1, 5], "x": 1.7, "y": 5},
 | 
			
		||||
                {"label": "R10", "matrix": [5, 5], "x": 1.7, "y": 10},
 | 
			
		||||
                {"label": "R11", "matrix": [5, 4], "x": 1.5, "y": 11},
 | 
			
		||||
                {"label": "R12", "matrix": [5, 3], "x": 1, "y": 12},
 | 
			
		||||
                {"label": "R13", "matrix": [5, 2], "x": 1.5, "y": 13},
 | 
			
		||||
                {"label": "R14", "matrix": [5, 1], "x": 2, "y": 14},
 | 
			
		||||
                {"label": "R15", "matrix": [5, 0], "x": 2, "y": 15},
 | 
			
		||||
                {"label": "L20", "matrix": [2, 0], "x": 3, "y": 0.1},
 | 
			
		||||
                {"label": "L21", "matrix": [2, 1], "x": 3, "y": 1.1},
 | 
			
		||||
                {"label": "L22", "matrix": [2, 2], "x": 2.5, "y": 2},
 | 
			
		||||
                {"label": "L23", "matrix": [2, 3], "x": 2, "y": 3},
 | 
			
		||||
                {"label": "L24", "matrix": [2, 4], "x": 2.5, "y": 4},
 | 
			
		||||
                {"label": "L25", "matrix": [2, 5], "x": 2.7, "y": 5},
 | 
			
		||||
                {"label": "L35", "matrix": [3, 5], "x": 2.8, "y": 6.25},
 | 
			
		||||
                {"label": "R30", "matrix": [7, 5], "x": 2.8, "y": 8.75},
 | 
			
		||||
                {"label": "R20", "matrix": [6, 5], "x": 2.7, "y": 10},
 | 
			
		||||
                {"label": "R21", "matrix": [6, 4], "x": 2.5, "y": 11},
 | 
			
		||||
                {"label": "R22", "matrix": [6, 3], "x": 2, "y": 12},
 | 
			
		||||
                {"label": "R23", "matrix": [6, 2], "x": 2.5, "y": 13},
 | 
			
		||||
                {"label": "R24", "matrix": [6, 1], "x": 3, "y": 13.9},
 | 
			
		||||
                {"label": "R25", "matrix": [6, 0], "x": 3, "y": 14.9},
 | 
			
		||||
                {"label": "L31", "matrix": [3, 1], "x": 3.5, "y": 3.8},
 | 
			
		||||
                {"label": "L32", "matrix": [3, 2], "x": 3.7, "y": 5},
 | 
			
		||||
                {"label": "L33", "matrix": [3, 3], "x": 4, "y": 6},
 | 
			
		||||
                {"label": "R32", "matrix": [7, 3], "x": 4, "y": 9},
 | 
			
		||||
                {"label": "R33", "matrix": [7, 2], "x": 3.7, "y": 10},
 | 
			
		||||
                {"label": "R34", "matrix": [7, 1], "x": 3.5, "y": 11.2}
 | 
			
		||||
            ]
 | 
			
		||||
        },
 | 
			
		||||
        "LAYOUT_polydactyl": {
 | 
			
		||||
            "layout": [
 | 
			
		||||
                {"label": "L01", "matrix": [0, 1], "x": 3, "y": 0.25},
 | 
			
		||||
                {"label": "L02", "matrix": [0, 2], "x": 13, "y": 0.25},
 | 
			
		||||
                {"label": "L03", "matrix": [0, 3], "x": 4, "y": 0.75},
 | 
			
		||||
                {"label": "L04", "matrix": [0, 4], "x": 12, "y": 0.75},
 | 
			
		||||
                {"label": "L05", "matrix": [0, 5], "x": 5, "y": 1},
 | 
			
		||||
                {"label": "R00", "matrix": [4, 5], "x": 11, "y": 1},
 | 
			
		||||
                {"label": "R01", "matrix": [4, 4], "x": 3, "y": 1.25},
 | 
			
		||||
                {"label": "R02", "matrix": [4, 3], "x": 13, "y": 1.25},
 | 
			
		||||
                {"label": "R03", "matrix": [4, 2], "x": 4, "y": 1.75},
 | 
			
		||||
                {"label": "R04", "matrix": [4, 1], "x": 12, "y": 1.75},
 | 
			
		||||
                {"label": "L10", "matrix": [1, 0], "x": 5, "y": 2},
 | 
			
		||||
                {"label": "L11", "matrix": [1, 1], "x": 11, "y": 2},
 | 
			
		||||
                {"label": "L12", "matrix": [1, 2], "x": 3, "y": 2.25},
 | 
			
		||||
                {"label": "L13", "matrix": [1, 3], "x": 13, "y": 2.25},
 | 
			
		||||
                {"label": "L14", "matrix": [1, 4], "x": 4, "y": 2.75},
 | 
			
		||||
                {"label": "L15", "matrix": [1, 5], "x": 12, "y": 2.75},
 | 
			
		||||
                {"label": "R10", "matrix": [5, 5], "x": 5, "y": 3},
 | 
			
		||||
                {"label": "R11", "matrix": [5, 4], "x": 11, "y": 3},
 | 
			
		||||
                {"label": "R12", "matrix": [5, 3], "x": 6.25, "y": 3.25},
 | 
			
		||||
                {"label": "R13", "matrix": [5, 2], "x": 9.75, "y": 3.25},
 | 
			
		||||
                {"label": "R14", "matrix": [5, 1], "x": -0.5, "y": -0.4500000000000002},
 | 
			
		||||
                {"label": "R15", "matrix": [5, 0], "x": -0.5, "y": -4.15},
 | 
			
		||||
                {"label": "L20", "matrix": [2, 0], "x": -0.5, "y": -6.15},
 | 
			
		||||
                {"label": "L21", "matrix": [2, 1], "x": -0.5, "y": -5.15},
 | 
			
		||||
                {"label": "L22", "matrix": [2, 2], "x": -0.5, "y": -4.15},
 | 
			
		||||
                {"label": "L23", "matrix": [2, 3], "x": -0.25, "y": -5.5},
 | 
			
		||||
                {"label": "L24", "matrix": [2, 4], "x": 0.75, "y": -4.7},
 | 
			
		||||
                {"label": "L25", "matrix": [2, 5], "x": -0.25, "y": -4.500000000000001},
 | 
			
		||||
                {"label": "L35", "matrix": [3, 5], "x": 0.75, "y": -3.7000000000000006},
 | 
			
		||||
                {"label": "R30", "matrix": [7, 5], "x": -0.25, "y": -3.5000000000000004},
 | 
			
		||||
                {"label": "R20", "matrix": [6, 5], "x": -0.5, "y": -7.200000000000001},
 | 
			
		||||
                {"label": "R21", "matrix": [6, 4], "x": -0.5, "y": -7.200000000000001},
 | 
			
		||||
                {"label": "R22", "matrix": [6, 3], "x": -0.5, "y": -7.200000000000001},
 | 
			
		||||
                {"label": "R23", "matrix": [6, 2], "x": -0.5, "y": -10.9},
 | 
			
		||||
                {"label": "R24", "matrix": [6, 1], "x": -0.5, "y": -10.9},
 | 
			
		||||
                {"label": "R25", "matrix": [6, 0], "x": -0.5, "y": -10.9},
 | 
			
		||||
                {"label": "L31", "matrix": [3, 1], "x": -1, "y": -12.250000000000002},
 | 
			
		||||
                {"label": "L32", "matrix": [3, 2], "x": -2, "y": -11.450000000000001},
 | 
			
		||||
                {"label": "L33", "matrix": [3, 3], "x": -1, "y": -11.250000000000002},
 | 
			
		||||
                {"label": "L34", "matrix": [3, 4], "x": -2, "y": -10.450000000000001},
 | 
			
		||||
                {"label": "R31", "matrix": [7, 4], "x": -1, "y": -10.250000000000002},
 | 
			
		||||
                {"label": "R32", "matrix": [7, 3], "x": -0.75, "y": -12.250000000000002},
 | 
			
		||||
                {"label": "R33", "matrix": [7, 2], "x": -0.75, "y": -11.250000000000002},
 | 
			
		||||
                {"label": "R34", "matrix": [7, 1], "x": -0.75, "y": -10.250000000000002}
 | 
			
		||||
                {"label": "L01", "matrix": [0, 1], "x": 1, "y": 0.9},
 | 
			
		||||
                {"label": "L02", "matrix": [0, 2], "x": 0.5, "y": 2},
 | 
			
		||||
                {"label": "L03", "matrix": [0, 3], "x": 0, "y": 3},
 | 
			
		||||
                {"label": "L04", "matrix": [0, 4], "x": 0.5, "y": 4},
 | 
			
		||||
                {"label": "L05", "matrix": [0, 5], "x": 0.7, "y": 5},
 | 
			
		||||
                {"label": "R00", "matrix": [4, 5], "x": 0.7, "y": 10},
 | 
			
		||||
                {"label": "R01", "matrix": [4, 4], "x": 0.5, "y": 11},
 | 
			
		||||
                {"label": "R02", "matrix": [4, 3], "x": 0, "y": 12},
 | 
			
		||||
                {"label": "R03", "matrix": [4, 2], "x": 0.5, "y": 13},
 | 
			
		||||
                {"label": "R04", "matrix": [4, 1], "x": 1, "y": 14.1},
 | 
			
		||||
                {"label": "L10", "matrix": [1, 0], "x": 2, "y": 0},
 | 
			
		||||
                {"label": "L11", "matrix": [1, 1], "x": 2, "y": 1},
 | 
			
		||||
                {"label": "L12", "matrix": [1, 2], "x": 1.5, "y": 2},
 | 
			
		||||
                {"label": "L13", "matrix": [1, 3], "x": 1, "y": 3},
 | 
			
		||||
                {"label": "L14", "matrix": [1, 4], "x": 1.5, "y": 4},
 | 
			
		||||
                {"label": "L15", "matrix": [1, 5], "x": 1.7, "y": 5},
 | 
			
		||||
                {"label": "R10", "matrix": [5, 5], "x": 1.7, "y": 10},
 | 
			
		||||
                {"label": "R11", "matrix": [5, 4], "x": 1.5, "y": 11},
 | 
			
		||||
                {"label": "R12", "matrix": [5, 3], "x": 1, "y": 12},
 | 
			
		||||
                {"label": "R13", "matrix": [5, 2], "x": 1.5, "y": 13},
 | 
			
		||||
                {"label": "R14", "matrix": [5, 1], "x": 2, "y": 14},
 | 
			
		||||
                {"label": "R15", "matrix": [5, 0], "x": 2, "y": 15},
 | 
			
		||||
                {"label": "L20", "matrix": [2, 0], "x": 3, "y": 0.1},
 | 
			
		||||
                {"label": "L21", "matrix": [2, 1], "x": 3, "y": 1.1},
 | 
			
		||||
                {"label": "L22", "matrix": [2, 2], "x": 2.5, "y": 2},
 | 
			
		||||
                {"label": "L23", "matrix": [2, 3], "x": 2, "y": 3},
 | 
			
		||||
                {"label": "L24", "matrix": [2, 4], "x": 2.5, "y": 4},
 | 
			
		||||
                {"label": "L25", "matrix": [2, 5], "x": 2.7, "y": 5},
 | 
			
		||||
                {"label": "L35", "matrix": [3, 5], "x": 2.8, "y": 6.25},
 | 
			
		||||
                {"label": "R30", "matrix": [7, 5], "x": 2.8, "y": 8.75},
 | 
			
		||||
                {"label": "R20", "matrix": [6, 5], "x": 2.7, "y": 10},
 | 
			
		||||
                {"label": "R21", "matrix": [6, 4], "x": 2.5, "y": 11},
 | 
			
		||||
                {"label": "R22", "matrix": [6, 3], "x": 2, "y": 12},
 | 
			
		||||
                {"label": "R23", "matrix": [6, 2], "x": 2.5, "y": 13},
 | 
			
		||||
                {"label": "R24", "matrix": [6, 1], "x": 3, "y": 13.9},
 | 
			
		||||
                {"label": "R25", "matrix": [6, 0], "x": 3, "y": 14.9},
 | 
			
		||||
                {"label": "L31", "matrix": [3, 1], "x": 3.5, "y": 3.8},
 | 
			
		||||
                {"label": "L32", "matrix": [3, 2], "x": 3.7, "y": 5},
 | 
			
		||||
                {"label": "L33", "matrix": [3, 3], "x": 4, "y": 6},
 | 
			
		||||
                {"label": "L34", "matrix": [3, 4], "x": 4.5, "y": 7},
 | 
			
		||||
                {"label": "R31", "matrix": [7, 4], "x": 4.5, "y": 8},
 | 
			
		||||
                {"label": "R32", "matrix": [7, 3], "x": 4, "y": 9},
 | 
			
		||||
                {"label": "R33", "matrix": [7, 2], "x": 3.7, "y": 10},
 | 
			
		||||
                {"label": "R34", "matrix": [7, 1], "x": 3.5, "y": 11.2}
 | 
			
		||||
            ]
 | 
			
		||||
        },
 | 
			
		||||
        "LAYOUT_saegewerk": {
 | 
			
		||||
            "layout": [
 | 
			
		||||
                {"label": "L01", "matrix": [0, 1], "x": 2.25, "y": 0.25},
 | 
			
		||||
                {"label": "L02", "matrix": [0, 2], "x": 12.25, "y": 0.25},
 | 
			
		||||
                {"label": "L03", "matrix": [0, 3], "x": 3.25, "y": 0.75},
 | 
			
		||||
                {"label": "L04", "matrix": [0, 4], "x": 11.25, "y": 0.75},
 | 
			
		||||
                {"label": "L05", "matrix": [0, 5], "x": 4.25, "y": 1},
 | 
			
		||||
                {"label": "R00", "matrix": [4, 5], "x": 10.25, "y": 1},
 | 
			
		||||
                {"label": "R01", "matrix": [4, 4], "x": 2.25, "y": 1.25},
 | 
			
		||||
                {"label": "R02", "matrix": [4, 3], "x": 12.25, "y": 1.25},
 | 
			
		||||
                {"label": "R03", "matrix": [4, 2], "x": 3.25, "y": 1.75},
 | 
			
		||||
                {"label": "R04", "matrix": [4, 1], "x": 11.25, "y": 1.75},
 | 
			
		||||
                {"label": "L11", "matrix": [1, 1], "x": 4.25, "y": 2},
 | 
			
		||||
                {"label": "L12", "matrix": [1, 2], "x": 10.25, "y": 2},
 | 
			
		||||
                {"label": "L13", "matrix": [1, 3], "x": 2.25, "y": 2.25},
 | 
			
		||||
                {"label": "L14", "matrix": [1, 4], "x": 12.25, "y": 2.25},
 | 
			
		||||
                {"label": "L15", "matrix": [1, 5], "x": 3.25, "y": 2.75},
 | 
			
		||||
                {"label": "R10", "matrix": [5, 5], "x": 11.25, "y": 2.75},
 | 
			
		||||
                {"label": "R11", "matrix": [5, 4], "x": 4.25, "y": 3},
 | 
			
		||||
                {"label": "R12", "matrix": [5, 3], "x": 10.25, "y": 3},
 | 
			
		||||
                {"label": "R13", "matrix": [5, 2], "x": 5.5, "y": 3.25},
 | 
			
		||||
                {"label": "R14", "matrix": [5, 1], "x": 9, "y": 3.25},
 | 
			
		||||
                {"label": "L21", "matrix": [2, 1], "x": -0.5, "y": -0.4499999999999993},
 | 
			
		||||
                {"label": "L22", "matrix": [2, 2], "x": -0.5, "y": -4.149999999999999},
 | 
			
		||||
                {"label": "L23", "matrix": [2, 3], "x": -1.25, "y": -6.149999999999999},
 | 
			
		||||
                {"label": "L24", "matrix": [2, 4], "x": -1.25, "y": -5.149999999999999},
 | 
			
		||||
                {"label": "L25", "matrix": [2, 5], "x": -1.25, "y": -4.149999999999999},
 | 
			
		||||
                {"label": "L35", "matrix": [3, 5], "x": -1, "y": -5.499999999999999},
 | 
			
		||||
                {"label": "R30", "matrix": [7, 5], "x": -1, "y": -4.499999999999999},
 | 
			
		||||
                {"label": "R20", "matrix": [6, 5], "x": -1, "y": -3.4999999999999987},
 | 
			
		||||
                {"label": "R21", "matrix": [6, 4], "x": -0.5, "y": -7.199999999999998},
 | 
			
		||||
                {"label": "R22", "matrix": [6, 3], "x": -0.5, "y": -7.199999999999998},
 | 
			
		||||
                {"label": "R23", "matrix": [6, 2], "x": -0.5, "y": -10.899999999999999},
 | 
			
		||||
                {"label": "R24", "matrix": [6, 1], "x": -0.5, "y": -10.899999999999999},
 | 
			
		||||
                {"label": "L31", "matrix": [3, 1], "x": -1.75, "y": -12.249999999999998},
 | 
			
		||||
                {"label": "L32", "matrix": [3, 2], "x": -1.75, "y": -11.249999999999998},
 | 
			
		||||
                {"label": "L33", "matrix": [3, 3], "x": -1.75, "y": -10.249999999999998},
 | 
			
		||||
                {"label": "R32", "matrix": [7, 3], "x": -1.5, "y": -12.249999999999998},
 | 
			
		||||
                {"label": "R33", "matrix": [7, 2], "x": -1.5, "y": -11.249999999999998},
 | 
			
		||||
                {"label": "R34", "matrix": [7, 1], "x": -1.5, "y": -10.249999999999998}
 | 
			
		||||
                {"label": "L01", "matrix": [0, 1], "x": 1, "y": 0.9},
 | 
			
		||||
                {"label": "L02", "matrix": [0, 2], "x": 0.5, "y": 2},
 | 
			
		||||
                {"label": "L03", "matrix": [0, 3], "x": 0, "y": 3},
 | 
			
		||||
                {"label": "L04", "matrix": [0, 4], "x": 0.5, "y": 4},
 | 
			
		||||
                {"label": "L05", "matrix": [0, 5], "x": 0.7, "y": 5},
 | 
			
		||||
                {"label": "R00", "matrix": [4, 5], "x": 0.7, "y": 10},
 | 
			
		||||
                {"label": "R01", "matrix": [4, 4], "x": 0.5, "y": 11},
 | 
			
		||||
                {"label": "R02", "matrix": [4, 3], "x": 0, "y": 12},
 | 
			
		||||
                {"label": "R03", "matrix": [4, 2], "x": 0.5, "y": 13},
 | 
			
		||||
                {"label": "R04", "matrix": [4, 1], "x": 1, "y": 14.1},
 | 
			
		||||
                {"label": "L11", "matrix": [1, 1], "x": 2, "y": 1},
 | 
			
		||||
                {"label": "L12", "matrix": [1, 2], "x": 1.5, "y": 2},
 | 
			
		||||
                {"label": "L13", "matrix": [1, 3], "x": 1, "y": 3},
 | 
			
		||||
                {"label": "L14", "matrix": [1, 4], "x": 1.5, "y": 4},
 | 
			
		||||
                {"label": "L15", "matrix": [1, 5], "x": 1.7, "y": 5},
 | 
			
		||||
                {"label": "R10", "matrix": [5, 5], "x": 1.7, "y": 10},
 | 
			
		||||
                {"label": "R11", "matrix": [5, 4], "x": 1.5, "y": 11},
 | 
			
		||||
                {"label": "R12", "matrix": [5, 3], "x": 1, "y": 12},
 | 
			
		||||
                {"label": "R13", "matrix": [5, 2], "x": 1.5, "y": 13},
 | 
			
		||||
                {"label": "R14", "matrix": [5, 1], "x": 2, "y": 14},
 | 
			
		||||
                {"label": "L21", "matrix": [2, 1], "x": 3, "y": 1.1},
 | 
			
		||||
                {"label": "L22", "matrix": [2, 2], "x": 2.5, "y": 2},
 | 
			
		||||
                {"label": "L23", "matrix": [2, 3], "x": 2, "y": 3},
 | 
			
		||||
                {"label": "L24", "matrix": [2, 4], "x": 2.5, "y": 4},
 | 
			
		||||
                {"label": "L25", "matrix": [2, 5], "x": 2.7, "y": 5},
 | 
			
		||||
                {"label": "L35", "matrix": [3, 5], "x": 2.8, "y": 6.25},
 | 
			
		||||
                {"label": "R30", "matrix": [7, 5], "x": 2.8, "y": 8.75},
 | 
			
		||||
                {"label": "R20", "matrix": [6, 5], "x": 2.7, "y": 10},
 | 
			
		||||
                {"label": "R21", "matrix": [6, 4], "x": 2.5, "y": 11},
 | 
			
		||||
                {"label": "R22", "matrix": [6, 3], "x": 2, "y": 12},
 | 
			
		||||
                {"label": "R23", "matrix": [6, 2], "x": 2.5, "y": 13},
 | 
			
		||||
                {"label": "R24", "matrix": [6, 1], "x": 3, "y": 13.9},
 | 
			
		||||
                {"label": "L31", "matrix": [3, 1], "x": 3.5, "y": 3.8},
 | 
			
		||||
                {"label": "L32", "matrix": [3, 2], "x": 3.7, "y": 5},
 | 
			
		||||
                {"label": "L33", "matrix": [3, 3], "x": 4, "y": 6},
 | 
			
		||||
                {"label": "R32", "matrix": [7, 3], "x": 4, "y": 9},
 | 
			
		||||
                {"label": "R33", "matrix": [7, 2], "x": 3.7, "y": 10},
 | 
			
		||||
                {"label": "R34", "matrix": [7, 1], "x": 3.5, "y": 11.2}
 | 
			
		||||
            ]
 | 
			
		||||
        },
 | 
			
		||||
        "LAYOUT_yubitsume": {
 | 
			
		||||
            "layout": [
 | 
			
		||||
                {"label": "L01", "matrix": [0, 1], "x": 2.25, "y": 0.25},
 | 
			
		||||
                {"label": "L02", "matrix": [0, 2], "x": 12.25, "y": 0.25},
 | 
			
		||||
                {"label": "L03", "matrix": [0, 3], "x": 3.25, "y": 0.75},
 | 
			
		||||
                {"label": "L04", "matrix": [0, 4], "x": 11.25, "y": 0.75},
 | 
			
		||||
                {"label": "L05", "matrix": [0, 5], "x": 4.25, "y": 1},
 | 
			
		||||
                {"label": "R00", "matrix": [4, 5], "x": 10.25, "y": 1},
 | 
			
		||||
                {"label": "R01", "matrix": [4, 4], "x": 2.25, "y": 1.25},
 | 
			
		||||
                {"label": "R02", "matrix": [4, 3], "x": 12.25, "y": 1.25},
 | 
			
		||||
                {"label": "R03", "matrix": [4, 2], "x": 3.25, "y": 1.75},
 | 
			
		||||
                {"label": "R04", "matrix": [4, 1], "x": 11.25, "y": 1.75},
 | 
			
		||||
                {"label": "L11", "matrix": [1, 1], "x": 4.25, "y": 2},
 | 
			
		||||
                {"label": "L12", "matrix": [1, 2], "x": 10.25, "y": 2},
 | 
			
		||||
                {"label": "L13", "matrix": [1, 3], "x": 2.25, "y": 2.25},
 | 
			
		||||
                {"label": "L14", "matrix": [1, 4], "x": 12.25, "y": 2.25},
 | 
			
		||||
                {"label": "L15", "matrix": [1, 5], "x": 3.25, "y": 2.75},
 | 
			
		||||
                {"label": "R10", "matrix": [5, 5], "x": 11.25, "y": 2.75},
 | 
			
		||||
                {"label": "R11", "matrix": [5, 4], "x": 4.25, "y": 3},
 | 
			
		||||
                {"label": "R12", "matrix": [5, 3], "x": 10.25, "y": 3},
 | 
			
		||||
                {"label": "R13", "matrix": [5, 2], "x": 5.5, "y": 3.25},
 | 
			
		||||
                {"label": "R14", "matrix": [5, 1], "x": 9, "y": 3.25},
 | 
			
		||||
                {"label": "L21", "matrix": [2, 1], "x": -0.5, "y": -0.4499999999999993},
 | 
			
		||||
                {"label": "L22", "matrix": [2, 2], "x": -0.5, "y": -4.149999999999999},
 | 
			
		||||
                {"label": "L23", "matrix": [2, 3], "x": -1.25, "y": -6.149999999999999},
 | 
			
		||||
                {"label": "L24", "matrix": [2, 4], "x": -1.25, "y": -5.149999999999999},
 | 
			
		||||
                {"label": "L25", "matrix": [2, 5], "x": -1.25, "y": -4.149999999999999},
 | 
			
		||||
                {"label": "L35", "matrix": [3, 5], "x": -1, "y": -5.499999999999999},
 | 
			
		||||
                {"label": "R30", "matrix": [7, 5], "x": -1, "y": -4.499999999999999},
 | 
			
		||||
                {"label": "R20", "matrix": [6, 5], "x": -1, "y": -3.4999999999999987},
 | 
			
		||||
                {"label": "R21", "matrix": [6, 4], "x": -0.5, "y": -7.199999999999998},
 | 
			
		||||
                {"label": "R22", "matrix": [6, 3], "x": -0.5, "y": -7.199999999999998},
 | 
			
		||||
                {"label": "R23", "matrix": [6, 2], "x": -0.5, "y": -7.199999999999999},
 | 
			
		||||
                {"label": "R24", "matrix": [6, 1], "x": -0.5, "y": -10.899999999999999},
 | 
			
		||||
                {"label": "L31", "matrix": [3, 1], "x": -0.5, "y": -10.899999999999999},
 | 
			
		||||
                {"label": "L32", "matrix": [3, 2], "x": -0.5, "y": -10.899999999999999},
 | 
			
		||||
                {"label": "L33", "matrix": [3, 3], "x": -1.75, "y": -12.25},
 | 
			
		||||
                {"label": "L34", "matrix": [3, 4], "x": -1.75, "y": -11.25},
 | 
			
		||||
                {"label": "R31", "matrix": [7, 4], "x": -1.75, "y": -10.25},
 | 
			
		||||
                {"label": "R32", "matrix": [7, 3], "x": -1.5, "y": -12.25},
 | 
			
		||||
                {"label": "R33", "matrix": [7, 2], "x": -1.5, "y": -11.25},
 | 
			
		||||
                {"label": "R34", "matrix": [7, 1], "x": -1.5, "y": -10.25}
 | 
			
		||||
                {"label": "L01", "matrix": [0, 1], "x": 1, "y": 0.9},
 | 
			
		||||
                {"label": "L02", "matrix": [0, 2], "x": 0.5, "y": 2},
 | 
			
		||||
                {"label": "L03", "matrix": [0, 3], "x": 0, "y": 3},
 | 
			
		||||
                {"label": "L04", "matrix": [0, 4], "x": 0.5, "y": 4},
 | 
			
		||||
                {"label": "L05", "matrix": [0, 5], "x": 0.7, "y": 5},
 | 
			
		||||
                {"label": "R00", "matrix": [4, 5], "x": 0.7, "y": 10},
 | 
			
		||||
                {"label": "R01", "matrix": [4, 4], "x": 0.5, "y": 11},
 | 
			
		||||
                {"label": "R02", "matrix": [4, 3], "x": 0, "y": 12},
 | 
			
		||||
                {"label": "R03", "matrix": [4, 2], "x": 0.5, "y": 13},
 | 
			
		||||
                {"label": "R04", "matrix": [4, 1], "x": 1, "y": 14.1},
 | 
			
		||||
                {"label": "L11", "matrix": [1, 1], "x": 2, "y": 1},
 | 
			
		||||
                {"label": "L12", "matrix": [1, 2], "x": 1.5, "y": 2},
 | 
			
		||||
                {"label": "L13", "matrix": [1, 3], "x": 1, "y": 3},
 | 
			
		||||
                {"label": "L14", "matrix": [1, 4], "x": 1.5, "y": 4},
 | 
			
		||||
                {"label": "L15", "matrix": [1, 5], "x": 1.7, "y": 5},
 | 
			
		||||
                {"label": "R10", "matrix": [5, 5], "x": 1.7, "y": 10},
 | 
			
		||||
                {"label": "R11", "matrix": [5, 4], "x": 1.5, "y": 11},
 | 
			
		||||
                {"label": "R12", "matrix": [5, 3], "x": 1, "y": 12},
 | 
			
		||||
                {"label": "R13", "matrix": [5, 2], "x": 1.5, "y": 13},
 | 
			
		||||
                {"label": "R14", "matrix": [5, 1], "x": 2, "y": 14},
 | 
			
		||||
                {"label": "L21", "matrix": [2, 1], "x": 3, "y": 1.1},
 | 
			
		||||
                {"label": "L22", "matrix": [2, 2], "x": 2.5, "y": 2},
 | 
			
		||||
                {"label": "L23", "matrix": [2, 3], "x": 2, "y": 3},
 | 
			
		||||
                {"label": "L24", "matrix": [2, 4], "x": 2.5, "y": 4},
 | 
			
		||||
                {"label": "L25", "matrix": [2, 5], "x": 2.7, "y": 5},
 | 
			
		||||
                {"label": "L35", "matrix": [3, 5], "x": 2.8, "y": 6.25},
 | 
			
		||||
                {"label": "R30", "matrix": [7, 5], "x": 2.8, "y": 8.75},
 | 
			
		||||
                {"label": "R20", "matrix": [6, 5], "x": 2.7, "y": 10},
 | 
			
		||||
                {"label": "R21", "matrix": [6, 4], "x": 2.5, "y": 11},
 | 
			
		||||
                {"label": "R22", "matrix": [6, 3], "x": 2, "y": 12},
 | 
			
		||||
                {"label": "R23", "matrix": [6, 2], "x": 2.5, "y": 13},
 | 
			
		||||
                {"label": "R24", "matrix": [6, 1], "x": 3, "y": 13.9},
 | 
			
		||||
                {"label": "L31", "matrix": [3, 1], "x": 3.5, "y": 3.8},
 | 
			
		||||
                {"label": "L32", "matrix": [3, 2], "x": 3.7, "y": 5},
 | 
			
		||||
                {"label": "L33", "matrix": [3, 3], "x": 4, "y": 6},
 | 
			
		||||
                {"label": "L34", "matrix": [3, 4], "x": 4.5, "y": 7},
 | 
			
		||||
                {"label": "R31", "matrix": [7, 4], "x": 4.5, "y": 8},
 | 
			
		||||
                {"label": "R32", "matrix": [7, 3], "x": 4, "y": 9},
 | 
			
		||||
                {"label": "R33", "matrix": [7, 2], "x": 3.7, "y": 10},
 | 
			
		||||
                {"label": "R34", "matrix": [7, 1], "x": 3.5, "y": 11.2}
 | 
			
		||||
            ]
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										247
									
								
								keyboards/ploopyco/ploopyco.c
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										247
									
								
								keyboards/ploopyco/ploopyco.c
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,247 @@
 | 
			
		|||
/* Copyright 2020 Christopher Courtney, aka Drashna Jael're  (@drashna) <drashna@live.com>
 | 
			
		||||
 * Copyright 2019 Sunjun Kim
 | 
			
		||||
 * Copyright 2020 Ploopy Corporation
 | 
			
		||||
 *
 | 
			
		||||
 * This program is free software: you can redistribute it and/or modify
 | 
			
		||||
 * it under the terms of the GNU General Public License as published by
 | 
			
		||||
 * the Free Software Foundation, either version 2 of the License, or
 | 
			
		||||
 * (at your option) any later version.
 | 
			
		||||
 *
 | 
			
		||||
 * This program is distributed in the hope that it will be useful,
 | 
			
		||||
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
			
		||||
 * GNU General Public License for more details.
 | 
			
		||||
 *
 | 
			
		||||
 * You should have received a copy of the GNU General Public License
 | 
			
		||||
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "ploopyco.h"
 | 
			
		||||
#include "analog.h"
 | 
			
		||||
#include "opt_encoder.h"
 | 
			
		||||
 | 
			
		||||
// for legacy support
 | 
			
		||||
#if defined(OPT_DEBOUNCE) && !defined(PLOOPY_SCROLL_DEBOUNCE)
 | 
			
		||||
#    define PLOOPY_SCROLL_DEBOUNCE OPT_DEBOUNCE
 | 
			
		||||
#endif
 | 
			
		||||
#if defined(SCROLL_BUTT_DEBOUNCE) && !defined(PLOOPY_SCROLL_BUTTON_DEBOUNCE)
 | 
			
		||||
#    define PLOOPY_SCROLL_BUTTON_DEBOUNCE SCROLL_BUTT_DEBOUNCE
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifndef PLOOPY_SCROLL_DEBOUNCE
 | 
			
		||||
#    define PLOOPY_SCROLL_DEBOUNCE 5
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef PLOOPY_SCROLL_BUTTON_DEBOUNCE
 | 
			
		||||
#    define PLOOPY_SCROLL_BUTTON_DEBOUNCE 100
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifndef PLOOPY_DPI_OPTIONS
 | 
			
		||||
#    define PLOOPY_DPI_OPTIONS \
 | 
			
		||||
        { 600, 900, 1200, 1600, 2400 }
 | 
			
		||||
#    ifndef PLOOPY_DPI_DEFAULT
 | 
			
		||||
#        define PLOOPY_DPI_DEFAULT 1
 | 
			
		||||
#    endif
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef PLOOPY_DPI_DEFAULT
 | 
			
		||||
#    define PLOOPY_DPI_DEFAULT 0
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef PLOOPY_DRAGSCROLL_DIVISOR_H
 | 
			
		||||
#    define PLOOPY_DRAGSCROLL_DIVISOR_H 8.0
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef PLOOPY_DRAGSCROLL_DIVISOR_V
 | 
			
		||||
#    define PLOOPY_DRAGSCROLL_DIVISOR_V 8.0
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef ENCODER_BUTTON_ROW
 | 
			
		||||
#    define ENCODER_BUTTON_ROW 0
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef ENCODER_BUTTON_COL
 | 
			
		||||
#    define ENCODER_BUTTON_COL 0
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
keyboard_config_t keyboard_config;
 | 
			
		||||
uint16_t          dpi_array[] = PLOOPY_DPI_OPTIONS;
 | 
			
		||||
#define DPI_OPTION_SIZE ARRAY_SIZE(dpi_array)
 | 
			
		||||
 | 
			
		||||
// Trackball State
 | 
			
		||||
bool  is_scroll_clicked    = false;
 | 
			
		||||
bool  is_drag_scroll       = false;
 | 
			
		||||
float scroll_accumulated_h = 0;
 | 
			
		||||
float scroll_accumulated_v = 0;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#ifdef ENCODER_ENABLE
 | 
			
		||||
uint16_t lastScroll        = 0; // Previous confirmed wheel event
 | 
			
		||||
uint16_t lastMidClick      = 0; // Stops scrollwheel from being read if it was pressed
 | 
			
		||||
pin_t    encoder_pins_a[1] = ENCODERS_PAD_A;
 | 
			
		||||
pin_t    encoder_pins_b[1] = ENCODERS_PAD_B;
 | 
			
		||||
bool     debug_encoder     = false;
 | 
			
		||||
 | 
			
		||||
bool encoder_update_kb(uint8_t index, bool clockwise) {
 | 
			
		||||
    if (!encoder_update_user(index, clockwise)) {
 | 
			
		||||
        return false;
 | 
			
		||||
    }
 | 
			
		||||
#    ifdef MOUSEKEY_ENABLE
 | 
			
		||||
    tap_code(clockwise ? KC_WH_U : KC_WH_D);
 | 
			
		||||
#    else
 | 
			
		||||
    report_mouse_t mouse_report = pointing_device_get_report();
 | 
			
		||||
    mouse_report.v              = clockwise ? 1 : -1;
 | 
			
		||||
    pointing_device_set_report(mouse_report);
 | 
			
		||||
    pointing_device_send();
 | 
			
		||||
#    endif
 | 
			
		||||
    return true;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void encoder_driver_init(void) {
 | 
			
		||||
    for (uint8_t i = 0; i < ARRAY_SIZE(encoder_pins_a); i++) {
 | 
			
		||||
        gpio_set_pin_input(encoder_pins_a[i]);
 | 
			
		||||
        gpio_set_pin_input(encoder_pins_b[i]);
 | 
			
		||||
    }
 | 
			
		||||
    opt_encoder_init();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void encoder_driver_task(void) {
 | 
			
		||||
    uint16_t p1 = analogReadPin(encoder_pins_a[0]);
 | 
			
		||||
    uint16_t p2 = analogReadPin(encoder_pins_b[0]);
 | 
			
		||||
 | 
			
		||||
    if (debug_encoder) dprintf("OPT1: %d, OPT2: %d\n", p1, p2);
 | 
			
		||||
 | 
			
		||||
    int8_t dir = opt_encoder_handler(p1, p2);
 | 
			
		||||
    // If the mouse wheel was just released, do not scroll.
 | 
			
		||||
    if (timer_elapsed(lastMidClick) < PLOOPY_SCROLL_BUTTON_DEBOUNCE) {
 | 
			
		||||
        return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Limit the number of scrolls per unit time.
 | 
			
		||||
    if (timer_elapsed(lastScroll) < PLOOPY_SCROLL_DEBOUNCE) {
 | 
			
		||||
        return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Don't scroll if the middle button is depressed.
 | 
			
		||||
    if (is_scroll_clicked) {
 | 
			
		||||
#    ifndef PLOOPY_IGNORE_SCROLL_CLICK
 | 
			
		||||
        return;
 | 
			
		||||
#    endif
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (dir == 0) return;
 | 
			
		||||
    encoder_queue_event(0, dir > 0);
 | 
			
		||||
    lastScroll = timer_read();
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
void toggle_drag_scroll(void) {
 | 
			
		||||
    is_drag_scroll ^= 1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void cycle_dpi(void) {
 | 
			
		||||
    keyboard_config.dpi_config = (keyboard_config.dpi_config + 1) % DPI_OPTION_SIZE;
 | 
			
		||||
    eeconfig_update_kb(keyboard_config.raw);
 | 
			
		||||
    pointing_device_set_cpi(dpi_array[keyboard_config.dpi_config]);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
report_mouse_t pointing_device_task_kb(report_mouse_t mouse_report) {
 | 
			
		||||
    if (is_drag_scroll) {
 | 
			
		||||
        scroll_accumulated_h += (float)mouse_report.x / PLOOPY_DRAGSCROLL_DIVISOR_H;
 | 
			
		||||
        scroll_accumulated_v += (float)mouse_report.y / PLOOPY_DRAGSCROLL_DIVISOR_V;
 | 
			
		||||
 | 
			
		||||
        // Assign integer parts of accumulated scroll values to the mouse report
 | 
			
		||||
        mouse_report.h = (int8_t)scroll_accumulated_h;
 | 
			
		||||
#ifdef PLOOPY_DRAGSCROLL_INVERT
 | 
			
		||||
        mouse_report.v = -(int8_t)scroll_accumulated_v;
 | 
			
		||||
#else
 | 
			
		||||
        mouse_report.v = (int8_t)scroll_accumulated_v;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
        // Update accumulated scroll values by subtracting the integer parts
 | 
			
		||||
        scroll_accumulated_h -= (int8_t)scroll_accumulated_h;
 | 
			
		||||
        scroll_accumulated_v -= (int8_t)scroll_accumulated_v;
 | 
			
		||||
 | 
			
		||||
        // Clear the X and Y values of the mouse report
 | 
			
		||||
        mouse_report.x = 0;
 | 
			
		||||
        mouse_report.y = 0;
 | 
			
		||||
 | 
			
		||||
        mouse_report.x = 0;
 | 
			
		||||
        mouse_report.y = 0;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return pointing_device_task_user(mouse_report);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool process_record_kb(uint16_t keycode, keyrecord_t* record) {
 | 
			
		||||
    if (debug_mouse) {
 | 
			
		||||
        dprintf("KL: kc: %u, col: %u, row: %u, pressed: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Update Timer to prevent accidental scrolls
 | 
			
		||||
#ifdef ENCODER_ENABLE
 | 
			
		||||
    if ((record->event.key.col == ENCODER_BUTTON_COL) && (record->event.key.row == ENCODER_BUTTON_ROW)) {
 | 
			
		||||
        lastMidClick      = timer_read();
 | 
			
		||||
        is_scroll_clicked = record->event.pressed;
 | 
			
		||||
    }
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    if (!process_record_user(keycode, record)) {
 | 
			
		||||
        return false;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (keycode == DPI_CONFIG && record->event.pressed) {
 | 
			
		||||
        cycle_dpi();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (keycode == DRAG_SCROLL) {
 | 
			
		||||
#ifdef PLOOPY_DRAGSCROLL_MOMENTARY
 | 
			
		||||
        is_drag_scroll = record->event.pressed;
 | 
			
		||||
#else
 | 
			
		||||
        if (record->event.pressed) {
 | 
			
		||||
            toggle_drag_scroll();
 | 
			
		||||
        }
 | 
			
		||||
#endif
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return true;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Hardware Setup
 | 
			
		||||
void keyboard_pre_init_kb(void) {
 | 
			
		||||
    // debug_enable  = true;
 | 
			
		||||
    // debug_matrix  = true;
 | 
			
		||||
    // debug_mouse   = true;
 | 
			
		||||
    // debug_encoder = true;
 | 
			
		||||
 | 
			
		||||
    /* Ground all output pins connected to ground. This provides additional
 | 
			
		||||
     * pathways to ground. If you're messing with this, know this: driving ANY
 | 
			
		||||
     * of these pins high will cause a short. On the MCU. Ka-blooey.
 | 
			
		||||
     */
 | 
			
		||||
#ifdef UNUSABLE_PINS
 | 
			
		||||
    const pin_t unused_pins[] = UNUSABLE_PINS;
 | 
			
		||||
 | 
			
		||||
    for (uint8_t i = 0; i < ARRAY_SIZE(unused_pins); i++) {
 | 
			
		||||
        gpio_set_pin_output_push_pull(unused_pins[i]);
 | 
			
		||||
        gpio_write_pin_low(unused_pins[i]);
 | 
			
		||||
    }
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    // This is the debug LED.
 | 
			
		||||
#if defined(DEBUG_LED_PIN)
 | 
			
		||||
    gpio_set_pin_output_push_pull(DEBUG_LED_PIN);
 | 
			
		||||
    gpio_write_pin(DEBUG_LED_PIN, debug_enable);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    keyboard_pre_init_user();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void pointing_device_init_kb(void) {
 | 
			
		||||
    keyboard_config.raw = eeconfig_read_kb();
 | 
			
		||||
    if (keyboard_config.dpi_config > DPI_OPTION_SIZE) {
 | 
			
		||||
        eeconfig_init_kb();
 | 
			
		||||
    }
 | 
			
		||||
    pointing_device_set_cpi(dpi_array[keyboard_config.dpi_config]);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void eeconfig_init_kb(void) {
 | 
			
		||||
    keyboard_config.dpi_config = PLOOPY_DPI_DEFAULT;
 | 
			
		||||
    eeconfig_update_kb(keyboard_config.raw);
 | 
			
		||||
    eeconfig_init_user();
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										41
									
								
								keyboards/ploopyco/ploopyco.h
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										41
									
								
								keyboards/ploopyco/ploopyco.h
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,41 @@
 | 
			
		|||
/* Copyright 2020 Christopher Courtney, aka Drashna Jael're  (@drashna) <drashna@live.com>
 | 
			
		||||
 * Copyright 2019 Sunjun Kim
 | 
			
		||||
 * Copyright 2020 Ploopy Corporation
 | 
			
		||||
 *
 | 
			
		||||
 * This program is free software: you can redistribute it and/or modify
 | 
			
		||||
 * it under the terms of the GNU General Public License as published by
 | 
			
		||||
 * the Free Software Foundation, either version 2 of the License, or
 | 
			
		||||
 * (at your option) any later version.
 | 
			
		||||
 *
 | 
			
		||||
 * This program is distributed in the hope that it will be useful,
 | 
			
		||||
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
			
		||||
 * GNU General Public License for more details.
 | 
			
		||||
 *
 | 
			
		||||
 * You should have received a copy of the GNU General Public License
 | 
			
		||||
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#pragma once
 | 
			
		||||
 | 
			
		||||
#include "quantum.h"
 | 
			
		||||
 | 
			
		||||
typedef union {
 | 
			
		||||
    uint32_t raw;
 | 
			
		||||
    struct {
 | 
			
		||||
        uint8_t dpi_config;
 | 
			
		||||
    };
 | 
			
		||||
} keyboard_config_t;
 | 
			
		||||
 | 
			
		||||
extern keyboard_config_t keyboard_config;
 | 
			
		||||
extern uint16_t          dpi_array[];
 | 
			
		||||
 | 
			
		||||
enum ploopy_keycodes {
 | 
			
		||||
    DPI_CONFIG = QK_KB_0,
 | 
			
		||||
    DRAG_SCROLL,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
bool encoder_update_user(uint8_t index, bool clockwise);
 | 
			
		||||
bool encoder_update_kb(uint8_t index, bool clockwise);
 | 
			
		||||
void toggle_drag_scroll(void);
 | 
			
		||||
void cycle_dpi(void);
 | 
			
		||||
							
								
								
									
										24
									
								
								keyboards/ploopyco/trackball_nano/keymaps/t4corun/config.h
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								keyboards/ploopyco/trackball_nano/keymaps/t4corun/config.h
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,24 @@
 | 
			
		|||
/*
 | 
			
		||||
This program is free software: you can redistribute it and/or modify
 | 
			
		||||
it under the terms of the GNU General Public License as published by
 | 
			
		||||
the Free Software Foundation, either version 2 of the License, or
 | 
			
		||||
(at your option) any later version.
 | 
			
		||||
 | 
			
		||||
This program is distributed in the hope that it will be useful,
 | 
			
		||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
			
		||||
GNU General Public License for more details.
 | 
			
		||||
 | 
			
		||||
You should have received a copy of the GNU General Public License
 | 
			
		||||
along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#pragma once
 | 
			
		||||
 | 
			
		||||
#define PLOOPY_HOST_LED_CONTROL
 | 
			
		||||
#define PLOOPY_DRAGSCROLL_INVERT
 | 
			
		||||
#define PLOOPY_DRAGSCROLL_DIVISOR_H 25.0
 | 
			
		||||
#define PLOOPY_DRAGSCROLL_DIVISOR_V 20.0
 | 
			
		||||
 | 
			
		||||
#define PLOOPY_DPI_OPTIONS { 300, 550, 800, 1200 }
 | 
			
		||||
#define PLOOPY_DPI_DEFAULT 2
 | 
			
		||||
							
								
								
									
										50
									
								
								keyboards/ploopyco/trackball_nano/keymaps/t4corun/keymap.c
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										50
									
								
								keyboards/ploopyco/trackball_nano/keymaps/t4corun/keymap.c
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,50 @@
 | 
			
		|||
/*
 | 
			
		||||
This program is free software: you can redistribute it and/or modify
 | 
			
		||||
it under the terms of the GNU General Public License as published by
 | 
			
		||||
the Free Software Foundation, either version 2 of the License, or
 | 
			
		||||
(at your option) any later version.
 | 
			
		||||
 | 
			
		||||
This program is distributed in the hope that it will be useful,
 | 
			
		||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
			
		||||
GNU General Public License for more details.
 | 
			
		||||
 | 
			
		||||
You should have received a copy of the GNU General Public License
 | 
			
		||||
along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#include "t4corun.h"
 | 
			
		||||
 | 
			
		||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {{{ KC_NO }}};
 | 
			
		||||
 | 
			
		||||
static bool num_lock_state = false;
 | 
			
		||||
static bool scroll_lock_state = false;
 | 
			
		||||
 | 
			
		||||
void keyboard_post_init_user(void) {
 | 
			
		||||
 | 
			
		||||
    num_lock_state  = host_keyboard_led_state().num_lock;
 | 
			
		||||
    scroll_lock_state  = host_keyboard_led_state().scroll_lock;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool led_update_user(led_t led_state) {
 | 
			
		||||
 | 
			
		||||
    // when scroll lock is pressed, toggle drag scroll state
 | 
			
		||||
    if ( scroll_lock_state != led_state.scroll_lock ) {
 | 
			
		||||
        toggle_drag_scroll();
 | 
			
		||||
        scroll_lock_state = led_state.scroll_lock;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // when num lock is pressed, cycle dpi
 | 
			
		||||
    if ( num_lock_state != led_state.num_lock ) {
 | 
			
		||||
        cycle_dpi();
 | 
			
		||||
        num_lock_state = led_state.num_lock;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // when all three are enabled, go to bootloader
 | 
			
		||||
    if ( led_state.num_lock && led_state.caps_lock && led_state.scroll_lock ) {
 | 
			
		||||
        reset_keyboard();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return true;
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										14
									
								
								keyboards/ploopyco/trackball_nano/keymaps/t4corun/rules.mk
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								keyboards/ploopyco/trackball_nano/keymaps/t4corun/rules.mk
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,14 @@
 | 
			
		|||
# override userspace defaults
 | 
			
		||||
LTO_ENABLE = yes
 | 
			
		||||
DYNAMIC_MACRO_ENABLE = no
 | 
			
		||||
WPM_ENABLE = no
 | 
			
		||||
EXTRAKEY_ENABLE = no
 | 
			
		||||
CAPS_WORD_ENABLE = no
 | 
			
		||||
MOUSEKEY_ENABLE = no
 | 
			
		||||
COMBO_ENABLE = no
 | 
			
		||||
KEY_OVERRIDE_ENABLE = no
 | 
			
		||||
 | 
			
		||||
# override keyboard defaults
 | 
			
		||||
#	keyboards\ploopyco\trackball_nano\info.json
 | 
			
		||||
#	keyboards\ploopyco\trackball_nano\rules.mk
 | 
			
		||||
#	keyboards\ploopyco\postrules.mk
 | 
			
		||||
							
								
								
									
										2
									
								
								qmk.json
									
										
									
									
									
								
							
							
						
						
									
										2
									
								
								qmk.json
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -8,7 +8,7 @@
 | 
			
		|||
		["bluebell/swoop", "t4corun"],
 | 
			
		||||
		["barbellboards/rollow", "t4corun"],
 | 
			
		||||
		["klor/2040", "t4corun"],
 | 
			
		||||
		["klor/2040", "saegewerk"]
 | 
			
		||||
		["ploopyco/trackball_nano", "t4corun"]
 | 
			
		||||
 | 
			
		||||
	]
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -1,6 +1,7 @@
 | 
			
		|||
{
 | 
			
		||||
	"nontree_targets": [
 | 
			
		||||
		"barbellboards",
 | 
			
		||||
		"klor"
 | 
			
		||||
		"klor",
 | 
			
		||||
		"ploopyco"
 | 
			
		||||
	]
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -36,7 +36,7 @@ bool combo_should_trigger(uint16_t combo_index, combo_t *combo, uint16_t keycode
 | 
			
		|||
//  case MOUSE_BUTTON5:
 | 
			
		||||
 | 
			
		||||
    case MOUSE_DRGTOG:
 | 
			
		||||
      if ( get_highest_layer(layer_state | default_layer_state) > _DEFAULT_LAYER_1 ) return false;
 | 
			
		||||
      if ( get_highest_layer(layer_state | default_layer_state) > FIRST_DEFAULT_LAYER ) return false;
 | 
			
		||||
 | 
			
		||||
    default:
 | 
			
		||||
      return true;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -115,7 +115,7 @@ void render_feature_status(bool vertical) {
 | 
			
		|||
#endif //RGB_MATRIX_ENABLED
 | 
			
		||||
 | 
			
		||||
  // only works on master side
 | 
			
		||||
  drag_scroll_is_enabled() ? oled_write_P(dragscr_on, false) : oled_write_P(dragscr_off, false);
 | 
			
		||||
  host_keyboard_led_state().scroll_lock ? oled_write_P(dragscr_on, false) : oled_write_P(dragscr_off, false);
 | 
			
		||||
 | 
			
		||||
  if (vertical) {
 | 
			
		||||
    oled_write_P(PSTR(" "), false);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,6 +1,11 @@
 | 
			
		|||
#pragma once
 | 
			
		||||
#include "t4corun.h"
 | 
			
		||||
 | 
			
		||||
// Tells the process_tap_hold_key what kind of hold action is wanted
 | 
			
		||||
#define HOLD_SINGLETP 0
 | 
			
		||||
#define HOLD_DOUBLETP 1
 | 
			
		||||
#define HOLD_BRACKETS 2
 | 
			
		||||
 | 
			
		||||
void single_tap(uint16_t key);
 | 
			
		||||
void double_tap(uint16_t key, uint32_t ms);
 | 
			
		||||
void insert_brackets(uint16_t left, uint16_t right, uint32_t ms);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2,21 +2,12 @@
 | 
			
		|||
 | 
			
		||||
// Keeps track of base layer so we can make one key to cycle through them
 | 
			
		||||
// instead of making a key for each one */
 | 
			
		||||
static uint8_t current_base_layer  = _DEFAULT_LAYER_1;
 | 
			
		||||
 | 
			
		||||
// Should keep track of the Ploopy Nano drag scroll mode
 | 
			
		||||
// There is a possibility of this being out of sync
 | 
			
		||||
static bool drag_scroll_enabled = false;
 | 
			
		||||
static uint8_t current_base_layer  = FIRST_DEFAULT_LAYER;
 | 
			
		||||
 | 
			
		||||
// Luna Pet Variables
 | 
			
		||||
static bool isJumping = false;
 | 
			
		||||
static bool showedJump = true;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// Allows the OLED code to get the drag scroll mode
 | 
			
		||||
bool drag_scroll_is_enabled(void) { return drag_scroll_enabled; }
 | 
			
		||||
 | 
			
		||||
// Allows the OLED code to see when space bar is pressed
 | 
			
		||||
bool isLunaJumping(void) { return isJumping; }
 | 
			
		||||
bool isJumpShown(void) { return showedJump; }
 | 
			
		||||
| 
						 | 
				
			
			@ -24,14 +15,51 @@ bool isJumpShown(void) { return showedJump; }
 | 
			
		|||
// Allows the OLED code to clear the space bar status when render is complete
 | 
			
		||||
void setLunaJumped(void) { showedJump = true;}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// Hold Navigation and Number to get Symbol
 | 
			
		||||
layer_state_t layer_state_set_user(layer_state_t  state) { return update_tri_layer_state(state, _NAVIGATION, _NUMBER, _SYMBOL); }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// Customize behavior for existing keycodes or create new ones
 | 
			
		||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
 | 
			
		||||
 | 
			
		||||
  switch (keycode) {
 | 
			
		||||
 | 
			
		||||
    // use the host state status to boot the Ploopy Nano
 | 
			
		||||
    // will effectively turn on num lock/caps lock/scroll lock then back off
 | 
			
		||||
    case PN_BOOT:
 | 
			
		||||
      if (record->event.pressed) {
 | 
			
		||||
        if(!host_keyboard_led_state().num_lock) { tap_code(KC_NUM); }
 | 
			
		||||
        if(!host_keyboard_led_state().caps_lock) { tap_code(KC_CAPS); }
 | 
			
		||||
        if(!host_keyboard_led_state().scroll_lock) { tap_code(KC_SCRL); }
 | 
			
		||||
      } else {
 | 
			
		||||
        if(host_keyboard_led_state().num_lock) { tap_code(KC_NUM); }
 | 
			
		||||
        if(host_keyboard_led_state().caps_lock) { tap_code(KC_CAPS); }
 | 
			
		||||
        if(host_keyboard_led_state().scroll_lock) { tap_code(KC_SCRL); }
 | 
			
		||||
      }
 | 
			
		||||
      return false;
 | 
			
		||||
 | 
			
		||||
    // makes scroll lock a hold instead of toggle
 | 
			
		||||
    // enables momentary drag scroll on ploopy nano
 | 
			
		||||
    case KC_SCRL:
 | 
			
		||||
      if (record->event.pressed) {
 | 
			
		||||
        tap_code(KC_SCRL);
 | 
			
		||||
      } else {
 | 
			
		||||
        tap_code(KC_SCRL);
 | 
			
		||||
      }
 | 
			
		||||
      return false;
 | 
			
		||||
 | 
			
		||||
    // makes num lock a hold instead of toggle
 | 
			
		||||
    // prevents accidental ploopy nano going into bootloader
 | 
			
		||||
    case KC_NUM:
 | 
			
		||||
      if (record->event.pressed) {
 | 
			
		||||
        tap_code(KC_NUM);
 | 
			
		||||
      } else {
 | 
			
		||||
        tap_code(KC_NUM);
 | 
			
		||||
      }
 | 
			
		||||
      return false;
 | 
			
		||||
 | 
			
		||||
    case KC_SPC:
 | 
			
		||||
      if (record->event.pressed) {
 | 
			
		||||
        isJumping = true;
 | 
			
		||||
| 
						 | 
				
			
			@ -45,7 +73,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
 | 
			
		|||
    case BASELYR:
 | 
			
		||||
      if (record->event.pressed) {
 | 
			
		||||
 | 
			
		||||
        current_base_layer = (current_base_layer + 1) % NUM_BASE_LAYER; 
 | 
			
		||||
        current_base_layer = (current_base_layer + 1) % NUM_DEFAULT_LAYERS; 
 | 
			
		||||
        set_single_persistent_default_layer(current_base_layer);
 | 
			
		||||
 | 
			
		||||
      }
 | 
			
		||||
| 
						 | 
				
			
			@ -54,34 +82,12 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
 | 
			
		|||
    case RBSELYR:
 | 
			
		||||
      if (record->event.pressed) { 
 | 
			
		||||
 | 
			
		||||
        current_base_layer = (current_base_layer - 1) % NUM_BASE_LAYER; 
 | 
			
		||||
        current_base_layer = (current_base_layer - 1) % NUM_DEFAULT_LAYERS; 
 | 
			
		||||
        set_single_persistent_default_layer(current_base_layer);
 | 
			
		||||
 | 
			
		||||
      }
 | 
			
		||||
      return false;
 | 
			
		||||
 | 
			
		||||
    case PN_DRGS:
 | 
			
		||||
      if (record->event.pressed) {
 | 
			
		||||
 | 
			
		||||
        //tap numlock twice to toggle ploopy nano drag scroll
 | 
			
		||||
        // double_tap(KC_NUM, KC_NUM, WAIT_DELAY);
 | 
			
		||||
        double_tap(KC_NUM, WAIT_DELAY);
 | 
			
		||||
 | 
			
		||||
        //I realize this may not work for the Charybdis nano
 | 
			
		||||
        drag_scroll_enabled = !drag_scroll_enabled;
 | 
			
		||||
        
 | 
			
		||||
      }
 | 
			
		||||
      return false;
 | 
			
		||||
 | 
			
		||||
    case PN_PDPI:
 | 
			
		||||
      if (record->event.pressed) {
 | 
			
		||||
 | 
			
		||||
        //tap capslock twice to cycle ploopy nano pointer DPI
 | 
			
		||||
        //double_tap(KC_CAPS, KC_CAPS, WAIT_DELAY);
 | 
			
		||||
        double_tap(KC_CAPS, WAIT_DELAY);
 | 
			
		||||
 | 
			
		||||
      }
 | 
			
		||||
      return false;
 | 
			
		||||
 | 
			
		||||
    //https://docs.qmk.fm/#/mod_tap?id=changing-both-tasp-and-hold
 | 
			
		||||
    //https://getreuer.info/posts/keyboards/triggers/index.html#tap-vs.-long-press
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2,11 +2,11 @@
 | 
			
		|||
#include QMK_KEYBOARD_H
 | 
			
		||||
#include "features/taphold.h"
 | 
			
		||||
 | 
			
		||||
bool drag_scroll_is_enabled(void);
 | 
			
		||||
bool isLunaJumping(void);
 | 
			
		||||
bool isJumpShown(void);
 | 
			
		||||
void setLunaJumped(void);
 | 
			
		||||
 | 
			
		||||
// put the default base layers first
 | 
			
		||||
enum layers {
 | 
			
		||||
  _QWERTY = 0,
 | 
			
		||||
  FIRST_DEFAULT_LAYER = 0,
 | 
			
		||||
| 
						 | 
				
			
			@ -18,6 +18,11 @@ enum layers {
 | 
			
		|||
  _CONFIG
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
// start at the second layer
 | 
			
		||||
#define _DEFAULT_LAYER_2 (FIRST_DEFAULT_LAYER + 1)
 | 
			
		||||
#define _DEFAULT_LAYER_3 (FIRST_DEFAULT_LAYER + 2)
 | 
			
		||||
#define NUM_DEFAULT_LAYERS 3
 | 
			
		||||
 | 
			
		||||
enum keycodes {
 | 
			
		||||
  //These are only here to make the taphold/defines unique
 | 
			
		||||
  TH_LCBR = QK_USER,
 | 
			
		||||
| 
						 | 
				
			
			@ -41,8 +46,7 @@ enum keycodes {
 | 
			
		|||
  TH_SCLN,
 | 
			
		||||
  TH_QUOT,
 | 
			
		||||
 | 
			
		||||
  PN_DRGS,
 | 
			
		||||
  PN_PDPI,
 | 
			
		||||
  PN_BOOT,
 | 
			
		||||
 | 
			
		||||
  BASELYR,
 | 
			
		||||
  RBSELYR
 | 
			
		||||
| 
						 | 
				
			
			@ -84,34 +88,29 @@ enum keycodes {
 | 
			
		|||
 | 
			
		||||
// tap hoLd. These will be intercepted and overridden. The LT will be ignored
 | 
			
		||||
// Brackets: open and close brackets and put the cursor inside
 | 
			
		||||
#define TR_LCBR  LT(_DEFAULT_LAYER_1, TH_LCBR)
 | 
			
		||||
#define TR_LABK  LT(_DEFAULT_LAYER_1, TH_LABK)
 | 
			
		||||
#define TR_LBRC  LT(_DEFAULT_LAYER_1, TH_LBRC)
 | 
			
		||||
#define TR_LPRN  LT(_DEFAULT_LAYER_1, TH_LPRN)
 | 
			
		||||
#define TR_DQUO  LT(_DEFAULT_LAYER_1, TH_DQUO)
 | 
			
		||||
#define TR_SQUO  LT(_DEFAULT_LAYER_1, TH_SQUO)
 | 
			
		||||
#define TR_LCBR  LT(FIRST_DEFAULT_LAYER, TH_LCBR)
 | 
			
		||||
#define TR_LABK  LT(FIRST_DEFAULT_LAYER, TH_LABK)
 | 
			
		||||
#define TR_LBRC  LT(FIRST_DEFAULT_LAYER, TH_LBRC)
 | 
			
		||||
#define TR_LPRN  LT(FIRST_DEFAULT_LAYER, TH_LPRN)
 | 
			
		||||
#define TR_DQUO  LT(FIRST_DEFAULT_LAYER, TH_DQUO)
 | 
			
		||||
#define TR_SQUO  LT(FIRST_DEFAULT_LAYER, TH_SQUO)
 | 
			
		||||
 | 
			
		||||
// double tap
 | 
			
		||||
#define TR_BSLS  LT(_DEFAULT_LAYER_1, TH_BSLS)
 | 
			
		||||
#define TR_SLSH  LT(_DEFAULT_LAYER_1, TH_SLSH)
 | 
			
		||||
#define TR_PIPE  LT(_DEFAULT_LAYER_1, TH_PIPE)
 | 
			
		||||
#define TR_BSLS  LT(FIRST_DEFAULT_LAYER, TH_BSLS)
 | 
			
		||||
#define TR_SLSH  LT(FIRST_DEFAULT_LAYER, TH_SLSH)
 | 
			
		||||
#define TR_PIPE  LT(FIRST_DEFAULT_LAYER, TH_PIPE)
 | 
			
		||||
 | 
			
		||||
// Custom override without holding shift
 | 
			
		||||
#define TR_COMM  LT(_DEFAULT_LAYER_1, TH_COMM)
 | 
			
		||||
#define TR_DOT   LT(_DEFAULT_LAYER_1, TH_DOT)
 | 
			
		||||
#define TR_PERC  LT(_DEFAULT_LAYER_1, TH_PERC)
 | 
			
		||||
#define TR_COMM  LT(FIRST_DEFAULT_LAYER, TH_COMM)
 | 
			
		||||
#define TR_DOT   LT(FIRST_DEFAULT_LAYER, TH_DOT)
 | 
			
		||||
#define TR_PERC  LT(FIRST_DEFAULT_LAYER, TH_PERC)
 | 
			
		||||
 | 
			
		||||
// auto shift
 | 
			
		||||
#define TR_EQL   LT(_DEFAULT_LAYER_1, TH_EQL)
 | 
			
		||||
#define TR_MINS  LT(_DEFAULT_LAYER_1, TH_MINS)
 | 
			
		||||
#define TR_GRV   LT(_DEFAULT_LAYER_1, TH_GRV)
 | 
			
		||||
#define TR_SCLN  LT(_DEFAULT_LAYER_1, TH_SCLN)
 | 
			
		||||
#define TR_QUOT  LT(_DEFAULT_LAYER_1, TH_QUOT)
 | 
			
		||||
 | 
			
		||||
// Tells the process_tap_hold_key what kind of hold action is wanted
 | 
			
		||||
#define HOLD_SINGLETP 0
 | 
			
		||||
#define HOLD_DOUBLETP 1
 | 
			
		||||
#define HOLD_BRACKETS 2
 | 
			
		||||
#define TR_EQL   LT(FIRST_DEFAULT_LAYER, TH_EQL)
 | 
			
		||||
#define TR_MINS  LT(FIRST_DEFAULT_LAYER, TH_MINS)
 | 
			
		||||
#define TR_GRV   LT(FIRST_DEFAULT_LAYER, TH_GRV)
 | 
			
		||||
#define TR_SCLN  LT(FIRST_DEFAULT_LAYER, TH_SCLN)
 | 
			
		||||
#define TR_QUOT  LT(FIRST_DEFAULT_LAYER, TH_QUOT)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#if defined(KEYBOARD_bastardkb_charybdis_3x5)
 | 
			
		||||
| 
						 | 
				
			
			@ -122,9 +121,9 @@ enum keycodes {
 | 
			
		|||
#   define TR_PDPI DPI_MOD  //pointer dpi
 | 
			
		||||
#else
 | 
			
		||||
#   define TR_SNIP ___x___
 | 
			
		||||
#   define TR_DRGS PN_DRGS  //use host status for ploopy nano drag scroll
 | 
			
		||||
#   define TR_DRGS KC_SCRL  //use host status for ploopy nano drag scroll
 | 
			
		||||
#   define TR_SDPI ___x___
 | 
			
		||||
#   define TR_PDPI PN_PDPI  //use host status for ploopy nano dpi switch
 | 
			
		||||
#   define TR_PDPI KC_NUM   //use host status for ploopy nano dpi switch
 | 
			
		||||
#endif //KEYBOARD_bastardkb_charybdis_3x5
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -184,13 +183,6 @@ enum keycodes {
 | 
			
		|||
#endif //AUDIO_ENABLE
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#define _DEFAULT_LAYER_1 FIRST_DEFAULT_LAYER
 | 
			
		||||
#define _DEFAULT_LAYER_2 (FIRST_DEFAULT_LAYER + 1)
 | 
			
		||||
#define _DEFAULT_LAYER_3 (FIRST_DEFAULT_LAYER + 2)
 | 
			
		||||
#define NUM_BASE_LAYER 3
 | 
			
		||||
 | 
			
		||||
#define _NONE_3__________________                   ___x___, ___x___, ___x___
 | 
			
		||||
#define _NONE_5____________________________________ ___x___, ___x___, ___x___, ___x___, ___x___
 | 
			
		||||
#define _GACS_MODS________________________          TR_LGUI, TR_LALT, TR_LCTL, TR_LSFT
 | 
			
		||||
| 
						 | 
				
			
			@ -227,7 +219,7 @@ enum keycodes {
 | 
			
		|||
 | 
			
		||||
#define LAYER_NAVIGATION                                                                    \
 | 
			
		||||
  KC_ESC,  KC_HOME, KC_UP,   KC_END,  KC_PGUP, ___x___, ___x___, SC_FILE, SC_SNIP, CONFIG,  \
 | 
			
		||||
  ___x___, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, ___x___, _SCAG_MODS________________________, \
 | 
			
		||||
  KC_CAPS, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, ___x___, _SCAG_MODS________________________, \
 | 
			
		||||
  _UCCPR_L___________________________________, ___x___, KC_APP,  TR_SNIP, TR_SDPI, TR_PDPI, \
 | 
			
		||||
                    ZOOMRST, NUM,     KC_ENT,  _LAYER_TRANS_____________
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -240,14 +232,14 @@ enum keycodes {
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
#define LAYER_SYMBOL                                                                        \
 | 
			
		||||
  ___x___, ___x___, KC_AMPR, TR_PERC, TR_GRV,  TR_EQL,  KC_HASH, KC_ASTR, ___x___, TR_DQUO, \
 | 
			
		||||
  KC_CAPS, TR_LCBR, KC_RCBR, KC_EXLM, TR_SCLN, KC_AT,   KC_QUES, TR_LBRC, KC_RBRC, TR_SQUO, \
 | 
			
		||||
  ___x___, TR_LABK, KC_RABK, TR_BSLS, TR_PIPE, KC_DLR,  TR_SLSH, TR_LPRN, KC_RPRN, TR_MINS, \
 | 
			
		||||
  ___x___, ___x___, KC_AT,   KC_DLR,  TR_GRV,  TR_EQL,  KC_HASH, KC_ASTR, ___x___, TR_DQUO, \
 | 
			
		||||
  ___x___, TR_LCBR, KC_RCBR, KC_EXLM, TR_SCLN, KC_AMPR, KC_QUES, TR_LBRC, KC_RBRC, TR_SQUO, \
 | 
			
		||||
  ___x___, TR_LABK, KC_RABK, TR_BSLS, TR_PIPE, TR_PERC, TR_SLSH, TR_LPRN, KC_RPRN, TR_MINS, \
 | 
			
		||||
                    _LAYER_TRANS_____________, _LAYER_TRANS_____________
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#define LAYER_CONFIG                                                                        \
 | 
			
		||||
  TR_HRST, TR_HCNU, TR_HNXT, TR_HFBK, TR_HTOG, ___x___, ___x___, EE_CLR,  QK_BOOT, _______, \
 | 
			
		||||
  TR_HRST, TR_HCNU, TR_HNXT, TR_HFBK, TR_HTOG, ___x___, PN_BOOT, EE_CLR,  QK_BOOT, _______, \
 | 
			
		||||
  TR_CRST, TR_CKUP, TR_CTOG, ___x___, TR_ATOG, ___x___, TR_LSFT, ___x___, ___x___, TR_RMOD, \
 | 
			
		||||
  KC_MUTE, KC_VOLD, KC_VOLU, KC_MNXT, KC_MPLY, TR_RTOG, TR_RHUI, TR_RSAI, TR_RVAI, TR_RSPI, \
 | 
			
		||||
                    BASELYR, TR_DMR1, TR_DMP1, ___x___, ___x___, TR_RTOG
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue