diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2021-02-11 08:10:12 +0100 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2021-02-13 05:53:45 +0100 |
commit | aa6c480f40241471d12c317c72acd94c2148a991 (patch) | |
tree | 1a6ed6298f3fef109a1989f313f7f1d75449f2ba /command.c | |
parent | dff9b75c6fb900830e478ad5c71ca42efe34ffc6 (diff) | |
download | tmk7637-aa6c480f40241471d12c317c72acd94c2148a991.tar.gz |
added the K7637 firmware
Diffstat (limited to 'command.c')
-rw-r--r-- | command.c | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/command.c b/command.c new file mode 100644 index 0000000..6827706 --- /dev/null +++ b/command.c @@ -0,0 +1,60 @@ +/* +Copyright 2021 Robin Haberkorn <robin.haberkorn@googlemail.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 <stdbool.h> +#include <stdint.h> + +#include "debug.h" +#include "led.h" +#include "host.h" +#include "keycode.h" +#include "keyclick.h" +#include "pwm.h" +#include "song.h" +#include "command.h" + +enum keyclick_mode keyclick_mode = KEYCLICK_OFF; + +bool command_extra(uint8_t code) +{ + switch (code) { + //case KC_AUDIO_MUTE: + case KC_SPACE: + keyclick_mode = (keyclick_mode+1) % KEYCLICK_MAX; + dprintf("new keyclick mode: %u\n", keyclick_mode); + /* FIXME: Perhaps do this in matrix_scan() */ + keyclick_solenoid_set(false); + pwm_pb5_set_tone(0); + /* update the keyclick mode LED */ + led_set(host_keyboard_leds()); + return true; + + /* + * NOTE: The Fx keys are also used in command_common() + * but do the same as the number keys (switch layers). + * It should therefore be safe to repurpose them. + */ + case KC_F1: + song_play_ruinen(); + return true; + case KC_F2: + song_play_kitt(); + return true; + } + + return false; +} |