Merge branch 'master' into hid_joystick

This commit is contained in:
a-chol 2020-03-30 14:41:56 +02:00 committed by GitHub
commit a80ea8b7cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
284 changed files with 9404 additions and 2408 deletions

View file

@ -0,0 +1,163 @@
/* Copyright 2020
*
* 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 "keymap.h"
// clang-format off
/*
*
*  ¸  1  2  3  4  5  6  7  8  9  0  '  +        
*
*       Q  W  E  R  T  Z  U  I  O  P  Š  Đ      
*     
*        A  S  D  F  G  H  J  K  L  Č  Ć  Ž     
*
*      <  Y  X  C  V  B  N  M  ,  .  -           
*
*                                                     
*
*/
// Row 1
#define HR_CEDL KC_GRV // ¸ (dead)
#define HR_1 KC_1 // 1
#define HR_2 KC_2 // 2
#define HR_3 KC_3 // 3
#define HR_4 KC_4 // 4
#define HR_5 KC_5 // 5
#define HR_6 KC_6 // 6
#define HR_7 KC_7 // 7
#define HR_8 KC_8 // 8
#define HR_9 KC_9 // 9
#define HR_0 KC_0 // 0
#define HR_QUOT KC_MINS // '
#define HR_PLUS KC_EQL // +
// Row 2
#define HR_Q KC_Q // Q
#define HR_W KC_W // W
#define HR_E KC_E // E
#define HR_R KC_R // R
#define HR_T KC_T // T
#define HR_Z KC_Y // Z
#define HR_U KC_U // U
#define HR_I KC_I // I
#define HR_O KC_O // O
#define HR_P KC_P // P
#define HR_SCAR KC_LBRC // Š
#define HR_DSTR KC_RBRC // Đ
// Row 3
#define HR_A KC_A // A
#define HR_S KC_S // S
#define HR_D KC_D // D
#define HR_F KC_F // F
#define HR_G KC_G // G
#define HR_H KC_H // H
#define HR_J KC_J // J
#define HR_K KC_K // K
#define HR_L KC_L // L
#define HR_CCAR KC_SCLN // Č
#define HR_CACU KC_QUOT // Ć
#define HR_ZCAR KC_NUHS // Ž
// Row 4
#define HR_LABK KC_NUBS // <
#define HR_Y KC_Z // Y
#define HR_X KC_X // X
#define HR_C KC_C // C
#define HR_V KC_V // V
#define HR_B KC_B // B
#define HR_N KC_N // N
#define HR_M KC_M // M
#define HR_COMM KC_COMM // ,
#define HR_DOT KC_DOT // .
#define HR_MINS KC_SLSH // -
/* Shifted symbols
*
*  ¨  !  " │ # │ $ │ % │ & │ / │ ( │ ) │ = │ ? │ * │       │
*
*                                               
*     
*                                               
*
*      >                       ;  :  _           
*
*                                                     
*
*/
// Row 1
#define HR_DIAE S(HR_CEDL) // ¨ (dead)
#define HR_EXLM S(HR_1) // !
#define HR_DQUO S(HR_2) // "
#define HR_HASH S(HR_3) // #
#define HR_DLR S(HR_4) // $
#define HR_PERC S(HR_5) // %
#define HR_AMPR S(HR_6) // &
#define HR_SLSH S(HR_7) // /
#define HR_LPRN S(HR_8) // (
#define HR_RPRN S(HR_9) // )
#define HR_EQL S(HR_0) // =
#define HR_QUES S(HR_QUOT) // ?
#define HR_ASTR S(HR_PLUS) // *
// Row 4
#define HR_RABK S(HR_LABK) // >
#define HR_SCLN S(HR_COMM) // ;
#define HR_COLN S(HR_DOT) // :
#define HR_UNDS S(HR_MINS) // _
/* AltGr symbols
*
*     ~  ˇ  ^  ˘  °  ˛  `  ˙  ´  ˝              
*
*       \  |                         ÷  ×      
*     
*                 [  ]        ł  Ł     ß  ¤     
*
*                  @  {  }  §                    
*
*                                                     
*
*/
// Row 1
#define HR_TILD ALGR(HR_1) // ~
#define HR_CARN ALGR(HR_2) // ˇ (dead)
#define HR_CIRC ALGR(HR_3) // ^ (dead)
#define HR_BREV ALGR(HR_4) // ˘ (dead)
#define HR_RNGA ALGR(HR_5) // ° (dead)
#define HR_OGON ALGR(HR_6) // ˛ (dead)
#define HR_GRV ALGR(HR_7) // `
#define HR_DOTA ALGR(HR_8) // ˙ (dead)
#define HR_ACUT ALGR(HR_9) // ´ (dead)
#define HR_DACU ALGR(HR_0) // ˝ (dead)
// Row 2
#define HR_BSLS ALGR(HR_Q) // (backslash)
#define HR_PIPE ALGR(HR_W) // |
#define HR_EURO ALGR(HR_E) // €
#define HR_DIV ALGR(HR_SCAR) // ÷
#define HR_MUL ALGR(HR_DSTR) // ×
// Row 3
#define HR_LBRC ALGR(HR_F) // [
#define HR_RBRC ALGR(HR_G) // ]
#define HR_LLST ALGR(HR_K) // ł
#define HR_CLST ALGR(HR_L) // Ł
#define HR_SS ALGR(HR_CACU) // ß
#define HR_CURR ALGR(HR_ZCAR) // ¤
// Row 4
#define HR_AT ALGR(HR_V) // @
#define HR_LCBR ALGR(HR_B) // {
#define HR_RCBR ALGR(HR_N) // }
#define HR_SECT ALGR(HR_M) // §

View file

