aboutsummaryrefslogtreecommitdiffstats
path: root/quantum/fauxclicky.h
diff options
context:
space:
mode:
authorGravatar Priyadi Iman Nurcahyo <priyadi@priyadi.net>2017-02-13 14:55:35 +0700
committerGravatar Priyadi Iman Nurcahyo <priyadi@priyadi.net>2017-02-13 14:55:35 +0700
commit8c93c5d9ab8a0a69d84f707db71f417b66402693 (patch)
tree47f9577431d21f7c54ed8ff0d68e77f4a42123a9 /quantum/fauxclicky.h
parentc68e596f32c5d450a714627871408407e9988ef7 (diff)
downloadqmk_firmware-8c93c5d9ab8a0a69d84f707db71f417b66402693.tar.gz
Add keycodes to turn on, turn off and toggle faux clicky
Diffstat (limited to 'quantum/fauxclicky.h')
-rw-r--r--quantum/fauxclicky.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/quantum/fauxclicky.h b/quantum/fauxclicky.h
index 6cfc291c0..109bd0d83 100644
--- a/quantum/fauxclicky.h
+++ b/quantum/fauxclicky.h
@@ -18,6 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#endif
#include "musical_notes.h"
+#include "stdbool.h"
__attribute__ ((weak))
float fauxclicky_pressed_note[2];
@@ -26,6 +27,8 @@ float fauxclicky_released_note[2];
__attribute__ ((weak))
float fauxclicky_beep_note[2];
+bool fauxclicky_enabled;
+
//
// tempo in BPM
//
@@ -52,6 +55,15 @@ float fauxclicky_beep_note[2];
fauxclicky_stop(); \
} while (0)
+// toggle
+#define FAUXCLICKY_TOGGLE do { \
+ if (fauxclicky_enabled) { \
+ FAUXCLICKY_OFF; \
+ } else { \
+ FAUXCLICKY_ON; \
+ } \
+} while (0)
+
//
// pin configuration
//