From aa6c480f40241471d12c317c72acd94c2148a991 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Thu, 11 Feb 2021 08:10:12 +0100 Subject: added the K7637 firmware --- command.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 command.c (limited to 'command.c') 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 + +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 . +*/ + +#include +#include + +#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; +} -- cgit v1.2.3