@ -0,0 +1,173 @@
/* Copyright 2020
*
* 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 "keymap.h"
// clang-format off
/*
*
*  ;  +  ě  š  č  ř  ž  ý  á  í  é  =  ´        
*
*       Q  W  E  R  T  Z  U  I  O  P  ú  )      
*     
*        A  S  D  F  G  H  J  K  L  ů  §  ¨     
*
*      \  Y  X  C  V  B  N  M  ,  .  -           
*
*                                                     
*
*/
// Row 1
#define CZ_SCLN KC_GRV // ;
#define CZ_PLUS KC_1 // +
#define CZ_ECAR KC_2 // ě
#define CZ_SCAR KC_3 // š
#define CZ_CCAR KC_4 // č
#define CZ_RCAR KC_5 // ř
#define CZ_ZCAR KC_6 // ž
#define CZ_YACU KC_7 // ý
#define CZ_AACU KC_8 // á
#define CZ_IACU KC_9 // í
#define CZ_EACU KC_0 // é
#define CZ_EQL KC_MINS // =
#define CZ_ACUT KC_EQL // ´ (dead)
// Row 2
#define CZ_Q KC_Q // Q
#define CZ_W KC_W // W
#define CZ_E KC_E // E
#define CZ_R KC_R // R
#define CZ_T KC_T // T
#define CZ_Z KC_Y // Z
#define CZ_U KC_U // U
#define CZ_I KC_I // I
#define CZ_O KC_O // O
#define CZ_P KC_P // P
#define CZ_UACU KC_LBRC // ú
#define CZ_RPRN KC_RBRC // )
// Row 3
#define CZ_A KC_A // A
#define CZ_S KC_S // S
#define CZ_D KC_D // D
#define CZ_F KC_F // F
#define CZ_G KC_G // G
#define CZ_H KC_H // H
#define CZ_J KC_J // J
#define CZ_K KC_K // K
#define CZ_L KC_L // L
#define CZ_URNG KC_SCLN // ů
#define CZ_SECT KC_QUOT // §
#define CZ_DIAE KC_NUHS // ¨ (dead)
// Row 4
#define CZ_BSLS KC_NUBS // (backslash)
#define CZ_Y KC_Z // Y
#define CZ_X KC_X // X
#define CZ_C KC_C // C
#define CZ_V KC_V // V
#define CZ_B KC_B // B
#define CZ_N KC_N // N
#define CZ_M KC_M // M
#define CZ_COMM KC_COMM // ,
#define CZ_DOT KC_DOT // .
#define CZ_MINS KC_SLSH // -
/* Shifted symbols
*
*  °  1  2  3  4  5  6  7  8  9  0  %  ˇ        
*
*                                     /  (      
*     
*                                   " │ ! │ ' │    │
*
*      |                       ;  :  _           
*
*                                                     
*
*/
// Row 1
#define CZ_RNGA S(CZ_SCLN) // ° (dead)
#define CZ_1 S(CZ_PLUS) // 1
#define CZ_2 S(CZ_ECAR) // 2
#define CZ_3 S(CZ_SCAR) // 3
#define CZ_4 S(CZ_CCAR) // 4
#define CZ_5 S(CZ_RCAR) // 5
#define CZ_6 S(CZ_ZCAR) // 6
#define CZ_7 S(CZ_YACU) // 7
#define CZ_8 S(CZ_AACU) // 8
#define CZ_9 S(CZ_IACU) // 9
#define CZ_0 S(CZ_EACU) // 0
#define CZ_PERC S(CZ_PLUS) // %
#define CZ_CARN S(CZ_ACUT) // ˇ (dead)
// Row 2
#define CZ_SLSH S(CZ_UACU) // /
#define CZ_LPRN S(CZ_RPRN) // (
// Row 3
#define CZ_DQUO S(CZ_URNG) // "
#define CZ_EXLM S(CZ_SECT) // !
#define CZ_QUOT S(CZ_DIAE) // '
// Row 4
#define CZ_PIPE S(CZ_BSLS) // |
#define CZ_SCLN S(CZ_COMM) // ;
#define CZ_COLN S(CZ_DOT) // :
#define CZ_UNDS S(CZ_MINS) // _
/* AltGr symbols
*
*     ~     ^  ˘     ˛  `  ˙     ˝     ¸        
*
*                                    ÷  ×      
*     
*           đ  Đ  [  ]        ł  Ł  $  ß  ¤     
*
*            #  &  @  {  }     <  >  *           
*
*                                                     
*
*/
// Row 1
#define CZ_TILD ALGR(CZ_PLUS) // ~
#define CZ_CIRC ALGR(CZ_SCAR) // ^ (dead)
#define CZ_BREV ALGR(CZ_CCAR) // ˘ (dead)
#define CZ_OGON ALGR(CZ_ZCAR) // ˛ (dead)
#define CZ_GRV ALGR(CZ_YACU) // ` (dead)
#define CZ_DOTA ALGR(CZ_AACU) // ˙ (dead)
#define CZ_DACU ALGR(CZ_EACU) // ˝ (dead)
#define CZ_CEDL ALGR(CZ_ACUT) // ¸ (dead)
// Row 2
#define CZ_EURO ALGR(CZ_E) // €
#define CZ_DIV ALGR(CZ_UACU) // ÷
#define CZ_MUL ALGR(CZ_RPRN) // ×
// Row 3
#define CZ_LDST ALGR(CZ_S) // đ
#define CZ_CDST ALGR(CZ_D) // Đ
#define CZ_LBRC ALGR(CZ_F) // [
#define CZ_RBRC ALGR(CZ_G) // ]
#define CZ_LLST ALGR(CZ_K) // ł
#define CZ_CLST ALGR(CZ_L) // Ł
#define CZ_DLR ALGR(CZ_URNG) // $
#define CZ_SS ALGR(CZ_SECT) // ß
#define CZ_CURR ALGR(CZ_DIAE) // ¤
// Row 4
#define CZ_HASH ALGR(CZ_X) // #
#define CZ_AMPR ALGR(CZ_C) // &
#define CZ_AT ALGR(CZ_V) // @
#define CZ_LCBR ALGR(CZ_B) // {
#define CZ_RCBR ALGR(CZ_N) // }
#define CZ_LABK ALGR(CZ_COMM) // <
#define CZ_RABK ALGR(CZ_DOT) // >
#define CZ_ASTR ALGR(CZ_MINS) // *

