/ CircuitPython_Touch_Deck / touch_deck_layers.py
touch_deck_layers.py
  1  # SPDX-FileCopyrightText: 2021 foamyguy for Adafruit Industries
  2  #
  3  # SPDX-License-Identifier: MIT
  4  
  5  from adafruit_hid.keycode import Keycode
  6  from adafruit_hid.consumer_control_code import ConsumerControlCode
  7  
  8  MEDIA = 1
  9  KEY = 2
 10  STRING = 3
 11  KEY_PRESS = 4
 12  KEY_RELEASE = 5
 13  CHANGE_LAYER = 6
 14  
 15  touch_deck_config = {
 16      "layers": [
 17          {
 18              "name": "Youtube Controls",
 19              "shortcuts": [
 20                  {
 21                      "label": "Play",
 22                      "icon": "touch_deck_icons/pr_play.bmp",
 23                      "actions": (KEY, [Keycode.K]),
 24                  },
 25                  {
 26                      "label": "Pause",
 27                      "icon": "touch_deck_icons/pr_pause.bmp",
 28                      "actions": (KEY, [Keycode.K]),
 29                  },
 30                  {
 31                      "label": "Rewind",
 32                      "icon": "touch_deck_icons/pr_rewind.bmp",
 33                      "actions": (KEY, [Keycode.LEFT_ARROW]),
 34                  },
 35                  {
 36                      "label": "FastForward",
 37                      "icon": "touch_deck_icons/pr_ffwd.bmp",
 38                      "actions": (KEY, [Keycode.RIGHT_ARROW]),
 39                  },
 40                  {
 41                      "label": "Previous",
 42                      "icon": "touch_deck_icons/pr_previous.bmp",
 43                      "actions": (KEY, [Keycode.RIGHT_SHIFT, Keycode.P]),
 44                  },
 45                  {
 46                      "label": "Next",
 47                      "icon": "touch_deck_icons/pr_next.bmp",
 48                      "actions": (KEY, [Keycode.RIGHT_SHIFT, Keycode.N]),
 49                  },
 50                  {
 51                      "label": "Vol -",
 52                      "icon": "touch_deck_icons/pr_voldown.bmp",
 53                      "actions": (MEDIA, ConsumerControlCode.VOLUME_DECREMENT),
 54                  },
 55                  {
 56                      "label": "Vol +",
 57                      "icon": "touch_deck_icons/pr_volup.bmp",
 58                      "actions": (MEDIA, ConsumerControlCode.VOLUME_INCREMENT),
 59                  },
 60                  {
 61                      "label": "Fullscreen",
 62                      "icon": "touch_deck_icons/pr_fullscreen.bmp",
 63                      "actions": (KEY, [Keycode.F]),
 64                  },
 65                  {
 66                      "label": "Slow",
 67                      "icon": "touch_deck_icons/pr_slow.bmp",
 68                      "actions": (KEY, [Keycode.RIGHT_SHIFT, Keycode.COMMA]),
 69                  },
 70                  {
 71                      "label": "Fast",
 72                      "icon": "touch_deck_icons/pr_fast.bmp",
 73                      "actions": (KEY, [Keycode.RIGHT_SHIFT, Keycode.PERIOD]),
 74                  },
 75                  {
 76                      "label": "Mute",
 77                      "icon": "touch_deck_icons/pr_mute.bmp",
 78                      "actions": (KEY, [Keycode.M]),
 79                  },
 80              ],
 81          },
 82          {
 83              "name": "Discord",
 84              "shortcuts": [
 85                  {
 86                      "label": "Blinka",
 87                      "icon": "touch_deck_icons/af_blinka.bmp",
 88                      "actions": (STRING, ":blinka:"),
 89                  },
 90                  {
 91                      "label": "Adabot",
 92                      "icon": "touch_deck_icons/af_adabot.bmp",
 93                      "actions": (STRING, ":adabot:"),
 94                  },
 95                  {
 96                      "label": "Billie",
 97                      "icon": "touch_deck_icons/af_billie.bmp",
 98                      "actions": (STRING, ":billie:"),
 99                  },
100                  {
101                      "label": "Cappy",
102                      "icon": "touch_deck_icons/af_cappy.bmp",
103                      "actions": (STRING, ":cappy:"),
104                  },
105                  {
106                      "label": "Connie",
107                      "icon": "touch_deck_icons/af_connie.bmp",
108                      "actions": (STRING, ":connie:"),
109                  },
110                  {
111                      "label": "Gus",
112                      "icon": "touch_deck_icons/af_gus.bmp",
113                      "actions": (STRING, ":gus:"),
114                  },
115                  {
116                      "label": "Hans",
117                      "icon": "touch_deck_icons/af_hans.bmp",
118                      "actions": (STRING, ":hans:"),
119                  },
120                  {
121                      "label": "Mho",
122                      "icon": "touch_deck_icons/af_mho.bmp",
123                      "actions": (STRING, ":mho:"),
124                  },
125                  {
126                      "label": "Minerva",
127                      "icon": "touch_deck_icons/af_minerva.bmp",
128                      "actions": (STRING, ":minerva:"),
129                  },
130                  {
131                      "label": "NeoTrellis",
132                      "icon": "touch_deck_icons/af_neotrellis.bmp",
133                      "actions": (STRING, ":neotrellis:"),
134                  },
135                  {
136                      "label": "Ruby",
137                      "icon": "touch_deck_icons/af_ruby.bmp",
138                      "actions": (STRING, ":ruby:"),
139                  },
140                  {
141                      "label": "Sparky",
142                      "icon": "touch_deck_icons/af_sparky.bmp",
143                      "actions": (STRING, ":sparky:"),
144                  },
145              ],
146          },
147          {
148              "name": "Symbols",
149              "shortcuts": [
150                  {
151                      "label": "Infinity",  # ∞
152                      "icon": "touch_deck_icons/sy_infinity.bmp",
153                      "actions": (KEY, [Keycode.ALT, Keycode.FIVE]),
154                  },
155                  {
156                      "label": "Degree",  # º
157                      "icon": "touch_deck_icons/sy_degree.bmp",
158                      "actions": (KEY, [Keycode.ALT, Keycode.ZERO]),
159                  },
160                  {
161                      "label": "Pi",  # π
162                      "icon": "touch_deck_icons/sy_pi.bmp",
163                      "actions": (KEY, [Keycode.ALT, Keycode.P]),
164                  },
165                  {
166                      "label": "Sigma",  # ∑
167                      "icon": "touch_deck_icons/sy_sigma.bmp",
168                      "actions": (KEY, [Keycode.ALT, Keycode.W]),
169                  },
170                  {
171                      "label": "Partial diff",  #
172                      "icon": "touch_deck_icons/sy_pdiff.bmp",
173                      "actions": (KEY, [Keycode.ALT, Keycode.D]),
174                  },
175                  {
176                      "label": "Increment",  # ∆
177                      "icon": "touch_deck_icons/sy_increment.bmp",
178                      "actions": (KEY, [Keycode.ALT, Keycode.J]),
179                  },
180                  {
181                      "label": "Omega",  # Ω
182                      "icon": "touch_deck_icons/sy_omega.bmp",
183                      "actions": (KEY, [Keycode.ALT, Keycode.Z]),
184                  },
185                  {
186                      "label": "Mu",  # µ
187                      "icon": "touch_deck_icons/sy_micro.bmp",
188                      "actions": (KEY, [Keycode.ALT, Keycode.M]),
189                  },
190                  {
191                      "label": "Rad O",  # Ø
192                      "icon": "touch_deck_icons/sy_rado.bmp",
193                      "actions": (KEY, [Keycode.ALT, Keycode.SHIFT, Keycode.O]),
194                  },
195                  {
196                      "label": "Square root",  # √
197                      "icon": "touch_deck_icons/sy_sqrrt.bmp",
198                      "actions": (KEY, [Keycode.ALT, Keycode.V]),
199                  },
200                  {
201                      "label": "Approx",  # ≈
202                      "icon": "touch_deck_icons/sy_approx.bmp",
203                      "actions": (KEY, [Keycode.ALT, Keycode.X]),
204                  },
205                  {
206                      "label": "Plus minus",  # ±
207                      "icon": "touch_deck_icons/sy_plusminus.bmp",
208                      "actions": (KEY, [Keycode.ALT, Keycode.SHIFT, Keycode.EQUALS]),
209                  },
210              ],
211          },
212      ]
213  }