aboutsummaryrefslogtreecommitdiffstats
path: root/keyboards/clueboard/keymaps/tetris/tetris_text.h
diff options
context:
space:
mode:
authorJack Humbert <jack.humb@gmail.com>2017-08-30 11:27:52 -0400
committerGitHub <noreply@github.com>2017-08-30 11:27:52 -0400
commita729d852fe502d62e09bab1a31f49b738f8892e4 (patch)
tree5caaf1de34f2d46afa2b5991a7ea4e0663f2db85 /keyboards/clueboard/keymaps/tetris/tetris_text.h
parentda7aece043759f055063cb5d20bea4109891f917 (diff)
parent4a9e16b39499294a3ccc0e52e97696cab5d77668 (diff)
downloadfirmware-a729d852fe502d62e09bab1a31f49b738f8892e4.tar.gz
firmware-a729d852fe502d62e09bab1a31f49b738f8892e4.tar.bz2
firmware-a729d852fe502d62e09bab1a31f49b738f8892e4.zip
Merge pull request #1574 from danamlund/master
New clueboard keymap that is a tetris game
Diffstat (limited to 'keyboards/clueboard/keymaps/tetris/tetris_text.h')
-rw-r--r--keyboards/clueboard/keymaps/tetris/tetris_text.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/keyboards/clueboard/keymaps/tetris/tetris_text.h b/keyboards/clueboard/keymaps/tetris/tetris_text.h
new file mode 100644
index 000000000..25b4177e0
--- /dev/null
+++ b/keyboards/clueboard/keymaps/tetris/tetris_text.h
@@ -0,0 +1,45 @@
+/* Copyright 2017 Dan Amlund Thomsen
+ *
+ * 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/>.
+ */
+#ifndef TETRIS_TEXT_H
+#define TETRIS_TEXT_H
+
+//// to implement
+void tetris_send_up(void);
+void tetris_send_left(void);
+void tetris_send_down(void);
+void tetris_send_right(void);
+
+void tetris_send_backspace(void);
+void tetris_send_delete(void);
+
+void tetris_send_string(const char *s);
+
+void tetris_send_newline(void);
+
+// return = meaning
+// 0 = no keys pressed
+// 1 = up
+// 2 = left
+// 3 = down
+// 4 = right
+int tetris_get_keypress(void);
+
+//// to call
+void tetris_start(uint8_t seed);
+// returns 0 when game is over
+int tetris_tick(int ms_since_previous_tick);
+
+#endif