View file

@ -0,0 +1,155 @@
/* Copyright 2020
*
* 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 "keymap.h"
// clang-format off
/*
*
*  ˇ  1  2  3  4  5  6  7  8  9  0  +  ´        
*
*       Q  W  E  R  T  Y  U  I  O  P  Ü  Õ      
*     
*        A  S  D  F  G  H  J  K  L  Ö  Ä  '     
*
*      <  Z  X  C  V  B  N  M  ,  .  -           
*
*                                                     
*
*/
// Row 1
#define EE_CARN KC_GRV // ˇ (dead)
#define EE_1 KC_1 // 1
#define EE_2 KC_2 // 2
#define EE_3 KC_3 // 3
#define EE_4 KC_4 // 4
#define EE_5 KC_5 // 5
#define EE_6 KC_6 // 6
#define EE_7 KC_7 // 7
#define EE_8 KC_8 // 8
#define EE_9 KC_9 // 9
#define EE_0 KC_0 // 0
#define EE_PLUS KC_MINS // +
#define EE_ACUT KC_EQL // ´ (dead)
// Row 2
#define EE_Q KC_Q // Q
#define EE_W KC_W // W
#define EE_E KC_E // E
#define EE_R KC_R // R
#define EE_T KC_T // T
#define EE_Y KC_Y // Y
#define EE_U KC_U // U
#define EE_I KC_I // I
#define EE_O KC_O // O
#define EE_P KC_P // P
#define EE_UDIA KC_LBRC // Ü
#define EE_OTIL KC_RBRC // Õ
// Row 3
#define EE_A KC_A // A
#define EE_S KC_S // S
#define EE_D KC_D // D
#define EE_F KC_F // F
#define EE_G KC_G // G
#define EE_H KC_H // H
#define EE_J KC_J // J
#define EE_K KC_K // K
#define EE_L KC_L // L
#define EE_ODIA KC_SCLN // Ö
#define EE_ADIA KC_QUOT // Ä
#define EE_QUOT KC_NUHS // '
// Row 4
#define EE_LABK KC_NUBS // <
#define EE_Z KC_Z // Z
#define EE_X KC_X // X
#define EE_C KC_C // C
#define EE_V KC_V // V
#define EE_B KC_B // B
#define EE_N KC_N // N
#define EE_M KC_M // M
#define EE_COMM KC_COMM // ,
#define EE_DOT KC_DOT // .
#define EE_MINS KC_SLSH // -
/* Shifted symbols
*
*  ~  !  " │ # │ ¤ │ % │ & │ / │ ( │ ) │ = │ ? │ ` │       │
*
*                                               
*     
*                                         *     
*
*      >                       ;  :  _           
*
*                                                     
*
*/
// Row 1
#define EE_TILD S(EE_CARN) // ~ (dead)
#define EE_EXLM S(EE_1) // !
#define EE_DQUO S(EE_2) // "
#define EE_HASH S(EE_3) // #
#define EE_CURR S(EE_4) // ¤
#define EE_PERC S(EE_5) // %
#define EE_AMPR S(EE_6) // &
#define EE_SLSH S(EE_7) // /
#define EE_LPRN S(EE_8) // (
#define EE_RPRN S(EE_9) // )
#define EE_EQL S(EE_0) // =
#define EE_QUES S(EE_PLUS) // ?
#define EE_GRV S(EE_ACUT) // ` (dead)
// Row 3
#define EE_ASTR S(EE_QUOT) // *
// Row 4
#define EE_RABK S(EE_LABK) // >
#define EE_SCLN S(EE_COMM) // ;
#define EE_COLN S(EE_DOT) // :
#define EE_UNDS S(EE_MINS) // _
/* AltGr symbols
*
*        @  £  $       {  [  ]  }  \           
*
*                                        §      
*     
*           š                          ^  ½     
*
*      |  ž                                      
*
*                                                     
*
*/
// Row 1
#define EE_AT ALGR(EE_2) // @
#define EE_PND ALGR(EE_3) // £
#define EE_DLR ALGR(EE_4) // $
#define EE_EURO ALGR(EE_5) // €
#define EE_LCBR ALGR(EE_7) // {
#define EE_LBRC ALGR(EE_8) // [
#define EE_RBRC ALGR(EE_9) // ]
#define EE_RCBR ALGR(EE_0) // }
#define EE_BSLS ALGR(EE_PLUS) // (backslash)
// Row 2
#define EE_SECT ALGR(EE_OTIL) // §
// Row 3
#define EE_SCAR ALGR(EE_S) // š
#define EE_CIRC ALGR(EE_ADIA) // ^ (dead)
#define EE_HALF ALGR(EE_QUOT) // ½
// Row 4
#define EE_PIPE ALGR(EE_LABK) // |
#define EE_ZCAR ALGR(EE_Z) // ž

View file

