aboutsummaryrefslogtreecommitdiffstats
path: root/moder.c
diff options
context:
space:
mode:
Diffstat (limited to 'moder.c')
-rw-r--r--moder.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/moder.c b/moder.c
new file mode 100644
index 0000000..a10a6da
--- /dev/null
+++ b/moder.c
@@ -0,0 +1,26 @@
+#include <stdio.h>
+#include "dome_key_map.h"
+
+#define SIZE 2
+
+int main() {
+ HeadphoneButton mode_buttons[SIZE] = {HeadphoneButton_Play, HeadphoneButton_Up};
+ Trigger mode_trigger = {
+ .buttons = mode_buttons,
+ .length = SIZE
+ };
+ const CKeyActionResult *mode = c_run_key_action(mode_trigger, NULL);
+ printf("%d\n", *mode->kind);
+
+ HeadphoneButton buttons[] = {HeadphoneButton_Down};
+ Trigger trigger = {
+ .buttons = buttons,
+ .length = 1
+ };
+ const CKeyActionResult *result = c_run_key_action(trigger, mode->in_mode);
+
+ printf("%d\n", *result->kind);
+ printf("%s", result->action);
+
+ return 0;
+}