@ -0,0 +1,152 @@
/* Copyright 2020
*
* 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 "keymap.h"
// clang-format off
/*
*
*  `  1  2  3  4  5  6  7  8  9  0  -  =        
*
*       Q  W  E  R  T  Y  U  I  O  P  [  ]      
*     
*        A  S  D  F  G  H  J  K  L  ;  '  #     
*
*      \  Z  X  C  V  B  N  M  ,  .  /           
*
*                                                     
*
*/
// Row 1
#define IE_GRV KC_GRV // `
#define IE_1 KC_1 // 1
#define IE_2 KC_2 // 2
#define IE_3 KC_3 // 3
#define IE_4 KC_4 // 4
#define IE_5 KC_5 // 5
#define IE_6 KC_6 // 6
#define IE_7 KC_7 // 7
#define IE_8 KC_8 // 8
#define IE_9 KC_9 // 9
#define IE_0 KC_0 // 0
#define IE_MINS KC_MINS // -
#define IE_EQL KC_EQL // =
// Row 2
#define IE_Q KC_Q // Q
#define IE_W KC_W // W
#define IE_E KC_E // E
#define IE_R KC_R // R
#define IE_T KC_T // T
#define IE_Y KC_Y // Y
#define IE_U KC_U // U
#define IE_I KC_I // I
#define IE_O KC_O // O
#define IE_P KC_P // P
#define IE_LBRC KC_LBRC // [
#define IE_RBRC KC_RBRC // ]
// Row 3
#define IE_A KC_A // A
#define IE_S KC_S // S
#define IE_D KC_D // D
#define IE_F KC_F // F
#define IE_G KC_G // G
#define IE_H KC_H // H
#define IE_J KC_J // J
#define IE_K KC_K // K
#define IE_L KC_L // L
#define IE_SCLN KC_SCLN // ;
#define IE_QUOT KC_QUOT // '
#define IE_HASH KC_NUHS // #
// Row 4
#define IE_BSLS KC_NUBS // (backslash)
#define IE_Z KC_Z // Z
#define IE_X KC_X // X
#define IE_C KC_C // C
#define IE_V KC_V // V
#define IE_B KC_B // B
#define IE_N KC_N // N
#define IE_M KC_M // M
#define IE_COMM KC_COMM // ,
#define IE_DOT KC_DOT // .
#define IE_SLSH KC_SLSH // /
/* Shifted symbols
*
*  ¬  !  " │ £ │ $ │ % │ ^ │ & │ * │ ( │ )  _  + │       │
*
*                                     {  }      
*     
*                                   :  @  ~     
*
*      |                       <  >  ?           
*
*                                                     
*
*/
// Row 1
#define IE_NOT S(IE_GRV) // ¬
#define IE_EXLM S(IE_1) // !
#define IE_DQUO S(IE_2) // "
#define IE_PND S(IE_3) // £
#define IE_DLR S(IE_4) // $
#define IE_PERC S(IE_5) // %
#define IE_CIRC S(IE_6) // ^
#define IE_AMPR S(IE_7) // &
#define IE_ASTR S(IE_8) // *
#define IE_LPRN S(IE_9) // (
#define IE_RPRN S(IE_0) // )
#define IE_UNDS S(IE_MINS) // _
#define IE_PLUS S(IE_EQL) // +
// Row 2
#define IE_LCBR S(IE_LBRC) // {
#define IE_RCBR S(IE_RBRC) // }
// Row 3
#define IE_COLN S(IE_SCLN) // :
#define IE_AT S(IE_QUOT) // @
#define IE_TILD S(IE_HASH) // ~
// Row 4
#define IE_PIPE S(IE_BSLS) // |
#define IE_LABK S(IE_COMM) // <
#define IE_RABK S(IE_DOT) // >
#define IE_QUES S(IE_SLSH) // ?
/* AltGr symbols
*
*  ¦                                           
*
*             É           Ú  Í  Ó               
*     
*        Á                             ´        
*
*                                                
*
*                                                     
*
*/
// Row 1
#define IE_BRKP ALGR(IE_GRV) // ¦
#define IE_EURO ALGR(IE_4) // €
// Row 2
#define IE_EACU ALGR(IE_E) // É
#define IE_UACU ALGR(IE_U) // Ú
#define IE_IACU ALGR(IE_I) // Í
#define IE_OACU ALGR(IE_O) // Ó
// Row 3
#define IE_AACU ALGR(IE_A) // Á
#define IE_ACUT ALGR(IE_QUOT) // ´ (dead)

View file

@ -166,7 +166,7 @@
// DEPRECATED
#define IT_BKSL IT_BSLS
#define IT_QUOT IT_APOS
#define IT_APOS IT_QUOT
#define IT_IACC IT_IGRV
#define IT_EACC IT_EGRV
#define IT_OACC IT_OGRV

View file

@ -0,0 +1,100 @@
/* Copyright 2020
*
* 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/>.
*/
// Sendstring lookup tables for Croatian layouts
#pragma once
#include "keymap_croatian.h"
#include "quantum.h"
// clang-format off
const uint8_t ascii_to_shift_lut[16] PROGMEM = {
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
KCLUT_ENTRY(0, 1, 1, 1, 1, 1, 1, 0),
KCLUT_ENTRY(1, 1, 1, 0, 0, 0, 0, 1),
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
KCLUT_ENTRY(0, 0, 1, 1, 0, 1, 1, 1),
KCLUT_ENTRY(0, 1, 1, 1, 1, 1, 1, 1),
KCLUT_ENTRY(1, 1, 1, 1, 1, 1, 1, 1),
KCLUT_ENTRY(1, 1, 1, 1, 1, 1, 1, 1),
KCLUT_ENTRY(1, 1, 1, 0, 0, 0, 0, 1),
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0)
};
const uint8_t ascii_to_altgr_lut[16] PROGMEM = {
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
KCLUT_ENTRY(1, 0, 0, 0, 0, 0, 0, 0),
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
KCLUT_ENTRY(0, 0, 0, 1, 1, 1, 1, 0),
KCLUT_ENTRY(1, 0, 0, 0, 0, 0, 0, 0),
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
KCLUT_ENTRY(0, 0, 0, 1, 1, 1, 1, 0)
};
const uint8_t ascii_to_keycode_lut[128] PROGMEM = {
// NUL SOH STX ETX EOT ENQ ACK BEL
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
// BS TAB LF VT FF CR SO SI
KC_BSPC, KC_TAB, KC_ENT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
// DLE DC1 DC2 DC3 DC4 NAK SYN ETB
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
// CAN EM SUB ESC FS GS RS US
XXXXXXX, XXXXXXX, XXXXXXX, KC_ESC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
// ! " # $ % & '
KC_SPC, HR_1, HR_2, HR_3, HR_4, HR_5, HR_6, HR_QUOT,
// ( ) * + , - . /
HR_8, HR_9, HR_PLUS, HR_PLUS, HR_COMM, HR_MINS, HR_DOT, HR_7,
// 0 1 2 3 4 5 6 7
HR_0, HR_1, HR_2, HR_3, HR_4, HR_5, HR_6, HR_7,
// 8 9 : ; < = > ?
HR_8, HR_9, HR_DOT, HR_COMM, HR_LABK, HR_0, HR_LABK, HR_QUOT,
// @ A B C D E F G
HR_V, HR_A, HR_B, HR_C, HR_D, HR_E, HR_F, HR_G,
// H I J K L M N O
HR_H, HR_I, HR_J, HR_K, HR_L, HR_M, HR_N, HR_O,
// P Q R S T U V W
HR_P, HR_Q, HR_R, HR_S, HR_T, HR_U, HR_V, HR_W,
// X Y Z [ \ ] ^ _
HR_X, HR_Y, HR_Z, HR_F, HR_Q, HR_G, HR_3, HR_MINS,
// ` a b c d e f g
HR_7, HR_A, HR_B, HR_C, HR_D, HR_E, HR_F, HR_G,
// h i j k l m n o
HR_H, HR_I, HR_J, HR_K, HR_L, HR_M, HR_N, HR_O,
// p q r s t u v w
HR_P, HR_Q, HR_R, HR_S, HR_T, HR_U, HR_V, HR_W,
// x y z { | } ~ DEL
HR_X, HR_Y, HR_Z, HR_B, HR_W, HR_N, HR_1, KC_DEL
};

View file

@ -0,0 +1,100 @@
/* Copyright 2020
*
* 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/>.
*/
// Sendstring lookup tables for Czech layouts
#pragma once
#include "keymap_czech.h"
#include "quantum.h"
// clang-format off
const uint8_t ascii_to_shift_lut[16] PROGMEM = {
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
KCLUT_ENTRY(0, 1, 1, 0, 0, 1, 0, 1),
KCLUT_ENTRY(1, 0, 0, 0, 0, 0, 0, 1),
KCLUT_ENTRY(1, 1, 1, 1, 1, 1, 1, 1),
KCLUT_ENTRY(1, 1, 1, 0, 0, 0, 0, 1),
KCLUT_ENTRY(0, 1, 1, 1, 1, 1, 1, 1),
KCLUT_ENTRY(1, 1, 1, 1, 1, 1, 1, 1),
KCLUT_ENTRY(1, 1, 1, 1, 1, 1, 1, 1),
KCLUT_ENTRY(1, 1, 1, 0, 0, 0, 0, 1),
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0)
};
const uint8_t ascii_to_altgr_lut[16] PROGMEM = {
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
KCLUT_ENTRY(0, 0, 0, 1, 1, 0, 1, 0),
KCLUT_ENTRY(0, 0, 1, 0, 0, 0, 0, 0),
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
KCLUT_ENTRY(0, 0, 0, 0, 1, 0, 1, 0),
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
KCLUT_ENTRY(0, 0, 0, 1, 0, 1, 1, 0),
KCLUT_ENTRY(1, 0, 0, 0, 0, 0, 0, 0),
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
KCLUT_ENTRY(0, 0, 0, 1, 0, 1, 1, 0),
};
const uint8_t ascii_to_keycode_lut[128] PROGMEM = {
// NUL SOH STX ETX EOT ENQ ACK BEL
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
// BS TAB LF VT FF CR SO SI
KC_BSPC, KC_TAB, KC_ENT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
// DLE DC1 DC2 DC3 DC4 NAK SYN ETB
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
// CAN EM SUB ESC FS GS RS US
XXXXXXX, XXXXXXX, XXXXXXX, KC_ESC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
// ! " # $ % & '
KC_SPC, CZ_SECT, CZ_URNG, CZ_X, CZ_URNG, CZ_EQL, CZ_C, CZ_DIAE,
// ( ) * + , - . /
CZ_LPRN, CZ_LPRN, CZ_MINS, CZ_PLUS, CZ_COMM, CZ_MINS, CZ_DOT, CZ_UACU,
// 0 1 2 3 4 5 6 7
CZ_EACU, CZ_PLUS, CZ_ECAR, CZ_SCAR, CZ_CCAR, CZ_RCAR, CZ_ZCAR, CZ_YACU,
// 8 9 : ; < = > ?
CZ_AACU, CZ_IACU, CZ_DOT, CZ_SCLN, CZ_COMM, CZ_EQL, CZ_DOT, CZ_COMM,
// @ A B C D E F G
CZ_V, CZ_A, CZ_B, CZ_C, CZ_D, CZ_E, CZ_F, CZ_G,
// H I J K L M N O
CZ_H, CZ_I, CZ_J, CZ_K, CZ_L, CZ_M, CZ_N, CZ_O,
// P Q R S T U V W
CZ_P, CZ_Q, CZ_R, CZ_S, CZ_T, CZ_U, CZ_V, CZ_W,
// X Y Z [ \ ] ^ _
CZ_X, CZ_Y, CZ_Z, CZ_F, CZ_BSLS, CZ_G, CZ_SCAR, CZ_MINS,
// ` a b c d e f g
CZ_YACU, CZ_A, CZ_B, CZ_C, CZ_D, CZ_E, CZ_F, CZ_G,
// h i j k l m n o
CZ_H, CZ_I, CZ_J, CZ_K, CZ_L, CZ_M, CZ_N, CZ_O,
// p q r s t u v w
CZ_P, CZ_Q, CZ_R, CZ_S, CZ_T, CZ_U, CZ_V, CZ_W,
// x y z { | } ~ DEL
CZ_X, CZ_Y, CZ_Z, CZ_B, CZ_BSLS, CZ_N, CZ_PLUS, KC_DEL
};

View file

@ -0,0 +1,100 @@
/* Copyright 2020
*
* 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/>.
*/
// Sendstring lookup tables for Estonian layouts
#pragma once
#include "keymap_estonian.h"
#include "quantum"
// clang-format off
const uint8_t ascii_to_shift_lut[16] PROGMEM = {
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
KCLUT_ENTRY(0, 1, 1, 1, 0, 1, 1, 0),
KCLUT_ENTRY(1, 1, 1, 0, 0, 0, 0, 1),
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
KCLUT_ENTRY(0, 0, 1, 1, 0, 1, 1, 1),
KCLUT_ENTRY(0, 1, 1, 1, 1, 1, 1, 1),
KCLUT_ENTRY(1, 1, 1, 1, 1, 1, 1, 1),
KCLUT_ENTRY(1, 1, 1, 1, 1, 1, 1, 1),
KCLUT_ENTRY(1, 1, 1, 0, 0, 0, 0, 1),
KCLUT_ENTRY(1, 0, 0, 0, 0, 0, 0, 0),
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0)
};
const uint8_t ascii_to_altgr_lut[16] PROGMEM = {
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
KCLUT_ENTRY(0, 0, 0, 0, 1, 0, 0, 0),
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
KCLUT_ENTRY(1, 0, 0, 0, 0, 0, 0, 0),
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
KCLUT_ENTRY(0, 0, 0, 1, 1, 1, 1, 0),
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
KCLUT_ENTRY(0, 0, 0, 1, 1, 1, 1, 0)
};
const uint8_t ascii_to_keycode_lut[128] PROGMEM = {
// NUL SOH STX ETX EOT ENQ ACK BEL
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
// BS TAB LF VT FF CR SO SI
KC_BSPC, KC_TAB, KC_ENT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
// DLE DC1 DC2 DC3 DC4 NAK SYN ETB
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
// CAN EM SUB ESC FS GS RS US
XXXXXXX, XXXXXXX, XXXXXXX, KC_ESC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
// ! " # $ % & '
KC_SPC, EE_1, EE_2, EE_3, EE_4, EE_5, EE_6, EE_QUOT,
// ( ) * + , - . /
EE_8, EE_9, EE_QUOT, EE_PLUS, EE_COMM, EE_MINS, EE_DOT, EE_7,
// 0 1 2 3 4 5 6 7
EE_0, EE_1, EE_2, EE_3, EE_4, EE_5, EE_6, EE_7,
// 8 9 : ; < = > ?
EE_8, EE_9, EE_DOT, EE_COMM, EE_LABK, EE_0, EE_LABK, EE_PLUS,
// @ A B C D E F G
EE_2, EE_A, EE_B, EE_C, EE_D, EE_E, EE_F, EE_G,
// H I J K L M N O
EE_H, EE_I, EE_J, EE_K, EE_L, EE_M, EE_N, EE_O,
// P Q R S T U V W
EE_P, EE_Q, EE_R, EE_S, EE_T, EE_U, EE_V, EE_W,
// X Y Z [ \ ] ^ _
EE_X, EE_Y, EE_Z, EE_8, EE_PLUS, EE_9, EE_ADIA, EE_MINS,
// ` a b c d e f g
EE_ACUT, EE_A, EE_B, EE_C, EE_D, EE_E, EE_F, EE_G,
// h i j k l m n o
EE_H, EE_I, EE_J, EE_K, EE_L, EE_M, EE_N, EE_O,
// p q r s t u v w
EE_P, EE_Q, EE_R, EE_S, EE_T, EE_U, EE_V, EE_W,
// x y z { | } ~ DEL
EE_X, EE_Y, EE_Z, EE_7, EE_LABK, EE_0, EE_CARN, KC_DEL
};

View file

@ -17,9 +17,12 @@
#include "print.h"
#include "process_combo.h"
__attribute__((weak)) combo_t key_combos[COMBO_COUNT] = {
};
#ifndef COMBO_VARIABLE_LEN
__attribute__((weak)) combo_t key_combos[COMBO_COUNT] = {};
#else
extern combo_t key_combos[];
extern int COMBO_LEN;
#endif
__attribute__((weak)) void process_combo_event(uint8_t combo_index, bool pressed) {}
@ -141,8 +144,11 @@ bool process_combo(uint16_t keycode, keyrecord_t *record) {
if (!is_combo_enabled()) {
return true;
}
#ifndef COMBO_VARIABLE_LEN
for (current_combo_index = 0; current_combo_index < COMBO_COUNT; ++current_combo_index) {
#else
for (current_combo_index = 0; current_combo_index < COMBO_LEN; ++current_combo_index) {
#endif
combo_t *combo = &key_combos[current_combo_index];
is_combo_key |= process_single_combo(combo, keycode, record);
no_combo_keys_pressed = no_combo_keys_pressed && NO_COMBO_KEYS_ARE_DOWN;

View file

@ -120,6 +120,10 @@ __attribute__((weak)) bool process_record_kb(uint16_t keycode, keyrecord_t *reco
__attribute__((weak)) bool process_record_user(uint16_t keycode, keyrecord_t *record) { return true; }
__attribute__((weak)) void post_process_record_kb(uint16_t keycode, keyrecord_t *record) { post_process_record_user(keycode, record); }
__attribute__((weak)) void post_process_record_user(uint16_t keycode, keyrecord_t *record) {}
void reset_keyboard(void) {
clear_keyboard();
#if defined(MIDI_ENABLE) && defined(MIDI_BASIC)
@ -172,9 +176,15 @@ uint16_t get_event_keycode(keyevent_t event) {
return keymap_key_to_keycode(layer_switch_get_layer(event.key), event.key);
}
/* Main keycode processing function. Hands off handling to other functions,
* then processes internal Quantum keycodes, then processes ACTIONs.
*/
/* Get keycode, and then call keyboard function */
void post_process_record_quantum(keyrecord_t *record) {
uint16_t keycode = get_record_keycode(record);
post_process_record_kb(keycode, record);
}
/* Core keycode function, hands off handling to other functions,
then processes internal quantum keycodes, and then processes
ACTIONs. */
bool process_record_quantum(keyrecord_t *record) {
uint16_t keycode = get_record_keycode(record);
@ -192,6 +202,12 @@ bool process_record_quantum(keyrecord_t *record) {
}
#endif
#ifdef WPM_ENABLE
if (record->event.pressed) {
update_wpm(keycode);
}
#endif
#ifdef TAP_DANCE_ENABLE
preprocess_tap_dance(keycode, record);
#endif
@ -648,6 +664,10 @@ void matrix_scan_quantum() {
encoder_read();
#endif
#ifdef WPM_ENABLE
decay_wpm();
#endif
#ifdef HAPTIC_ENABLE
haptic_task();
#endif

View file

@ -182,6 +182,10 @@ extern layer_state_t layer_state;
# include "via.h"
#endif
#ifdef WPM_ENABLE
# include "wpm.h"
#endif
// Function substitutions to ease GPIO manipulation
#if defined(__AVR__)
typedef uint8_t pin_t;
@ -257,6 +261,8 @@ uint16_t get_event_keycode(keyevent_t event);
bool process_action_kb(keyrecord_t *record);
bool process_record_kb(uint16_t keycode, keyrecord_t *record);
bool process_record_user(uint16_t keycode, keyrecord_t *record);
void post_process_record_kb(uint16_t keycode, keyrecord_t *record);
void post_process_record_user(uint16_t keycode, keyrecord_t *record);
#ifndef BOOTMAGIC_LITE_COLUMN
# define BOOTMAGIC_LITE_COLUMN 0

View file

@ -111,7 +111,6 @@ const point_t k_rgb_matrix_center = RGB_MATRIX_CENTER;
# define RGB_MATRIX_STARTUP_SPD UINT8_MAX / 2
#endif
bool g_suspend_state = false;
rgb_config_t rgb_matrix_config;

View file

@ -35,6 +35,9 @@ typedef struct _I2C_slave_buffer_t {
# ifdef ENCODER_ENABLE
uint8_t encoder_state[NUMBER_OF_ENCODERS];
# endif
# ifdef WPM_ENABLE
uint8_t current_wpm;
# endif
} I2C_slave_buffer_t;
static I2C_slave_buffer_t *const i2c_buffer = (I2C_slave_buffer_t *)i2c_slave_reg;
@ -43,6 +46,7 @@ static I2C_slave_buffer_t *const i2c_buffer = (I2C_slave_buffer_t *)i2c_slave_re
# define I2C_RGB_START offsetof(I2C_slave_buffer_t, rgblight_sync)
# define I2C_KEYMAP_START offsetof(I2C_slave_buffer_t, smatrix)
# define I2C_ENCODER_START offsetof(I2C_slave_buffer_t, encoder_state)
# define I2C_WPM_START offsetof(I2C_slave_buffer_t, current_wpm)
# define TIMEOUT 100
@ -79,6 +83,14 @@ bool transport_master(matrix_row_t matrix[]) {
encoder_update_raw(i2c_buffer->encoder_state);
# endif
# ifdef WPM_ENABLE
uint8_t current_wpm = get_current_wpm();
if (current_wpm != i2c_buffer->current_wpm) {
if (i2c_writeReg(SLAVE_I2C_ADDRESS, I2C_WPM_START, (void *)&current_wpm, sizeof(current_wpm), TIMEOUT) >= 0) {
i2c_buffer->current_wpm = current_wpm;
}
}
# endif
return true;
}
@ -102,6 +114,10 @@ void transport_slave(matrix_row_t matrix[]) {
# ifdef ENCODER_ENABLE
encoder_state_raw(i2c_buffer->encoder_state);
# endif
# ifdef WPM_ENABLE
set_current_wpm(i2c_buffer->current_wpm);
# endif
}
void transport_master_init(void) { i2c_init(); }
@ -126,6 +142,9 @@ typedef struct _Serial_m2s_buffer_t {
# ifdef BACKLIGHT_ENABLE
uint8_t backlight_level;
# endif
# ifdef WPM_ENABLE
uint8_t current_wpm;
# endif
} Serial_m2s_buffer_t;
# if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_SPLIT)
@ -228,6 +247,10 @@ bool transport_master(matrix_row_t matrix[]) {
encoder_update_raw((uint8_t *)serial_s2m_buffer.encoder_state);
# endif
# ifdef WPM_ENABLE
// Write wpm to slave
serial_m2s_buffer.current_wpm = get_current_wpm();
# endif
return true;
}
@ -244,6 +267,10 @@ void transport_slave(matrix_row_t matrix[]) {
# ifdef ENCODER_ENABLE
encoder_state_raw((uint8_t *)serial_s2m_buffer.encoder_state);
# endif
# ifdef WPM_ENABLE
set_current_wpm(serial_m2s_buffer.current_wpm);
# endif
}
#endif

View file

@ -197,7 +197,7 @@ section at the end of this file).
/* -------------------------- Device Description --------------------------- */
#define USB_CFG_VENDOR_ID (VENDOR_ID & 0xFF), ((VENDOR_ID >> 8) & 0xFF)
#define USB_CFG_VENDOR_ID
/* USB vendor ID for the device, low byte first. If you have registered your
* own Vendor ID, define it here. Otherwise you may use one of obdev's free
* shared VID/PID pairs. Be sure to read USB-IDs-for-free.txt for rules!
@ -206,7 +206,7 @@ section at the end of this file).
* with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand
* the implications!
*/
#define USB_CFG_DEVICE_ID (PRODUCT_ID & 0xFF), ((PRODUCT_ID >> 8) & 0xFF)
#define USB_CFG_DEVICE_ID
/* This is the ID of the product, low byte first. It is interpreted in the
* scope of the vendor ID. If you have registered your own VID with usb.org
* or if you have licensed a PID from somebody else, define it here. Otherwise
@ -217,34 +217,6 @@ section at the end of this file).
* with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand
* the implications!
*/
#define USB_CFG_DEVICE_VERSION (DEVICE_VER & 0xFF), ((DEVICE_VER >> 8) & 0xFF)
/* Version number of the device: Minor number first, then major number.
*/
#define USB_CFG_VENDOR_NAME 'w', 'i', 'n', 'k', 'e', 'y', 'l', 'e', 's', 's', '.', 'k', 'r'
#define USB_CFG_VENDOR_NAME_LEN 13
/* These two values define the vendor name returned by the USB device. The name
* must be given as a list of characters under single quotes. The characters
* are interpreted as Unicode (UTF-16) entities.
* If you don't want a vendor name string, undefine these macros.
* ALWAYS define a vendor name containing your Internet domain name if you use
* obdev's free shared VID/PID pair. See the file USB-IDs-for-free.txt for
* details.
*/
#define USB_CFG_DEVICE_NAME 'p', 's', '2', 'a', 'v', 'r', 'G', 'B'
#define USB_CFG_DEVICE_NAME_LEN 8
/* Same as above for the device name. If you don't want a device name, undefine
* the macros. See the file USB-IDs-for-free.txt before you assign a name if
* you use a shared VID/PID.
*/
/*#define USB_CFG_SERIAL_NUMBER 'N', 'o', 'n', 'e' */
/*#define USB_CFG_SERIAL_NUMBER_LEN 0 */
/* Same as above for the serial number. If you don't want a serial number,
* undefine the macros.
* It may be useful to provide the serial number through other means than at
* compile time. See the section about descriptor properties below for how
* to fine tune control over USB descriptors such as the string descriptor
* for the serial number.
*/
#define USB_CFG_DEVICE_CLASS 0
#define USB_CFG_DEVICE_SUBCLASS 0
/* See USB specification if you want to conform to an existing device class.
@ -323,18 +295,15 @@ section at the end of this file).
* };
*/
#define USB_CFG_DESCR_PROPS_DEVICE 0
#define USB_CFG_DESCR_PROPS_DEVICE USB_PROP_IS_DYNAMIC
#define USB_CFG_DESCR_PROPS_CONFIGURATION USB_PROP_IS_DYNAMIC
//#define USB_CFG_DESCR_PROPS_CONFIGURATION 0
#define USB_CFG_DESCR_PROPS_STRINGS 0
#define USB_CFG_DESCR_PROPS_STRING_0 0
#define USB_CFG_DESCR_PROPS_STRING_VENDOR 0
#define USB_CFG_DESCR_PROPS_STRING_PRODUCT 0
#define USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER 0
#define USB_CFG_DESCR_PROPS_STRINGS USB_PROP_IS_DYNAMIC
#define USB_CFG_DESCR_PROPS_STRING_0 USB_PROP_IS_DYNAMIC
#define USB_CFG_DESCR_PROPS_STRING_VENDOR USB_PROP_IS_DYNAMIC
#define USB_CFG_DESCR_PROPS_STRING_PRODUCT USB_PROP_IS_DYNAMIC
#define USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER USB_PROP_IS_DYNAMIC
#define USB_CFG_DESCR_PROPS_HID USB_PROP_IS_DYNAMIC
//#define USB_CFG_DESCR_PROPS_HID 0
#define USB_CFG_DESCR_PROPS_HID_REPORT USB_PROP_IS_DYNAMIC
//#define USB_CFG_DESCR_PROPS_HID_REPORT 0
#define USB_CFG_DESCR_PROPS_UNKNOWN 0
#define usbMsgPtr_t unsigned short

64
quantum/wpm.c Normal file
View file

@ -0,0 +1,64 @@
/*
* Copyright 2020 Richard Sutherland (rich@brickbots.com)
*
* 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 "wpm.h"
// WPM Stuff
static uint8_t current_wpm = 0;
static uint8_t latest_wpm = 0;
static uint16_t wpm_timer = 0;
// This smoothing is 40 keystrokes
static const float wpm_smoothing = 0.0487;
void set_current_wpm(uint8_t new_wpm) { current_wpm = new_wpm; }
uint8_t get_current_wpm(void) { return current_wpm; }
bool wpm_keycode(uint16_t keycode) { return wpm_keycode_kb(keycode); }
__attribute__((weak)) bool wpm_keycode_kb(uint16_t keycode) { return wpm_keycode_user(keycode); }
__attribute__((weak)) bool wpm_keycode_user(uint16_t keycode) {
if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX) || (keycode >= QK_MODS && keycode <= QK_MODS_MAX)) {
keycode = keycode & 0xFF;
} else if (keycode > 0xFF) {
keycode = 0;
}
if ((keycode >= KC_A && keycode <= KC_0) || (keycode >= KC_TAB && keycode <= KC_SLASH)) {
return true;
}
return false;
}
void update_wpm(uint16_t keycode) {
if (wpm_keycode(keycode)) {
if (wpm_timer > 0) {
latest_wpm = 60000 / timer_elapsed(wpm_timer) / 5;
current_wpm = (latest_wpm - current_wpm) * wpm_smoothing + current_wpm;
}
wpm_timer = timer_read();
}
}
void decay_wpm(void) {
if (timer_elapsed(wpm_timer) > 1000) {
current_wpm = (0 - current_wpm) * wpm_smoothing + current_wpm;
wpm_timer = timer_read();
}
}

30
quantum/wpm.h Normal file
View file

@ -0,0 +1,30 @@
/*
* Copyright 2020 Richard Sutherland (rich@brickbots.com)
*
* 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"
bool wpm_keycode(uint16_t keycode);
bool wpm_keycode_kb(uint16_t keycode);
bool wpm_keycode_user(uint16_t keycode);
void set_current_wpm(uint8_t);
uint8_t get_current_wpm(void);
void update_wpm(uint16_t);
void decay_wpm(void);